Self-Hosting Guide
Voraussetzungen
- Docker
- Node.js 20+
- npm
- PostgreSQL 16+ ueber das bereitgestellte 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
Starte die Dienste danach in separaten Terminals:
make auth-dev
make backend-dev
make web-dev
Dadurch starten:
postgresauf Port5432authauf Port8081backendauf Port8080webauf Port3000
Lokale URLs:
http://localhost:3000fuer die Web-Apphttp://localhost:8080/v1fuer die Backend-APIhttp://localhost:8081fuer den Auth-Service
Konfiguration
Kopiere .env.example nach .env und passe an:
DATABASE_URL— Verbindungszeichenfolge fuer PostgresAUTH_MODE—nonefuer lokal,cognitofuer E-Mail-OTP-AuthBACKEND_ALLOWED_ORIGINS— erlaubte Browser-Origin fuer sitzungsbasierte API-AnfragenPUBLIC_API_BASE_URLundPUBLIC_AUTH_BASE_URL— optionale Overrides, wenn Discovery-Antworten benutzerdefinierte Hosts bewerben sollen
Lokale iOS-Konfiguration
Die iOS-App im Haupt-Repository liest lokale API- und Auth-Hosts aus:
apps/ios/Flashcards/Config/Local.xcconfig
Kopiere bei Bedarf die Beispieldatei:
cp apps/ios/Flashcards/Config/Local.xcconfig.example apps/ios/Flashcards/Config/Local.xcconfig
Zeige danach auf deine lokalen oder selbst gehosteten api- und auth-Domains.
Aktualisieren
git pull
npm install --prefix api
npm install --prefix apps/auth
npm install --prefix apps/backend
npm install --prefix apps/web
Starte die lokalen Dienste nach Aenderungen an Abhaengigkeiten neu.
AWS-Deployment
Die dokumentierte Produktionsform ist:
- CloudFront + S3 fuer
app.<domain> - API Gateway + Lambda fuer
api.<domain> - API Gateway + Lambda fuer
auth.<domain> - Postgres in AWS RDS
- Cognito fuer passwortloses E-Mail-OTP
- optionaler Apex-Redirect, wenn die Root-Domain sonst ungenutzt bleibt
Details findest du in: