Scaffolded from the CS 407 design document for Team 7.
- Frontend: React Native + TypeScript (Expo-managed app)
- Backend: FastAPI + Python
- Database: PostgreSQL
- AI Matching Integration: OpenAI API (stubbed service layer)
TutorApp/
frontend/ # React Native + TypeScript client
backend/ # FastAPI server, modular API/services/models
CS 407 Design Doc.pdf
Backend scaffolding includes the core entities described in the document:
User(base profile and auth fields)Student(extendsUserwith student-specific data)Tutor(extendsUserwith tutor-specific data)Admin(standalone, does not inherit fromUser)Class(academic class catalog object)StudentClass(student perspective of a class + help level)TutorClass(tutor perspective of a class + semester/grade received)Review(student feedback for tutor)
cd frontend
npm install
npm run startcd backend
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
uvicorn app.main:app --reloadCreate a backend/.env file with either:
-
Local dev DB (Docker) – recommended for testing:
LOCAL_DATABASE_URL=postgresql+psycopg2://postgres:postgres@localhost:5432/tutorapp
Then see
backend/dev/README.mdfor:- starting the local Postgres container
- creating tables (
python dev/create_tables.py) - seeding test users (
python dev/seed_test_data.py)
-
Shared RDS DB – if you have want to connect to deployed db:
RDS_HOST=... RDS_PORT=5432 RDS_DB_NAME=... RDS_USERNAME=... RDS_PASSWORD=... RDS_SSL_MODE=verify-full RDS_SSL_ROOT_CERT=certs/global-bundle.pem
When LOCAL_DATABASE_URL is set, the backend uses your local Postgres; otherwise it connects to the configured RDS instance.
The backend exposes a simple REST + WebSocket messaging system:
POST /messages/conversations– create/get a conversation between two users.GET /messages/conversations– list a user’s conversations (with last message preview).GET /messages/conversations/{id}/messages– list messages in a conversation.POST /messages/conversations/{id}/messages– send a message (stored in themessagestable).WS /messages/ws/chat/{conversation_id}– WebSocket endpoint for real-time chat in a conversation.