You are Replit Agent acting as a full‑stack architect and implementer. ## Goal In this Repl, build the first working version of **Aura**: a domain‑to‑business generator. Aura should: - Take a single domain or a CSV list. - Analyze niches and business models for each domain. - Generate brand options, site copy, and a “for sale / business‑in‑a‑box” sales letter. - Serve a simple web UI where I can paste domains, review niches, pick one, and trigger content generation. - Persist everything to a database. - Be deployable using Replit’s built‑in Deploy features. Focus on **end‑to‑end functionality** over polish. ## Replit Environment Requirements 1. Use **Python + FastAPI** for the backend API. 2. Use **Replit DB or a simple SQLite/Prisma/Postgres via Replit DB connector** for persistence (pick the simplest that works well with Replit’s best practices). 3. Provide a minimal **web frontend** using either: - FastAPI + Jinja templates, OR - A single‑page HTML/JS frontend served from FastAPI. 4. Use **Replit Secrets** for external API keys (DeepSeek/OpenAI/Gemini). Do not hardcode keys. 5. Configure environment using `replit.nix` and `.replit` according to Replit guidelines so the Repl: - Starts the FastAPI app on the correct port. - Can use the Deploy button without extra manual steps. [web:116][web:120] ## Architecture You Should Implement ### 1) Project Structure Create this file/folder layout: - `app/main.py` – FastAPI app with API routes. - `app/models.py` – DB models / schema definitions. - `app/services/llm.py` – Wrapper to call an external LLM (DeepSeek/OpenAI/Gemini), reading API keys from environment. - `app/services/aura.py` – Core Aura logic: - `analyze_domain(domain) -> niches JSON` - `build_package(domain, chosen_niche) -> package JSON` - `app/templates/` – Jinja2 templates for the web UI. - `static/` – CSS/JS for the UI (minimal). - `scripts/import_csv.py` – CLI script to bulk‑import/analyze domains from a CSV. - `requirements.txt` – Dependencies. - `.replit` and `replit.nix` – Properly configured run command and dependencies for Replit. [web:112][web:116] ### 2) Core Features #### A. Domain & Market Analyzer (Module 1) Implement `analyze_domain(domain: str)` in `app/services/aura.py`: - Decompose domain into keywords. - Call `services/llm.call_llm()` to: - Suggest 5–10 niche ideas, including creative angles (acronyms, cross‑language meanings, mashups, cross‑domain tie‑ins). - For each niche, return: - `name` - `description` - `monetization_model` - `time_to_revenue` (fast/medium/slow) - `valuation_band` (e.g., "500‑2000", "5000‑20000") - `score` (0–10) - Store the raw analysis JSON in the DB. - Expose an API route: - `POST /api/analyze-domain` with `{ "domain": "example.com" }` → returns structured JSON. #### B. Business & Content Generator (Module 2) Implement `build_package(domain: str, chosen_niche: str)`: - Pull the niche analysis for that domain from DB. - Call `call_llm()` to generate: - Brand identity: - 3 options: `{ name, tagline }`; pick one. - Site copy blocks: - `headline`, `subheadline`, `hero_body`, `about`, `offer`, `faq_items` (array of Q&A). - A **sales letter** for auction/marketplaces (Flippa/Sedo style) that: - Explains the niche, why it’s timely, and monetization methods. - Save this as a “package” record in DB. - Expose API route: - `POST /api/build-package` with `{ "domain": "...", "niche_name": "..." }`. #### C. Simple Site Renderer (Module 3) No external hosting yet; just render within Replit: - Provide a route `GET /site/{domain}` that: - Loads the latest package for that domain. - Renders `templates/site.html` with the brand and copy injected. - This is sufficient to screenshot or show to buyers. #### D. UI Dashboard (Minimal but Functional) Create a simple dashboard at `/`: - **Upload or Paste Domain List:** - Textarea for single or multi‑line domains. - Button “Analyze Domains” → calls `/api/analyze-domain` per domain. - **Review Step:** - Table listing analyzed domains with their top 3 niches and scores. - For each domain, dropdown to choose a niche. - Button “Generate Package” → calls `/api/build-package`. - **View Output:** - Link “Preview Site” → goes to `/site/{domain}`. - Button “View Sales Letter” → modal or separate route (`/sales/{domain}`). Keep the frontend very simple—HTML + Tailwind CDN or minimal CSS. ### 3) LLM Integration - In `services/llm.py`, create a `call_llm(prompt: str) -> str` function. - Read model + key from environment variables: - `LLM_PROVIDER` (e.g., "openai", "deepseek", "gemini") - `LLM_API_KEY` - Implement at least one provider (OpenAI or DeepSeek), with clear TODO comments for others. - Make all prompts deterministic and **include role guidance** (e.g., “You are a domain valuation expert and niche strategist”). ### 4) Replit‑Specific Best Practices - Set the **run command** in `.replit` to start the FastAPI app with uvicorn, e.g.: ```toml run = "uvicorn app.main:app --host 0.0.0.0 --port 8000"