Initial commit: AI Dungeon clone (FastAPI backend + React frontend)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KFsGHju9szibJJa2YJcdbg
This commit is contained in:
parththakkar106
2026-07-06 16:08:19 +05:30
co-authored by Claude Fable 5
commit db9f904222
57 changed files with 7804 additions and 0 deletions
+54
View File
@@ -0,0 +1,54 @@
# AI D&D — local AI Dungeon-style storytelling app
Python (FastAPI + SQLite) backend, React (Vite) frontend, connectable to any
OpenAI-compatible AI endpoint (Ollama, LM Studio, OpenAI, OpenRouter, …).
Plan: see [`plan/00-OVERVIEW.md`](plan/00-OVERVIEW.md). Currently completed: **Phase 4** (AI Dungeon-compatible scripting).
## Run
```powershell
.\start.ps1
```
Then open http://localhost:5173. Backend API docs at http://localhost:8000/docs.
Or manually, in two terminals:
```powershell
# Terminal 1 — backend
cd backend
.\.venv\Scripts\uvicorn.exe app.main:app --port 8000 --reload
# Terminal 2 — frontend
cd frontend
npm run dev
```
## First-time setup
```powershell
cd backend
python -m venv .venv
.\.venv\Scripts\pip.exe install -r requirements.txt
cd ..\frontend
npm install
```
## Production-ish serving (single port)
Build the frontend, then the backend serves it statically:
```powershell
cd frontend
npm run build
# then run the backend and open http://localhost:8000
```
## Layout
- `backend/app/` — FastAPI app: `models.py` (SQLAlchemy), `schemas.py` (Pydantic), `routers/`
- `backend/data.db` — SQLite database (created on first run)
- `frontend/src/` — React SPA: `pages/`, `api.js`
- `plan/` — phased implementation plan