Development Guide
Prerequisites
Ensure you have the following installed:
- Node.js (v18+)
- PNPM (v9+)
- Docker & Docker Compose
- Supabase CLI
- Python (v3.11+) & Poetry
- Terraform (for infrastructure)
- Make
First Time Setup
-
Clone the repository:
git clone <repo-url>
cd faiht2-ro -
Install dependencies:
pnpm install -
Install Pre-commit Hooks: This monorepo uses
pre-committo ensure code quality (formatting, linting) for Python, JS, and Terraform.make setup-hooks -
Environment Configuration:
- Copy
.env.exampleto.envin the root directory. - Fill in your secrets defined in the
.envfile. - Run the sync command to distribute configurations:
make sync-envsTip: You can use
make env-sandboxormake env-prodto quickly overwrite the web config, butmake sync-envsis the recommended way to manage everything centrally. - Copy
Running Locally
1. Start Supabase
Start the local Supabase instance/emulator.
cd services/supabase
npx supabase start
2. Start Services
Run the frontend and API gateway in development mode.
pnpm dev
This will start:
- Web:
http://localhost:3000 - API:
http://localhost:8787
3. Run Fetcher Worker
To run the python fetcher locally:
cd services/fetcher
poetry install
poetry run python src/main.py
Database Management
-
Migrations:
cd services/supabase
npx supabase migration new <migration_name>
npx supabase db reset -
Type Generation: Run the sync script to generate types for both TypeScript and Python.
./scripts/generate-types.sh