Self-Hosting Guide
Requirements
- Docker
- Node.js 20+
- npm
- PostgreSQL 16+ via the provided Docker setup
Quick Start
git clone https://github.com/kirill-markin/flashcards-open-source-app.git
cd flashcards-open-source-app
cp .env.example .env
make db-up
npm install --prefix api
npm install --prefix apps/auth
npm install --prefix apps/backend
npm install --prefix apps/web
Then run the services in separate terminals:
make auth-dev
make backend-dev
make web-dev
This starts:
postgreson port5432authon port8081backendon port8080webon port3000
Local URLs:
http://localhost:3000for the web apphttp://localhost:8080/v1for the backend APIhttp://localhost:8081for the auth service
Configuration
Copy .env.example to .env and adjust:
DATABASE_URL— Postgres connection stringAUTH_MODE—nonefor local use,cognitofor email OTP authBACKEND_ALLOWED_ORIGINS— allowed browser origins for session-authenticated API requestsPUBLIC_API_BASE_URLandPUBLIC_AUTH_BASE_URL— optional overrides when you want discovery responses to advertise custom public hosts
iOS Local Config
The iOS app in the main repository reads its local API and auth hosts from:
apps/ios/Flashcards/Config/Local.xcconfig
Copy the example file if needed:
cp apps/ios/Flashcards/Config/Local.xcconfig.example apps/ios/Flashcards/Config/Local.xcconfig
Then point it at your local or self-hosted api and auth domains.
Updating
git pull
npm install --prefix api
npm install --prefix apps/auth
npm install --prefix apps/backend
npm install --prefix apps/web
Restart the local services after dependency changes.
AWS Deployment
The documented production shape is:
- CloudFront + S3 for
app.<domain> - API Gateway + Lambda for
api.<domain> - API Gateway + Lambda for
auth.<domain> - Postgres in AWS RDS
- Cognito for passwordless email OTP
- optional apex redirect when the root domain is otherwise unused
For the deployment details, see: