This repository contains a FastAPI backend and React (TypeScript + Vite) frontend scaffold for the astrology guidance platform defined in the BRD/PRD/TRD. SharePoint integration is stubbed behind a client to be wired to Microsoft Graph and OpenAI in future iterations.
backend/: FastAPI app with OTP/auth, preferences, profile, guidance, and translations endpoints. SharePoint and OpenAI calls are mocked.frontend/: Vite + React single-page app that calls the backend APIs and renders stubbed guidance.Artifacts/: BRD/PRD/TRD reference documents.
- Create a virtual environment and install deps:
cd backend python -m venv .venv .venv/Scripts/activate # Windows PowerShell: .venv\\Scripts\\Activate.ps1 pip install -r requirements.txt
- Run locally:
uvicorn app.main:app --reload --port 7500
- Key files:
app/main.py: FastAPI entrypoint and router wiring.app/routes/*.py: API endpoints (OTP, preferences, profile, guidance, translations).app/services/sharepoint_client.py: SharePoint stub; replace with Graph calls and list schemas from PRD/TRD.app/services/guidance_service.py: Cache-first guidance flow with TTL by period type; replace_fallback_generatewith OpenAI orchestration.
- Install deps and run dev server:
The Vite dev server proxies API calls to
cd frontend npm install npm run dev -- --port 8500http://localhost:7500. - Key files:
src/App.tsx: Simple selector UI for language/methodology/sign/period and renders guidance.src/api.ts: Fetch helpers targeting backend endpoints.src/types.ts: Shared frontend types mirroring backend responses.
- Replace
SharePointClientStubwith Microsoft Graph integration (lists: GuidanceCache, UiTranslations, UserProfiles, PromptRegistry, etc.). - Wire
_fallback_generateinguidance_service.pyto OpenAI with governed prompts and cache persistence in SharePoint. - Implement durable OTP store and delivery via Graph (email) and SMS provider; enforce rate limits and lockouts.
- Harden validation (period boundaries, category bundles, consented personalization) per PRD/TRD acceptance criteria.
- Add automated tests (backend/ frontend) and CI once real integrations are added.
- Build & run:
docker-compose up -d
- Stop:
docker-compose down
- Rebuild:
docker-compose build docker-compose up -d
Convenience scripts are provided: run.bat, stop.bat, and rebuild.bat.