How sup3rus3r/nextapi-core works
NextAPI Core combines a Next.js/FastAPI starter with a CLI-driven full-stack module registry. The main user workflow is to register or sign in, use role-gated app pages and APIs, and extend the app by staging registry modules and syncing their routes, models, and navigation into the codebase. The README documents additional capabilities such as API-client credentials and Capacitor mobile packaging. Source excerpts are partial, so the graph omits uncertain internal wiring while retaining those documented product branches.
Main entry points: page.tsx Auth and app pages · main.py FastAPI endpoints · registryClient.mjs Registry client · cli.mjs NextAPI CLI
Components 25
Web app
- Auth and app pages
frontend/app/(app)/home/page.tsx - NextAuth credentials
frontend/auth.ts - Registration proxy
frontend/app/api/backend/auth/register/route.ts - Server encryption
frontend/lib/crypto-server.ts - Role route policy
frontend/config/routes.ts - API client
frontend/lib/api.ts - Configurable app shell
frontend/components/shell/app-shell.tsx
API and data
- FastAPI endpoints
backend/main.py - Token and API auth
backend/auth.py - Payload crypto
backend/crypto_utils.py - Request validation
backend/schemas.py - SQLite persistence
backend/database.py - Mongo persistence
backend/database_mongo.py
Module registry
- NextAPI CLI
scripts/nextapi-cli/cli.mjs - Stage module
scripts/nextapi-cli/commands/add.mjs - Install and wire
scripts/nextapi-cli/commands/sync.mjs - Publish module
scripts/nextapi-cli/commands/publish.mjs - Registry client
scripts/nextapi-cli/lib/registryClient.mjs - Sync resolution
scripts/nextapi-cli/sync/resolve.mjs
Mobile platform
- Capacitor app
frontend/capacitor.config.ts
Other components
- App user
- FastAPI service
- Module registry
- AI Builder
- Mobile device
Connections 30
- App user → Auth and app pages: uses
- Auth and app pages → NextAuth credentials: signs in
- NextAuth credentials → Server encryption: encrypts credentials
- NextAuth credentials → FastAPI service: login request
- Auth and app pages → Registration proxy: registers
- Registration proxy → Server encryption: encrypts payload
- Registration proxy → FastAPI service: register request
- FastAPI service → FastAPI endpoints: routes requests
- FastAPI endpoints → Payload crypto: decrypts payload
- FastAPI endpoints → Request validation: validates
- FastAPI endpoints → Token and API auth: checks credentials
- FastAPI endpoints → SQLite persistence: reads and writes
- FastAPI endpoints → Mongo persistence: reads and writes
- Auth and app pages → Role route policy: checks access
- Auth and app pages → Configurable app shell: renders within
- Auth and app pages → API client: requests data
- API client → FastAPI service: API request
- App user → NextAPI CLI: runs commands
- NextAPI CLI → Stage module: dispatches
- NextAPI CLI → Install and wire: dispatches
- NextAPI CLI → Publish module: dispatches
- Stage module → Registry client: fetches module
- Registry client → Module registry: requests module
- Install and wire → Sync resolution: resolves staged modules
- Install and wire → Registry client: fetches dependencies
- Publish module → Registry client: publishes module
- Registry client → Module registry: transfers modules
- AI Builder → Module registry: generates modules
- Mobile device → Capacitor app: runs app
- Capacitor app → FastAPI service: uses JWT endpoints