create-shivam-oauth
v1.0.7
Published
Create and run a self-hostable OAuth/OIDC stack with admin dashboard in one command.
Downloads
568
Maintainers
Readme
Dhanvantari User/Admin API Request Dashboard
React + Node.js based dashboard with built-in OAuth 2.0 / OpenID Connect support.
Main Highlights
- Separate Admin and User flows
- Local auth + optional OAuth login integration
- Built-in OIDC Authorization Server (Auth Code + PKCE)
- Redesigned OAuth pages:
- Login UI (
/oauth/login) - Consent UI (
/oauth/consent)
- Login UI (
- Strong security baseline (rate limits, CSRF/origin checks, signed cookies, audit logs)
- Postgres-first storage with optional local file mode for dev
Key OAuth/OIDC Endpoints
GET /.well-known/openid-configurationGET /oauth/jwksGET /oauth/login/POST /oauth/loginGET /oauth/consent/POST /oauth/consentPOST /oauth/parGET /oauth/authorizePOST /oauth/tokenGET /oauth/userinfoPOST /oauth/revokePOST /oauth/introspectGET /oauth/logout
Quick Start
Install Anywhere In One Command
npx @cyrusdemon/doauth my-oauth --startThis scaffolds the full project, runs guided setup, installs dependencies, starts backend + frontend on free ports, and opens Super Admin panel.
One-command OAuth Setup (Recommended)
npm run setup:oauthWhat this wizard does:
- checks required tools and asks
Y/Nbefore installing missing ones - auto-selects free ports for backend/client
- accepts DB URL, Redis URL, and multiple OAuth redirect URLs
- applies secure OAuth defaults and starts the stack
- can auto-open Super Admin panel (
/admin-login)
Server
cd server
cp .env.example .env
npm install
npm run devClient
cd client
npm install
npm run devBackend runs at http://localhost:4000 and frontend at http://localhost:5173.
Notes
- OAuth UI templates are currently defined in:
server/src/index.js(/oauth/loginroute HTML)server/src/index.js(renderConsentPagefunction)
- Encryption key material is stored in
.runtime/app-encryption.keysviaAPP_ENCRYPTION_KEYS_FILE
Full clean recreate:
RESET_OAUTH_STACK=true ./startStop local stack:
./stop
# or
./scripts/stop-local-oauth-stack.shProduction notes
- Change default seeded admin credentials immediately.
- Keep
ALLOW_DEMO_LOGIN=falsein production. - Keep
STRICT_SESSION_BINDING=true. - Keep
REQUIRE_ADMIN_MFA=true. - Set
OIDC_ISSUERto your public HTTPS backend URL. - In production, keep
OIDC_DYNAMIC_CLIENT_REGISTRATION_ENABLED=falseunless explicitly required. - For HSM/KMS signing integration, switch to
OIDC_SIGNER_MODE=remoteand wire signer/JWKS envs. - For PostgreSQL mode, run
npm run db:migrateduring deployment and before app startup. - If migrating from file DB, run
npm run db:import-fileonce after migrations (DB_IMPORT_SOURCEcan override source path). - Keep
AADHAAR_OTP_PROVIDER=abdmin production and disable mock OTP response. - Configure
ABDM_CLIENT_ID,ABDM_CLIENT_SECRET, and ABDM endpoints inserver/.env. - If using Sandbox provider, set
AADHAAR_OTP_PROVIDER=sandboxand configure:SANDBOX_API_KEY,SANDBOX_API_SECRETSANDBOX_AADHAAR_GENERATE_OTP_PATH(default:/kyc/aadhaar/okyc/otp)SANDBOX_AADHAAR_VERIFY_OTP_PATH(default:/kyc/aadhaar/okyc/otp/verify)
- Keep
NODE_ENV=productionbehind HTTPS only. - Rotate secrets and monitor security event logs.
