This directory contains both the frontend and backend services for the AI Builders Tutorial platform.
services/
├── frontend/ # Astro + Preact frontend application
│ ├── src/ # Source code
│ ├── public/ # Static assets
│ ├── tutorials/ # Tutorial notebooks
│ └── package.json # Frontend dependencies
│
└── backend/ # Python FastAPI backend
├── main.py # Application entry point
├── services/ # Business logic
├── routers/ # API routes
└── requirements.txt # Python dependencies
cd frontend
npm install
npm run devVisit: http://localhost:4321
cd backend
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
cp .env.example .env
# Edit .env with your credentials
python main.pyVisit: http://localhost:8000/docs
- Frontend: See frontend/README.md (if exists)
- Backend: See backend/README.md
- Auth Setup: See ../docs/CIRCLE_AUTH_SETUP.md
- Frontend → Backend:
http://localhost:8000(API calls) - Backend → Circle API: Authentication & user management
- Backend → Google OAuth: Social login
From the project root:
./start-auth-servers.shThis starts both frontend and backend servers simultaneously.
Backend (backend/.env):
CIRCLE_HEADLESS_TOKEN- Circle API tokenCIRCLE_COMMUNITY_ID- Your community IDJWT_SECRET- Secret for JWT signingGOOGLE_CLIENT_ID- Google OAuth client IDGOOGLE_CLIENT_SECRET- Google OAuth secretFRONTEND_URL- Frontend URL (default: http://localhost:4321)
Frontend:
- Environment variables are configured in
astro.config.mjs
- Framework: Astro 4.x
- UI Library: Preact 10.x
- Styling: Tailwind CSS
- Language: TypeScript
- Framework: FastAPI
- Server: Uvicorn
- Authentication: JWT + Google OAuth
- Language: Python 3.8+
User (Frontend)
↓
Login Request
↓
Backend API (/auth/login or /auth/google)
↓
Circle API (verify membership)
↓
JWT Token Generation
↓
Return to Frontend
↓
Store in localStorage
| Service | Port | URL |
|---|---|---|
| Frontend | 4321 | http://localhost:4321 |
| Backend | 8000 | http://localhost:8000 |
| API Docs | 8000 | http://localhost:8000/docs |
cd backend
python test_setup.pycurl http://localhost:8000/healthcd frontend
npm run buildFor complete documentation, see the /docs directory in the project root.