# Project export: Genesis

This document was generated by HackStack to give an AI agent context about a hackathon project. Sections are labeled with their provenance; content marked as truncated was cut to keep this document small.

## Project metadata

- Hackathon: OpenAI Build Week
- Tagline: Genesis is autonomous AI organization, transforms single sentence into deployed SaaS product.It consists of specialized AI employees that collaborate, debate, evaluate and execute like a real startup.
- Devpost: https://devpost.com/software/genesis-s1m8ud
- GitHub: https://github.com/Srivamshika/Genesis
- Video: https://www.youtube.com/embed/AqG6aDNQFz0?enablejsapi=1&hl=en_US&rel=0&start=&version=3&wmode=transparent
- Team: 1 GitHub contributor(s) — Srivamshika (5 commits)

## Devpost submission (written by the team)

### Inspiration

I've always loved startup ideas, but I realized that turning an idea into a real product takes much more than just coding. You need research, product planning, technical design, deployment, and constant iteration. Most AI tools only help with one piece of that journey. So I built Genesis - an autonomous AI organization that works like a real startup team, helping founders go from a single idea to a deployed SaaS product.

### What it does

Genesis transforms a one-line startup idea into a complete SaaS venture. Instead of relying on a single AI assistant, it uses 18 specialized AI agents that collaborate to critique the idea, research the market, define the product, design the architecture, generate an MVP, deploy it to GitHub, Render, and Vercel, and continuously improve it through feedback. Every stage produces structured, traceable outputs while keeping humans in control of important decisions.

### How we built it

Genesis is built with Next.js, FastAPI, LangGraph, and SQLite. The frontend streams every AI agent's progress in real time, while the backend orchestrates the workflow, stores project memory, maintains a knowledge graph, and integrates AI providers like Groq, OpenRouter, and optional Tavily for live web research. I also built automated deployment so Genesis can generate a GitHub repository, deploy the backend to Render, the frontend to Vercel, and even create an investor pitch.

### Challenges we ran into

The biggest challenge was making multiple AI agents work together instead of behaving like separate chatbots. I also spent a lot of time handling API rate limits, provider failures, live progress streaming, deployment automation, and making sure every decision remained transparent and traceable.

### Accomplishments we're proud of

The thing I'm most proud of is that Genesis feels like a real AI startup team rather than another AI chat interface. Seeing an idea go from evaluation to research, architecture, deployment, and finally a live application—all inside one workflow—was incredibly rewarding.

### What we learned

This project taught me that building AI applications isn't just about using powerful models. It's about designing reliable systems where multiple AI agents can collaborate, share context, and produce meaningful outcomes while keeping humans in the loop.

### What's next

I'm planning to make Genesis even more autonomous by improving code generation, expanding the knowledge graph, strengthening long-term memory, and adding more specialized AI roles. The long-term vision is to make Genesis an AI co-founder that can help anyone turn an idea into a real software business.

## README (from the GitHub repository)

# Genesis

> A governed AI venture foundry that turns one idea into an evidence-backed decision, an approval-gated build plan, and a durable learning loop.

**Genesis is an OpenAI Build Week project.** It is designed for the moment before a team spends weeks building the wrong thing. A founder signs in, submits a brief, and gets a traceable path from idea critique to research, product definition, architecture, risk, economics, and an explicit human decision.

Genesis is intentionally not a generic “startup generator.” It does not silently replace a weak idea with an unrelated template, claim that simulated research is real, or create external cloud resources without a deliberate approval action.

## How I Used Codex

I used Codex extensively throughout the development of Genesis.

It helped me design the overall architecture, implement the FastAPI backend, build the Next.js frontend, orchestrate the multi-agent workflow using LangGraph, integrate AI providers, automate deployment to GitHub, Render, and Vercel, generate tests, debug complex issues, and accelerate development.

Codex acted as my AI engineering partner while I focused on designing the overall product.

## How I Used GPT-5.6

I used GPT-5.6 through Codex during the development process.

It helped me reason about system architecture, refine the multi-agent workflow, improve prompts, generate structured implementations, debug backend issues, optimize APIs, and continuously iterate on Genesis until it became a complete AI venture platform.

At runtime, Genesis uses configurable AI providers such as Groq for specialist reasoning and optional live web research, while GPT-5.6 played a key role during development through Codex.

## Why Genesis

Most AI product demos jump directly from a prompt to a polished concept. Real venture work has a harder first question: **is this idea specific, safe, feasible, and worth building now?** Genesis makes that question the first gate, then carries the decision context forward so later agents do not work from isolated fixes.

### The core loop

1. **Frame the idea** — authenticate into a private workspace and submit a one-sentence brief.
2. **Critique before building** — score the problem, customer, value proposition, focus, feasibility, and business-model path; reject unsafe or impossible premises with a concrete explanation.
3. **Research with receipts** — run source-backed web research when a live provider is connected; record the query, evidence cards, source links, freshness, confidence, and unresolved claims.
4. **Recommend with explainability** — every recommendation shows **Why?**, **Because**, and **Evidence** instead of an unexplained score.
5. **Keep a human in control** — approval is required before build artifacts, release review, or external delivery can proceed.
6. **Remember across projects** — Venture Memory links prior decisions, signals, feedback, and evidence to the signed-in owner’s projects.

## What judges can verify

| Build Week claim | Concrete proof in Genesis |
| --- | --- |
| Multi-agent collaboration | Persisted agent stages across CEO, Research, Product, Architecture, QA, Security, Growth, Finance, Legal, and more. |
| Real orchestration | LangGraph plans dependency-aware stages while FastAPI streams the live workflow over SSE. |
| Explainable decisions | Recommendation cards expose Why / Because / Evidence, confidence, assumptions, risks, and the next human action. |
| Evidence discipline | Research records source URLs, verification labels, capture time, claim confidence, and explicitly unverified items. |
| Durable memory | SQLite stores projects, artifacts, approvals, feedback, analytics, Venture Memory, and a project-scoped evidence graph. |
| Human control | A build run is blocked until an approval record exists; external delivery requires an explicit confirmation. |
| Privacy by default | Sign-in is required by default, project records are owner-scoped, and provider keys stay server-side. |
| Honest failure modes | Missing live credentials or web research stop a real run with a clear message; Genesis never presents deterministic sample output as live evidence. |


## Product guardrails

- **No unrelated rewrites:** a weak idea is reframed within its original domain; the critic does not invent a random B2B product.
- **No hidden chain-of-thought:** the UI exposes a compact public decision trace—questions, conclusions, evidence status, and next actions—not private model reasoning.
- **No fake sources:** a source is displayed only when a connected provider returns it. Source-only recovery is labelled as source-only.
- **No unsafe acceleration:** requests involving credential theft, malware, unauthorized access, non-consensual impersonation, illicit trade, or violent harm are rejected as stated.
- **No accidental deployment:** GitHub, Render, and Vercel delivery remain inert until server-side credentials, readiness checks, and an explicit confirmation are present.
- **No cross-user leakage:** authentication and repository queries scope projects and Venture Memory to the signed-in owner.

## Providers

- **Genesis agents:** Groq Compound (`groq/compound`) for high-throughput, Pydantic-validated reviews and native web research with complete source citations.
- **Idea Critic first gate:** a deterministic fact and feasibility gate runs before Research. It scores the problem, customer, unique value proposition, market focus, feasibility, and business-model path; impossible claims receive a specific local explanation without a model or web-search call. For weak but technically possible ideas, an available Groq Compound review can produce an idea-specific reframe, UVP, buyer, alternative, and pilot metric—then Genesis accepts it only if the same gate passes it.
- **Ethics and legality gate:** ideas that would enable unauthorized access, malware, non-consensual impersonation, illicit trade, or violent harm are rejected as stated before research. Genesis explains the concrete harm or legality issue and offers a safe, domain-adjacent, gate-checked reframe; it never turns such a request into an MVP plan.
- **Visible research decision:** every research artifact records the questions analyzed, competitor evidence cards (source, capture time, verification label, claim confidence, and explicitly unverified pricing/features), risks, and a conservative `proceed`, `reframe`, or `do not build as stated` recommendation.
- **Founder decision artifacts:** risk, finance, comparison, and Business Model Canvas artifacts remain available to build and investor-pitch flows without crowding the main Genesis research surface.
- **Shared decision contract:** every persisted specialist artifact now records its decision, evidence status, assumptions to test, risks to earn down, alternatives considered, confidence, upstream context, and next human-owned action. This is a bounded decision record—not hidden model chain-of-thought.
- **Startup economics:** build preparation includes a transparent 12-month conservative / validated-wedge / repeatable-motion cost model, break-even assumptions, maximum cash need, and observed Genesis model usage. It is explicitly labelled a planning range until provider pricing, invoices, payroll, and usage are connected.
- **Auditable collaboration, not hidden reasoning:** the existing Research card includes a compact expandable trace showing each agent's public question, considerations, conclusion, and evidence status. It intentionally does not expose private model chain-of-thought.
- **Hard feasibility gate:** a `reframe` or `do not build as stated` verdict from the Idea Critic or Research ends the run. Genesis does not create a research, concept, MVP, architecture, approval, or deployment plan for a premise the Idea Critic rejects.
- **Live research boundary:** this workspace uses Groq Compound for agent synthesis and native web search. If Groq reaches a daily/token or request-size limit and `TAVILY_API_KEY` is present, Genesis

[README truncated for size]

## Detected evidence (automated analysis)

Indexed codebase: 117 recognized source files, 941 KB.
- CSS (language) — detected in the code
- FastAPI (technology) — detected in the code
- HTML (language) — detected in the code
- LangChain (technology) — detected in the code
- Next.js (technology) — detected in the code
- OpenAI (technology) — detected in the code
- Python (language) — detected in the code
- React (technology) — detected in the code
- Tailwind CSS (technology) — detected in the code
- TypeScript (language) — detected in the code
- Node.js (technology) — claimed on Devpost, not found in the code
- AI coding agent: Claude Code — evidence: config files committed to the repository
- AI coding agent: Codex — evidence: config files committed to the repository

## Codebase structure (from repository index)

### Files (120 of 141)

```
.gitignore
backend/.dockerignore
backend/.gitignore
backend/agents/__init__.py
backend/agents/analytics_agent.py
backend/agents/architect_agent.py
backend/agents/branding_agent.py
backend/agents/ceo_agent.py
backend/agents/customer_agent.py
backend/agents/decision_frame.py
backend/agents/deployment_agent.py
backend/agents/engineer_agent.py
backend/agents/finance_agent.py
backend/agents/governance_agent.py
backend/agents/growth_agent.py
backend/agents/idea_critic_agent.py
backend/agents/improvement_agent.py
backend/agents/launch_utils.py
backend/agents/legal_agent.py
backend/agents/product_agent.py
backend/agents/qa_agent.py
backend/agents/research_agent.py
backend/agents/risk_agent.py
backend/agents/security_agent.py
backend/agents/ux_designer_agent.py
backend/agents/venture_intelligence.py
backend/app.py
backend/config.py
backend/Dockerfile
backend/kernel/__init__.py
backend/kernel/events.py
backend/kernel/kernel.py
backend/kernel/state.py
backend/memory/__init__.py
backend/models/__init__.py
backend/models/architecture.py
backend/models/code.py
backend/models/deployment.py
backend/models/live_intelligence.py
backend/models/llm.py
backend/models/product.py
backend/models/project.py
backend/models/qa.py
backend/models/research.py
backend/models/response.py
backend/models/state.py
backend/prompts/architect_prompt.txt
backend/prompts/deployment_prompt.txt
backend/prompts/engineer_prompt.txt
backend/prompts/product_prompt.txt
backend/prompts/qa_prompt.txt
backend/prompts/research_prompt.txt
backend/repositories/__init__.py
backend/repositories/project_repository.py
backend/repositories/user_repository.py
backend/requirements.txt
backend/routers/__init__.py
backend/routers/auth.py
backend/routers/campaigns.py
backend/routers/generate.py
backend/services/__init__.py
backend/services/agent_intelligence.py
backend/services/analytics_service.py
backend/services/auth_service.py
backend/services/delivery_service.py
backend/services/llm_service.py
backend/services/release_review_service.py
backend/test_llm.py
backend/tests/__init__.py
backend/tests/test_analytics_service.py
backend/tests/test_auth_service.py
backend/tests/test_build_agents.py
backend/tests/test_campaign_studio.py
backend/tests/test_delivery_service.py
backend/tests/test_genesis_workflow.py
backend/tests/test_launch_agents.py
backend/tests/test_live_provider.py
backend/tests/test_project_authorization.py
backend/tests/test_release_review.py
backend/tests/test_support.py
backend/tools/__init__.py
backend/utils/__init__.py
backend/workflows/__init__.py
backend/workflows/langgraph_runtime.py
backend/workflows/orchestrator.py
docker-compose.yml
docker.env.example
docs/.gitkeep
docs/GENESIS_PLATFORM_ARCHITECTURE.md
docs/LIVE_INTEGRATIONS.md
docs/STACK_SELECTION.md
frontend/.dockerignore
frontend/.gitignore
frontend/AGENTS.md
frontend/assets/.gitkeep
frontend/CLAUDE.md
frontend/components.json
frontend/Dockerfile
frontend/eslint.config.mjs
frontend/next.config.ts
frontend/package.json
frontend/postcss.config.mjs
frontend/README.md
frontend/src/app/globals.css
frontend/src/app/layout.tsx
frontend/src/app/page.tsx
frontend/src/components/AgentCard.tsx
frontend/src/components/AuthDialog.tsx
frontend/src/components/CampaignStudio.tsx
frontend/src/components/CursorGlow.tsx
frontend/src/components/Dashboard.tsx
frontend/src/components/GenesisExperience.tsx
frontend/src/components/Header.tsx
frontend/src/components/IdeaInput.tsx
frontend/src/components/MagneticButton.tsx
frontend/src/components/ProgressBar.tsx
frontend/src/components/ResponseCard.tsx
frontend/src/components/Sidebar.tsx
frontend/src/components/StatusBadge.tsx
frontend/src/components/three/AgentConstellation.tsx
[21 more files omitted for size]
```

### Dependencies

- backend/requirements.txt: annotated-doc@==0.0.4, annotated-types@==0.7.0, anyio@==4.14.2, certifi@==2026.6.17, charset-normalizer@==3.4.9, click@==8.4.2, distro@==1.9.0, fastapi@==0.139.0, h11@==0.16.0, httpcore@==1.0.9, httpx@==0.28.1, idna@==3.18, jiter@==0.16.0, jsonpatch@==1.33, jsonpointer@==3.1.1, langchain@==1.3.13, langchain-core@==1.4.9, langchain-protocol@==0.0.18, langgraph@==1.2.9, langgraph-checkpoint@==4.1.1, langgraph-prebuilt@==1.1.0, langgraph-sdk@==0.4.2, langsmith@==0.10.2, markdown-it-py@==4.2.0, mdurl@==0.1.2, openai@==2.45.0, orjson@==3.11.9, ormsgpack@==1.12.2, packaging@==26.2, pydantic@==2.13.4, pydantic_core@==2.46.4, Pygments@==2.20.0, pytest@==9.0.2, python-dotenv@==1.2.2, PyYAML@==6.0.3, requests@==2.34.2, requests-toolbelt@==1.0.0, rich@==15.0.0, sniffio@==1.3.1, starlette@==1.3.1, tenacity@==9.1.4, tqdm@==4.68.4, typing_extensions@==4.16.0, typing-inspection@==0.4.2, urllib3@==2.7.0, uuid_utils@==0.17.0, uvicorn@==0.51.0, websockets@==15.0.1, xxhash@==3.8.1, zstandard@==0.25.0
- frontend/package.json: @base-ui/react@^1.6.0, @tailwindcss/postcss@^4, @types/node@^20, @types/react@^19, @types/react-dom@^19, @types/three@^0.184.1, class-variance-authority@^0.7.1, clsx@^2.1.1, eslint@^9, eslint-config-next@16.2.10, lucide-react@^1.24.0, next@16.2.10, react@19.2.4, react-dom@19.2.4, shadcn@^4.13.0, tailwind-merge@^3.6.0, tailwindcss@^4, three@^0.185.1, tw-animate-css@^1.4.0, typescript@^5

### Recent commits (newest first)

- Update README.md
- Delete docs/FINAL_SUBMISSION.md
- Delete docs/judge-demo.md
- Update README.md
- Initial Genesis AI venture platform

## Key source files (fetched from GitHub, selected and truncated for size)

### frontend/CLAUDE.md

```markdown
@AGENTS.md

```

### frontend/AGENTS.md

```markdown
<!-- BEGIN:nextjs-agent-rules -->
# This is NOT the Next.js you know

This version has breaking changes — APIs, conventions, and file structure may all differ from your training data. Read the relevant guide in `node_modules/next/dist/docs/` before writing any code. Heed deprecation notices.
<!-- END:nextjs-agent-rules -->

```

### docker-compose.yml

```yaml
services:
  backend:
    build:
      context: ./backend
      dockerfile: Dockerfile
    environment:
      # Persistent local state stays in the named volume, not in the image layer.
      GENESIS_DATABASE_PATH: /app/data/genesis.db
      GENESIS_LLM_PROVIDER: ${GENESIS_LLM_PROVIDER:-deterministic}
      GENESIS_LLM_MODEL: ${GENESIS_LLM_MODEL:-groq/compound}
      GENESIS_LLM_TIMEOUT_SECONDS: ${GENESIS_LLM_TIMEOUT_SECONDS:-45}
      GENESIS_LLM_MAX_RETRIES: ${GENESIS_LLM_MAX_RETRIES:-2}
      GENESIS_LLM_MAX_OUTPUT_TOKENS: ${GENESIS_LLM_MAX_OUTPUT_TOKENS:-1600}
      GENESIS_LLM_STAGE_SCOPE: ${GENESIS_LLM_STAGE_SCOPE:-validation}
      GENESIS_LLM_ALLOW_FALLBACK: ${GENESIS_LLM_ALLOW_FALLBACK:-false}
      GENESIS_OPENAI_STORE: ${GENESIS_OPENAI_STORE:-false}
      GENESIS_ENABLE_WEB_RESEARCH: ${GENESIS_ENABLE_WEB_RESEARCH:-true}
      CORS_ORIGINS: ${CORS_ORIGINS:-http://localhost:3000,http://127.0.0.1:3000}
      GENESIS_REQUIRE_AUTH: ${GENESIS_REQUIRE_AUTH:-true}
      GENESIS_AUTH_SECRET: ${GENESIS_AUTH_SECRET:-}
      GENESIS_ENABLE_POSTHOG: ${GENESIS_ENABLE_POSTHOG:-false}
      GENESIS_ANALYTICS_CONSENT: ${GENESIS_ANALYTICS_CONSENT:-false}
      POSTHOG_API_KEY: ${POSTHOG_API_KEY:-}
      POSTHOG_HOST: ${POSTHOG_HOST:-https://us.i.posthog.com}
    env_file:
      # Local only; deployment platforms should set GROQ_API_KEY (and optional
      # OPENROUTER_API_KEY for campaign images) as encrypted environment variables.
      - .env.local
    ports:
      - "8000:8000"
    volumes:
      - genesis-data:/app/data

  frontend:
    build:
      context: ./frontend
      dockerfile: Dockerfile
      args:
        # Browser code must call a URL reachable from the user's browser.
        NEXT_PUBLIC_API_BASE_URL: ${NEXT_PUBLIC_API_BASE_URL:-http://127.0.0.1:8000}
    environment:
      # Retained for runtime inspection; the public value is embedded during `npm run build`.
      NEXT_PUBLIC_API_BASE_URL: ${NEXT_PUBLIC_API_BASE_URL:-http://127.0.0.1:8000}
      NEXT_PUBLIC_API_URL: ${NEXT_PUBLIC_API_BASE_URL:-http://127.0.0.1:8000}
    depends_on:
      backend:
        condition: service_healthy
    ports:
      - "3000:3000"

volumes:
  genesis-data:

```

### frontend/package.json

```
{
  "name": "frontend",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "dev": "next dev",
    "build": "next build",
    "start": "next start",
    "lint": "eslint"
  },
  "dependencies": {
    "@base-ui/react": "^1.6.0",
    "class-variance-authority": "^0.7.1",
    "clsx": "^2.1.1",
    "lucide-react": "^1.24.0",
    "next": "16.2.10",
    "react": "19.2.4",
    "react-dom": "19.2.4",
    "shadcn": "^4.13.0",
    "tailwind-merge": "^3.6.0",
    "three": "^0.185.1",
    "tw-animate-css": "^1.4.0"
  },
  "devDependencies": {
    "@tailwindcss/postcss": "^4",
    "@types/node": "^20",
    "@types/react": "^19",
    "@types/react-dom": "^19",
    "@types/three": "^0.184.1",
    "eslint": "^9",
    "eslint-config-next": "16.2.10",
    "tailwindcss": "^4",
    "typescript": "^5"
  }
}

```

### backend/requirements.txt

```
annotated-doc==0.0.4
annotated-types==0.7.0
anyio==4.14.2
certifi==2026.6.17
charset-normalizer==3.4.9
click==8.4.2
distro==1.9.0
fastapi==0.139.0
h11==0.16.0
httpcore==1.0.9
httpx==0.28.1
idna==3.18
jiter==0.16.0
jsonpatch==1.33
jsonpointer==3.1.1
langchain==1.3.13
langchain-core==1.4.9
langchain-protocol==0.0.18
langgraph==1.2.9
langgraph-checkpoint==4.1.1
langgraph-prebuilt==1.1.0
langgraph-sdk==0.4.2
langsmith==0.10.2
markdown-it-py==4.2.0
mdurl==0.1.2
openai==2.45.0
orjson==3.11.9
ormsgpack==1.12.2
packaging==26.2
pydantic==2.13.4
pydantic_core==2.46.4
pytest==9.0.2
Pygments==2.20.0
python-dotenv==1.2.2
PyYAML==6.0.3
requests==2.34.2
requests-toolbelt==1.0.0
rich==15.0.0
sniffio==1.3.1
starlette==1.3.1
tenacity==9.1.4
tqdm==4.68.4
typing-inspection==0.4.2
typing_extensions==4.16.0
urllib3==2.7.0
uuid_utils==0.17.0
uvicorn==0.51.0
websockets==15.0.1
xxhash==3.8.1
zstandard==0.25.0

```

### backend/Dockerfile

```
# syntax=docker/dockerfile:1
# Production image for the Genesis FastAPI service. Runtime credentials are supplied
# by Docker Compose (or the deployment platform), never copied into this image.
FROM python:3.12-slim

ENV PYTHONDONTWRITEBYTECODE=1 \
    PYTHONUNBUFFERED=1 \
    PYTHONPATH=/app \
    GENESIS_DATABASE_PATH=/app/data/genesis.db

WORKDIR /app

RUN groupadd --system --gid 10001 genesis \
    && useradd --system --uid 10001 --gid genesis --create-home genesis

COPY requirements.txt ./requirements.txt
RUN pip install --no-cache-dir --upgrade pip \
    && pip install --no-cache-dir -r requirements.txt

COPY --chown=genesis:genesis . .
RUN mkdir -p /app/data \
    && chown -R genesis:genesis /app

USER genesis

EXPOSE 8000

HEALTHCHECK --interval=15s --timeout=5s --start-period=20s --retries=5 \
    CMD python -c "import urllib.request; urllib.request.urlopen('http://127.0.0.1:8000/health', timeout=3)"

CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8000"]

```

### frontend/Dockerfile

```
# syntax=docker/dockerfile:1
# Next.js uses NEXT_PUBLIC_* values while producing its browser bundle.  The
# public API base is therefore passed as a build argument, not baked in as a secret.
FROM node:22-alpine AS dependencies
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm ci

FROM node:22-alpine AS builder
WORKDIR /app
ENV NEXT_TELEMETRY_DISABLED=1

COPY --from=dependencies /app/node_modules ./node_modules
COPY . .

# The application currently reads NEXT_PUBLIC_API_URL. Keep the external
# compose-facing contract descriptive while mapping it at build time.
ARG NEXT_PUBLIC_API_BASE_URL=http://127.0.0.1:8000
ENV NEXT_PUBLIC_API_URL=${NEXT_PUBLIC_API_BASE_URL}
RUN npm run build

FROM node:22-alpine AS runner
WORKDIR /app
ENV NODE_ENV=production \
    NEXT_TELEMETRY_DISABLED=1 \
    PORT=3000 \
    HOSTNAME=0.0.0.0

RUN addgroup --system --gid 1001 nodejs \
    && adduser --system --uid 1001 --ingroup nodejs nextjs

COPY package.json package-lock.json ./
COPY --from=dependencies /app/node_modules ./node_modules
RUN npm prune --omit=dev \
    && npm cache clean --force

COPY --from=builder --chown=nextjs:nodejs /app/.next ./.next
COPY --from=builder --chown=nextjs:nodejs /app/public ./public

USER nextjs

EXPOSE 3000

CMD ["npm", "run", "start"]

```

### backend/app.py

```python
from __future__ import annotations

from pathlib import Path
from typing import Any

from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware

from config import CORS_ORIGINS, DATABASE_PATH, REQUIRE_AUTH
from repositories.project_repository import ProjectRepository
from repositories.user_repository import UserRepository
from routers.auth import router as auth_router
from routers.campaigns import CampaignStudioService, router as campaign_router
from routers.generate import router as genesis_router
from services.auth_service import AuthService
from services.analytics_service import AnalyticsService
from services.delivery_service import MVPDeliveryService
from services.llm_service import LLMService
from services.release_review_service import ReleaseReviewService


def create_app(
    database_path: str | Path | None = None,
    require_auth: bool | None = None,
    llm_service: LLMService | None = None,
    analytics_service: AnalyticsService | None = None,
    release_review_service: ReleaseReviewService | None = None,
    delivery_service: MVPDeliveryService | None = None,
) -> FastAPI:
    """Create an API instance with an isolated project store (useful for tests and local demos)."""

    repository = ProjectRepository(database_path or DATABASE_PATH)
    repository.initialize()
    auth_service = AuthService.from_environment(UserRepository(repository.database_path))
    auth_required = REQUIRE_AUTH if require_auth is None else require_auth
    provider_service = llm_service or LLMService()
    event_analytics = analytics_service or AnalyticsService()
    release_reviewer = release_review_service or ReleaseReviewService()
    delivery = delivery_service or MVPDeliveryService()

    app = FastAPI(
        title="Project Genesis API",
        version="0.2.0",
        description="Persistent, approval-gated AI venture workflow API.",
    )
    app.state.project_repository = repository
    app.state.auth_service = auth_service
    app.state.require_auth = auth_required
    app.state.llm_service = provider_service
    app.state.campaign_service = CampaignStudioService()
    app.state.analytics_service = event_analytics
    app.state.release_review_service = release_reviewer
    app.state.delivery_service = delivery
    app.add_middleware(
        CORSMiddleware,
        allow_origins=CORS_ORIGINS,
        allow_credentials=True,
        allow_methods=["*"],
        allow_headers=["*"],
    )
    app.include_router(genesis_router)
    app.include_router(auth_router)
    app.include_router(campaign_router)

    @app.get("/", tags=["system"])
    def home() -> dict[str, Any]:
        return {
            "message": "Genesis Backend Running",
            "mode": provider_service.health().mode,
            "provider": provider_service.health().model_dump(mode="json"),
            "analytics": event_analytics.status(),
            "health": "/health",
            "authentication_required": auth_required,
        }

    @app.get("/health", tags=["system"])
    def health() -> dict[str, Any]:
        return {
            "status": "ok",
            "service": "project-genesis-api",
            "storage": "ready",
            "mode": provider_service.health().mode,
            "provider": provider_service.health().model_dump(mode="json"),
            "analytics": event_analytics.status(),
            "authentication_required": auth_required,
        }

    return app


app = create_app()

```

### frontend/src/app/page.tsx

```typescript
import GenesisExperience from "@/components/GenesisExperience";

export default function Home() {
  return <GenesisExperience />;
}

```

### frontend/src/app/layout.tsx

```typescript
import type { Metadata } from "next";

import "./globals.css";

export const metadata: Metadata = {
  title: "Genesis — AI Innovation Engine",
  description: "From one sentence to a deployed AI startup.",
};

export default function RootLayout({ children }: Readonly<{ children: React.ReactNode }>) {
  return (
    <html lang="en">
      <body>{children}</body>
    </html>
  );
}

```

[88 more indexed source files omitted to keep this export small. The full file list is in the Codebase structure section above.]