Add seed script with 7 trees, markdown rendering, and dark mode docs
- Add comprehensive seed script with 7 troubleshooting decision trees - Tier 1: Password Reset, Outlook/Email, VPN, Printer Problems - Tier 2: Slow Computer, Network Connectivity - Tier 3: File Share Access Problems - Add markdown rendering with react-markdown package - MarkdownContent component for session player and node editor - Preview toggle in description fields - Update documentation to reflect dark mode is complete - Update all progress tracking docs with recent changes Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -6,6 +6,69 @@
|
||||
|
||||
---
|
||||
|
||||
## Environment Setup (New Machine)
|
||||
|
||||
### Database Name Mismatch After Fresh Clone
|
||||
**Problem:** After cloning the repo and running `docker-compose up -d`, Alembic migrations fail with `database "decision_tree" does not exist`.
|
||||
|
||||
**Cause:** The `.env` file contains the old database name (`decision_tree`) but `docker-compose.yml` creates a database called `apoklisis`.
|
||||
|
||||
**Solution:** Update `.env` to use the correct database name:
|
||||
```
|
||||
DATABASE_URL=postgresql+asyncpg://postgres:postgres@localhost:5432/apoklisis
|
||||
DATABASE_URL_SYNC=postgresql://postgres:postgres@localhost:5432/apoklisis
|
||||
```
|
||||
|
||||
**Files affected:** `backend/.env`
|
||||
|
||||
---
|
||||
|
||||
### Missing @/lib/utils (cn function)
|
||||
**Problem:** Frontend fails to compile with error: `Failed to resolve import "@/lib/utils" from "src/pages/SessionDetailPage.tsx". Does the file exist?`
|
||||
|
||||
**Cause:** The `src/lib/utils.ts` file wasn't committed to the repo or was missed during setup. This file provides the `cn()` utility function used for combining Tailwind classes.
|
||||
|
||||
**Solution:** Create `frontend/src/lib/utils.ts`:
|
||||
```typescript
|
||||
import { type ClassValue, clsx } from 'clsx'
|
||||
import { twMerge } from 'tailwind-merge'
|
||||
|
||||
export function cn(...inputs: ClassValue[]) {
|
||||
return twMerge(clsx(inputs))
|
||||
}
|
||||
```
|
||||
|
||||
**Dependencies required:** `clsx` and `tailwind-merge` (already in package.json)
|
||||
|
||||
**Files affected:** `frontend/src/lib/utils.ts`
|
||||
|
||||
---
|
||||
|
||||
### pip install in venv doesn't need --break-system-packages
|
||||
**Problem:** Confusion about whether to use `--break-system-packages` flag.
|
||||
|
||||
**Clarification:** The `--break-system-packages` flag is only needed when installing packages **outside** of a virtual environment. When your venv is active (you see `(venv)` prefix), you don't need this flag.
|
||||
|
||||
---
|
||||
|
||||
### New Machine Setup Checklist
|
||||
When setting up development on a new machine:
|
||||
|
||||
1. **Clone repo:** `git clone <repo-url>`
|
||||
2. **Start Docker Desktop**
|
||||
3. **Start database:** `cd backend && docker-compose up -d`
|
||||
4. **Fix .env database name** if it says `decision_tree` → change to `apoklisis`
|
||||
5. **Create venv:** `python -m venv venv`
|
||||
6. **Activate venv:** `.\venv\Scripts\Activate`
|
||||
7. **Install backend deps:** `pip install -r requirements.txt`
|
||||
8. **Run migrations:** `alembic upgrade head`
|
||||
9. **Start backend:** `uvicorn app.main:app --reload`
|
||||
10. **Install frontend deps:** `cd ../frontend && npm install`
|
||||
11. **Create lib/utils.ts** if missing (see above)
|
||||
12. **Start frontend:** `npm run dev`
|
||||
|
||||
---
|
||||
|
||||
## Python / Backend
|
||||
|
||||
### DateTime Timezone Handling ⚠️ CRITICAL
|
||||
@@ -428,6 +491,40 @@ pytest
|
||||
|
||||
---
|
||||
|
||||
## Seed Scripts
|
||||
|
||||
### httpx Not Installed
|
||||
**Problem:** Running `python -m scripts.seed_trees` fails with `ModuleNotFoundError: No module named 'httpx'`
|
||||
|
||||
**Cause:** The seed script uses `httpx` for async HTTP requests, which isn't in the base requirements.
|
||||
|
||||
**Solution:** Install httpx before running seed scripts:
|
||||
```powershell
|
||||
pip install httpx
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### Email Validation Rejects .local Domains
|
||||
**Problem:** Seed script fails with email validation error when using `.local` domain for seed user email.
|
||||
|
||||
**Error:** `value is not a valid email address: The part after the @-sign is a special-use or reserved name that cannot be used with email.`
|
||||
|
||||
**Cause:** The `email-validator` library (used by Pydantic) correctly rejects `.local` as it's a reserved TLD per RFC 6761.
|
||||
|
||||
**Solution:** Use a standard domain like `example.com` for seed/test users:
|
||||
```python
|
||||
# BAD
|
||||
"email": "seed.admin@apoklisis.local"
|
||||
|
||||
# GOOD
|
||||
"email": "seed.admin@example.com"
|
||||
```
|
||||
|
||||
**Files affected:** `backend/scripts/seed_trees.py`, any test fixtures with email addresses
|
||||
|
||||
---
|
||||
|
||||
## Adding New Lessons
|
||||
|
||||
When you encounter and fix a bug, add it here with:
|
||||
|
||||
Reference in New Issue
Block a user