|
|
||
|---|---|---|
| .. | ||
| src | ||
| .env.example | ||
| docker-compose.yml | ||
| package-lock.json | ||
| package.json | ||
| README.md | ||
| tsconfig.json | ||
FamiliarOS Auth Server
Self-hosted SuperTokens auth backend for the FamiliarOS website. Provides email/password sign-up and sign-in, GitHub OAuth, session management, and a small /api/auth/me bootstrap endpoint used by the frontend.
Quick start
- Install dependencies:
cd server
npm install
- Copy and fill in the environment variables:
cp .env.example .env
- Start the SuperTokens core and Postgres:
docker compose up -d
- Run the Node backend:
npm run dev
The server listens on http://localhost:3001 by default. The SuperTokens core in the included Docker Compose is exposed on host port 3568 so it does not collide with any other SuperTokens core already running on port 3567.
Frontend wiring
Set the website env variables to point at this backend:
VITE_SUPERTOKENS_API_DOMAIN=http://localhost:3001
VITE_SUPERTOKENS_WEBSITE_DOMAIN=http://localhost:5173
VITE_SUPERTOKENS_API_BASE_PATH=/auth
VITE_SUPERTOKENS_WEBSITE_BASE_PATH=/auth
VITE_AUTH_API_BASE_URL=http://localhost:3001
VITE_GITHUB_OAUTH_ENABLED=true
GitHub OAuth
GitHub OAuth is disabled by default. See docs/ops/GITHUB_AUTH_STATUS.md for the full rationale, environment variables, and enablement steps.
To enable it locally, create a GitHub OAuth app at https://github.com/settings/developers,
set the authorization callback URL to http://localhost:3001/auth/callback/github, and
add the generated GITHUB_CLIENT_ID and GITHUB_CLIENT_SECRET to server/.env.