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 にコピーし、以下を設定します:
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 をコピーします:
cp apps/ios/Flashcards/Config/Local.xcconfig.example apps/ios/Flashcards/Config/Local.xcconfig
その後、local または self-hosted の api / auth domains を指すように設定してください。
Updating
git pull
npm install --prefix api
npm install --prefix apps/auth
npm install --prefix apps/backend
npm install --prefix apps/web
Dependencies を変更した後は local services を再起動してください。
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
詳しくは: