Self-Hosting Guide
Requirements
- Docker
- Node.js 20+
- npm
- Bundled Docker setup के जरिए PostgreSQL 16+
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
फिर services को अलग terminal windows में चलाएं:
make auth-dev
make backend-dev
make web-dev
इससे यह शुरू होगा:
postgreson port5432authon port8081backendon port8080webon port3000
Local addresses:
http://localhost:3000for the web apphttp://localhost:8080/v1for the backend APIhttp://localhost:8081for the auth service
Configuration
.env.example को .env में copy करें और ये values set करें:
DATABASE_URL— Postgres connection stringAUTH_MODE— local के लिएnone, email OTP auth के लिएcognitoBACKEND_ALLOWED_ORIGINS— session-backed API requests के लिए allowed originsPUBLIC_API_BASE_URLऔरPUBLIC_AUTH_BASE_URL— जब discovery responses में custom public hosts दिखाने हों तब optional overrides
Local iOS Setup
Main repository में iOS app local API और auth hosts यहां से पढ़ता है:
apps/ios/Flashcards/Config/Local.xcconfig
जरूरत हो तो example file copy करें:
cp apps/ios/Flashcards/Config/Local.xcconfig.example apps/ios/Flashcards/Config/Local.xcconfig
फिर इसे अपने local या self-hosted api और auth domains की ओर point करें।
Updating
git pull
npm install --prefix api
npm install --prefix apps/auth
npm install --prefix apps/backend
npm install --prefix apps/web
Dependency changes के बाद local services restart करें।
AWS Deployment
Documented production shape:
- CloudFront + S3 for
app.<domain> - API Gateway + Lambda for
api.<domain> - API Gateway + Lambda for
auth.<domain> - Postgres on AWS RDS
- Cognito for passwordless email auth
- Optional apex redirect when the root domain is unused
Details: