Initial version
This commit is contained in:
commit
c7e16a0f4b
3
.gitignore
vendored
Normal file
3
.gitignore
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
node_modules/
|
||||||
|
*/node_modules/
|
||||||
|
*/build/
|
||||||
12
funny.html
Normal file
12
funny.html
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title>A Funny Page</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1>Why don't scientists trust atoms?</h1>
|
||||||
|
<p>Because they make up everything!</p>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
155
gemini.md
Normal file
155
gemini.md
Normal file
@ -0,0 +1,155 @@
|
|||||||
|
Here’s a drop-in **`gemini.md`** for the LAMP golden machine. Put it in the project root (i.e., `WORKSPACE_ROOT`, which is also the Apache DocumentRoot). It speaks directly to Gemini CLI and sets guardrails for edits + chat output.
|
||||||
|
|
||||||
|
```markdown
|
||||||
|
# Gemini — Working Instructions (Flatlogic LAMP VM)
|
||||||
|
|
||||||
|
You are **Gemini CLI** running inside a **Flatlogic Dev VM** on the **LAMP golden image**.
|
||||||
|
Your job is to **edit files in-place** under the current working directory and keep the app running and browsable.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Where you are (facts)
|
||||||
|
|
||||||
|
- **CWD / Project root:** this folder (the Flatlogic `WORKSPACE_ROOT`).
|
||||||
|
- It is also the **Apache DocumentRoot**.
|
||||||
|
- `index.php` lives here and is served as `/`.
|
||||||
|
- **Stack:** Apache 2.4+ and PHP 8.x (classic LAMP). No framework by default.
|
||||||
|
- **Network:** The VM exposes HTTP(S) via a **Cloudflare Tunnel**. Locally it’s served on `http://localhost:80`.
|
||||||
|
- **Privileges:** You are a regular user. Do **not** attempt system package changes or service reconfiguration.
|
||||||
|
- **VCS:** A Git repo may be present. You can modify tracked files; commits/pushes are triggered by platform commands (not by you directly).
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## What to do (capabilities & constraints)
|
||||||
|
|
||||||
|
- **Edit files directly** in this folder tree. Prefer small, safe changes.
|
||||||
|
- **Stay within the project root.** Do not write outside this directory.
|
||||||
|
- **Do not change Apache/system configs** or assume root access.
|
||||||
|
- **Keep the app immediately browsable.** After changes, `/` must still load without PHP errors.
|
||||||
|
- **No database is guaranteed.** If you need persistence, propose **file-based** storage first. If MySQL is explicitly requested later, ask for credentials.
|
||||||
|
- **Composer/frameworks:** Avoid adding unless asked. Stick to vanilla PHP unless requirements say otherwise.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## How Flatlogic Chat sees you
|
||||||
|
|
||||||
|
- Your **stdout/stderr is streamed** to a human via Flatlogic Cloud.
|
||||||
|
- Keep output **concise and actionable**:
|
||||||
|
1. Start with a one-line **Plan**.
|
||||||
|
2. Perform changes (write files).
|
||||||
|
3. Print a **Summary** of what changed.
|
||||||
|
4. End with **Next** (a yes/no or options).
|
||||||
|
- If an operation fails, print a short **Error** line and what you’ll try next.
|
||||||
|
|
||||||
|
**Output template (guideline):**
|
||||||
|
```
|
||||||
|
|
||||||
|
Plan: <1–2 short bullets>
|
||||||
|
|
||||||
|
Changed:
|
||||||
|
|
||||||
|
* <path>: <very short description>
|
||||||
|
* <path>: <very short description>
|
||||||
|
|
||||||
|
Notes:
|
||||||
|
|
||||||
|
* <any caveat or test instruction>
|
||||||
|
|
||||||
|
Next: <question or options>
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
> You generally do **not** need to print full file contents. When useful, show **small excerpts only**.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## File editing rules (PHP)
|
||||||
|
|
||||||
|
- **index.php must keep working.** If you introduce new includes, ensure relative paths exist.
|
||||||
|
- **Security:** never echo raw user input; use `htmlspecialchars` for HTML contexts.
|
||||||
|
- **Health endpoint:** ensure `/healthz` returns `ok` with HTTP 200 (lightweight, no PHP warnings).
|
||||||
|
- Implement as `healthz.php` or route via `index.php`—your choice, but keep it simple.
|
||||||
|
- **Configuration:** if you create config, use a single `config.php` loaded by `index.php`.
|
||||||
|
- **Error handling:** avoid `display_errors` changes. Use defensive checks and small try/catch blocks.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Testing after changes
|
||||||
|
|
||||||
|
- Print a quick checklist the human can run:
|
||||||
|
- “Open `/`—should show …”
|
||||||
|
- “Open `/healthz`—should return ‘ok’”
|
||||||
|
- Mention any new endpoints you add.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Git & deploy (how your work is shipped)
|
||||||
|
|
||||||
|
- The platform will run `git pull`, `git commit_push`, and `server.restart` when appropriate.
|
||||||
|
- **You don’t run git here.** Just make sure your changes are saved to disk.
|
||||||
|
|
||||||
|
**Commit message convention** (for your summaries so humans can reuse):
|
||||||
|
- `feat: ...` user-visible features
|
||||||
|
- `fix: ...` bug fix
|
||||||
|
- `chore: ...` small housekeeping
|
||||||
|
- `docs: ...` text-only updates
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Do not do
|
||||||
|
|
||||||
|
- Don’t install system packages or restart Apache yourself.
|
||||||
|
- Don’t write outside the project root.
|
||||||
|
- Don’t introduce heavy dependencies without asking.
|
||||||
|
- Don’t leak secrets or create random credentials.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Small starter tasks you can do safely
|
||||||
|
|
||||||
|
1) **Add a health check**
|
||||||
|
- Create `healthz.php` with plain `ok`.
|
||||||
|
- Optionally link from `index.php` footer for quick access.
|
||||||
|
|
||||||
|
2) **Improve the landing page**
|
||||||
|
- In `index.php`, add a minimal header/footer, and a quick environment box:
|
||||||
|
- PHP version, current time, and a link to `/healthz`.
|
||||||
|
|
||||||
|
3) **Basic contact form (no DB)**
|
||||||
|
- Add `contact.php` with a POST form and server-side validation.
|
||||||
|
- On submit, write a sanitized line to `data/contact.log` (create folder if missing).
|
||||||
|
|
||||||
|
(Only perform these if asked; otherwise wait for explicit prompts.)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Example: Health check (what good output looks like)
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
Plan: add /healthz endpoint and link it from index.php
|
||||||
|
|
||||||
|
Changed:
|
||||||
|
|
||||||
|
* healthz.php: returns 'ok' with HTTP 200
|
||||||
|
* index.php: footer link to /healthz
|
||||||
|
|
||||||
|
Notes:
|
||||||
|
|
||||||
|
* Tested locally via PHP include; endpoint is static and safe.
|
||||||
|
|
||||||
|
Next: Proceed to add a minimal env box on the homepage?
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Telemetry note
|
||||||
|
|
||||||
|
- Your token usage and latencies are measured. Keep prompts/responses compact.
|
||||||
|
- Prefer **editing files** over dumping large code blocks into chat.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**That’s it.** Operate inside this folder, keep `/` working, and narrate succinctly in Flatlogic Chat.
|
||||||
|
```
|
||||||
257
index.html
Normal file
257
index.html
Normal file
@ -0,0 +1,257 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>Flatlogic: Build Web Apps in a Flash</title>
|
||||||
|
<style>
|
||||||
|
body {
|
||||||
|
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
|
||||||
|
margin: 40px auto;
|
||||||
|
max-width: 650px;
|
||||||
|
line-height: 1.6;
|
||||||
|
font-size: 18px;
|
||||||
|
color: #444;
|
||||||
|
padding: 0 10px;
|
||||||
|
background: linear-gradient(to right, #FFDDC1, #FFB26B);
|
||||||
|
}
|
||||||
|
h1, h2, h3 {
|
||||||
|
line-height: 1.2;
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
.container {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 2rem;
|
||||||
|
background-color: #fff;
|
||||||
|
padding: 2rem;
|
||||||
|
border-radius: 8px;
|
||||||
|
box-shadow: 0 4px 8px rgba(0,0,0,0.1);
|
||||||
|
animation: fadeIn 1s ease-in-out;
|
||||||
|
}
|
||||||
|
.hero {
|
||||||
|
text-align: center;
|
||||||
|
border-bottom: 1px solid #eee;
|
||||||
|
padding-bottom: 2rem;
|
||||||
|
animation: slideInFromLeft 1s ease-in-out;
|
||||||
|
}
|
||||||
|
.hero h1 {
|
||||||
|
font-size: 2.5rem;
|
||||||
|
color: #FFA500;
|
||||||
|
}
|
||||||
|
.story {
|
||||||
|
animation: slideInFromRight 1s ease-in-out;
|
||||||
|
}
|
||||||
|
.story ul {
|
||||||
|
list-style-type: none;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
.story li {
|
||||||
|
background: #e9ecef;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
padding: 15px;
|
||||||
|
border-radius: 5px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
animation: fadeIn 0.5s ease-in-out backwards;
|
||||||
|
}
|
||||||
|
.story li:nth-child(1) {
|
||||||
|
animation-delay: 0.2s;
|
||||||
|
}
|
||||||
|
.story li:nth-child(2) {
|
||||||
|
animation-delay: 0.4s;
|
||||||
|
}
|
||||||
|
.story li:nth-child(3) {
|
||||||
|
animation-delay: 0.6s;
|
||||||
|
}
|
||||||
|
.story li::before {
|
||||||
|
content: '✓';
|
||||||
|
color: #28a745;
|
||||||
|
font-weight: bold;
|
||||||
|
margin-right: 10px;
|
||||||
|
font-size: 1.2rem;
|
||||||
|
}
|
||||||
|
.calculator {
|
||||||
|
background: #f8f9fa;
|
||||||
|
padding: 2rem;
|
||||||
|
border-radius: 8px;
|
||||||
|
margin-top: 2rem;
|
||||||
|
animation: fadeIn 1s ease-in-out;
|
||||||
|
}
|
||||||
|
.calculator h2 {
|
||||||
|
text-align: center;
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
.calculator p {
|
||||||
|
text-align: center;
|
||||||
|
color: #666;
|
||||||
|
}
|
||||||
|
.form-group {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
margin-bottom: 1rem;
|
||||||
|
}
|
||||||
|
.form-group label {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
.form-group input[type="number"], .form-group input[type="checkbox"] {
|
||||||
|
padding: 8px;
|
||||||
|
border-radius: 5px;
|
||||||
|
border: 1px solid #ccc;
|
||||||
|
}
|
||||||
|
.result {
|
||||||
|
text-align: center;
|
||||||
|
margin-top: 2rem;
|
||||||
|
}
|
||||||
|
.result h3 {
|
||||||
|
color: #28a745;
|
||||||
|
font-size: 1.5rem;
|
||||||
|
}
|
||||||
|
.cta {
|
||||||
|
text-align: center;
|
||||||
|
padding-top: 1rem;
|
||||||
|
animation: fadeIn 1s ease-in-out 1s backwards;
|
||||||
|
}
|
||||||
|
.btn {
|
||||||
|
display: inline-block;
|
||||||
|
padding: 12px 25px;
|
||||||
|
background-color: #FFA500;
|
||||||
|
color: #fff;
|
||||||
|
text-decoration: none;
|
||||||
|
border-radius: 5px;
|
||||||
|
font-weight: bold;
|
||||||
|
transition: background-color 0.3s ease;
|
||||||
|
}
|
||||||
|
.btn:hover {
|
||||||
|
background-color: #E69500;
|
||||||
|
}
|
||||||
|
@keyframes fadeIn {
|
||||||
|
from { opacity: 0; }
|
||||||
|
to { opacity: 1; }
|
||||||
|
}
|
||||||
|
@keyframes slideInFromLeft {
|
||||||
|
from { transform: translateX(-100%); }
|
||||||
|
to { transform: translateX(0); }
|
||||||
|
}
|
||||||
|
@keyframes slideInFromRight {
|
||||||
|
from { transform: translateX(100%); }
|
||||||
|
to { transform: translateX(0); }
|
||||||
|
}
|
||||||
|
.social-media {
|
||||||
|
text-align: center;
|
||||||
|
padding-top: 1rem;
|
||||||
|
animation: fadeIn 1s ease-in-out 1s backwards;
|
||||||
|
}
|
||||||
|
.social-media ul {
|
||||||
|
list-style: none;
|
||||||
|
padding: 0;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
gap: 15px;
|
||||||
|
}
|
||||||
|
.social-media a {
|
||||||
|
text-decoration: none;
|
||||||
|
color: #FFA500;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
.social-media a:hover {
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div class="container">
|
||||||
|
<div class="hero">
|
||||||
|
<h1>Tired of the Grind? Build Web Apps in a Flash.</h1>
|
||||||
|
<p>Let's face it, building web applications from scratch is a marathon. You're juggling frontend frameworks, backend logic, database schemas, and a million other details. It's slow, it's tedious, and it's expensive.</p>
|
||||||
|
<p>But what if there was a better way? What if you could go from idea to a fully functional, production-ready web app in a fraction of the time?</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="story">
|
||||||
|
<h2>Enter Flatlogic: Your AI-Powered Development Partner</h2>
|
||||||
|
<p>Flatlogic is a revolutionary platform that's changing the game for developers and businesses. We use the power of AI to automate the most time-consuming parts of web development, so you can focus on what really matters: building amazing products.</p>
|
||||||
|
<p>Here's how it works:</p>
|
||||||
|
<ul>
|
||||||
|
<li><strong>Describe your app in plain English.</strong> Our AI will generate a full-stack application, including the frontend, backend, and database, based on your description.</li>
|
||||||
|
<li><strong>Choose your stack.</strong> We support all the most popular technologies, including React, Angular, Vue, Node.js, and more.</li>
|
||||||
|
<li><strong>Customize and deploy.</strong> You get full access to the source code, so you can customize your app to your heart's content. And when you're ready, you can deploy it to the cloud with a single click.</li>
|
||||||
|
</ul>
|
||||||
|
<p>With Flatlogic, you can build custom CRMs, ERPs, and other data management tools in a fraction of the time it would take with traditional methods. It's the perfect solution for startups, small businesses, and enterprise teams who need to move fast and build great software.</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="calculator">
|
||||||
|
<h2>Project Cost Estimator</h2>
|
||||||
|
<p>Estimate the cost of your web application with our simple calculator.</p>
|
||||||
|
<form id="cost-estimator">
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="pages">Number of Pages:</label>
|
||||||
|
<input type="number" id="pages" name="pages" min="1" value="5">
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="entities">Number of Entities:</label>
|
||||||
|
<input type="number" id="entities" name="entities" min="1" value="5">
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="auth">Authentication:</label>
|
||||||
|
<input type="checkbox" id="auth" name="auth" checked>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="payment">Payment Integration:</label>
|
||||||
|
<input type="checkbox" id="payment" name="payment">
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
<div class="result">
|
||||||
|
<h3>Estimated Cost: <span id="estimated-cost">$1250</span></h3>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="cta">
|
||||||
|
<h2>Ready to start building?</h2>
|
||||||
|
<p>Sign up for a free trial today and see how Flatlogic can help you build your next great idea.</p>
|
||||||
|
<a href="https://flatlogic.com/" class="btn">Get Started</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="social-media">
|
||||||
|
<h2>Follow us on Social Media</h2>
|
||||||
|
<ul>
|
||||||
|
<li><a href="https://github.com/flatlogic" target="_blank">GitHub</a></li>
|
||||||
|
<li><a href="https://www.linkedin.com/company/flatlogic/" target="_blank">LinkedIn</a></li>
|
||||||
|
<li><a href="https://twitter.com/flatlogic" target="_blank">X (Twitter)</a></li>
|
||||||
|
<li><a href="https://www.facebook.com/flatlogic" target="_blank">Facebook</a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
const pagesInput = document.getElementById('pages');
|
||||||
|
const entitiesInput = document.getElementById('entities');
|
||||||
|
const authInput = document.getElementById('auth');
|
||||||
|
const paymentInput = document.getElementById('payment');
|
||||||
|
const estimatedCostEl = document.getElementById('estimated-cost');
|
||||||
|
|
||||||
|
function calculateCost() {
|
||||||
|
const pages = parseInt(pagesInput.value) || 0;
|
||||||
|
const entities = parseInt(entitiesInput.value) || 0;
|
||||||
|
const auth = authInput.checked;
|
||||||
|
const payment = paymentInput.checked;
|
||||||
|
|
||||||
|
let cost = (pages * 50) + (entities * 100);
|
||||||
|
if (auth) {
|
||||||
|
cost += 500;
|
||||||
|
}
|
||||||
|
if (payment) {
|
||||||
|
cost += 1000;
|
||||||
|
}
|
||||||
|
|
||||||
|
estimatedCostEl.textContent = `$${cost}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
pagesInput.addEventListener('input', calculateCost);
|
||||||
|
entitiesInput.addEventListener('input', calculateCost);
|
||||||
|
authInput.addEventListener('input', calculateCost);
|
||||||
|
paymentInput.addEventListener('input', calculateCost);
|
||||||
|
|
||||||
|
calculateCost();
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
Loading…
x
Reference in New Issue
Block a user