A reusable TypeScript boilerplate for building a web app, an iOS/Android app, and an API together. It provides local development services, shared validation, database migrations, background jobs, email, file storage, and privacy-aware telemetry. An optional authentication example includes the complete email/password lifecycle.
Start here: copy the repository, choose whether to include auth, run local setup, then adapt the generated project. You do not need cloud credentials to try it locally.
Create a project from this template · Source repository
This is currently a repository template with a local recipe generator. The root npm package is private. There is no published create-project-starter package, npx installer, project-name wizard, or versioned scaffold release yet.
You can create a project using GitHub’s Use this template button when the source repository is configured as a template, or by cloning it. The generator selects auth or a no-auth baseline inside that copy; it does not generate arbitrary app architectures or automatically rename a project.
| Area | Technology and purpose |
|---|---|
| Workspace | npm workspaces and TypeScript; Node.js 24 default, Node.js 26 also supported |
| API | Fastify; JSON endpoints and OpenAPI route schemas |
| Web | Next.js and React; Tailwind CSS 4 and shadcn/ui |
| Mobile | Expo SDK 58 and React Native; NativeWind 4/Tailwind CSS 3 foundation with app-local native components |
| Shared contracts | Zod schemas and pure shared logic in packages/shared |
| Database | PostgreSQL 18, Kysely, and ordered migrations |
| Authentication, if selected | Better Auth, SMTP verification/reset emails, database sessions, Expo SecureStore |
| Background jobs | pg-boss and a separate worker using PostgreSQL |
| Storage | Filesystem and S3-compatible adapters; local SeaweedFS service |
| Provider-neutral SMTP; Mailpit captures local messages | |
| Observability | Pino, OpenTelemetry, Collector, and OpenObserve; auth outcomes, durations, correlation IDs, and redaction |
| Verification | Node integration tests, Playwright browser tests, and iOS-preset native component tests |
| Deployment files | Dockerfiles, GitHub Actions, and a two-environment VPS/Cloudflare/Caddy example; one staging rollout is verified, production is not |
The generated project keeps these boundaries:
apps/api/ API, migrations, email, jobs, and worker
apps/web/ Web app and app-local components
apps/mobile/ Expo app and app-local native components
packages/shared/ Shared contracts and validation
packages/storage/ File storage adapters
scripts/ Setup, recipe generation, and local verification
.agents/skills/ Repository-local agent instructions and skills
.codex/ Codex hook configuration
.claude/ Committed Claude configuration/skill files, where present
docs/ Design, development, testing, and deployment guides
Auth selected: registration → verification email/resend → sign-in → persisted rolling session → sign-out; forgot-password/reset revokes existing sessions. Web uses cookies; Expo stores the opaque session cookie through SecureStore. PostgreSQL controls expiry and renewal. See the auth design.
Auth omitted: web and mobile show starter health screens. Auth-only clients, UI, API sources, CLI tooling, dependency chain, environment-template keys, and auth migration are removed. Generic API, database, jobs, email infrastructure, storage, and telemetry remain. The reference repository intentionally contains the working auth example before generation.
Open API Docs after starting the API. Swagger UI lets you filter operations, inspect parameters and schemas, and execute requests against the API serving the page. Try GET /health first. The same OpenAPI document is available at /openapi.json. Auth operations appear when Better Auth is configured. To try a session-protected operation in the browser, establish a session on the API origin with POST /api/auth/sign-in/email using a verified local test account. Signed file operations require the token from the corresponding upload or download URL.
Web and Expo share the operations under Authentication. The Expo authentication group contains the native OAuth redirect helper. Use /docs/ for the interactive explorer. The /docs/json link in Swagger UI opens the raw contract.
| Tool | Needed for |
|---|---|
| Git | Copying the repository and tracking your changes |
| Node.js 24 + npm 10 or newer | Installing packages and running/building apps; .nvmrc selects Node 24 |
| Docker Desktop, or Docker Engine with Compose v2 | Local PostgreSQL and optional supporting services; Docker must be running |
| Bash | scripts/setup.sh and agent environment scripts |
| Browser | Web app, Mailpit, and telemetry UI |
| macOS + Xcode, command-line tools, an installed iOS Simulator runtime, and CocoaPods for native dependencies | Native iOS build/runtime checks |
| Android Studio/emulator or an Android device | Android runtime development, if you choose to do it |
With nvm, run nvm install then nvm use inside the repository. Another version manager can select Node 24 instead. Node 26 is also supported; CI passed on Node 24 and 26 for commit aea9aaa.
The local workflow was exercised on macOS. Windows users need an appropriate Bash environment, typically WSL2 with Docker integration; Windows/WSL end-to-end setup has not been verified here. You can run web/API work without Xcode or an Android emulator.
Choose one method. The source URL below is this public template; replace YOUR_ORG/MY_PROJECT with your own empty destination repository. There is no published npm installer.
- Open this template and select Use this template → Create a new repository.
- Clone your new repository and enter its directory.
- Choose a recipe and run setup below, before editing app source or package manifests.
git clone https://github.com/ithortechnology-code/next-project-starter.git my-project
cd my-project
# Keep the original as an upstream and connect your own empty repository.
git remote rename origin upstream
git remote add origin https://github.com/YOUR_ORG/MY_PROJECT.gitThis keeps the source history. GitHub’s template flow gives you a new repository instead. Neither method registers cloud services, creates VPSes, or configures a deployment for you.
Choose one recipe in a fresh copy:
# Full auth example, useful for trying the complete demo:
AUTH_RECIPE=better-auth bash scripts/setup.sh --startOr:
# Health-screen baseline without authentication:
AUTH_RECIPE=none bash scripts/setup.sh --startSetup installs npm packages, reconciles the lockfile, creates an ignored .env, starts local Compose services, applies migrations, and starts the API, web app, Expo dev server, and worker. For auth, it generates a local auth secret if needed. First installation/build can take several minutes.
Interactive setup asks whether to include auth. The non-interactive default is none; use AUTH_RECIPE explicitly for repeatable setup. To prepare services without launching app processes, omit --start, then start the apps separately:
npm run dev # API + web
npm run dev:worker # Separate terminal
npm run dev:mobile # Separate terminalDefault URLs, unless .env changes their ports:
| Service | Address |
|---|---|
| Web | http://localhost:3000 |
| API health | http://localhost:4000/health |
| Interactive API docs | http://localhost:4000/docs/ |
| OpenAPI document | http://localhost:4000/openapi.json |
| Mailpit inbox | http://localhost:8025 |
| OpenObserve | http://localhost:5080 |
| Expo/Metro | Port 8081; follow the terminal/device instructions |
Setup prints the configured service addresses. Local example credentials are in .env.example; use your .env values if you changed them. They are development defaults, not production credentials.
- Open the web app, create an account, and leave the verification screen open.
- Open Mailpit and follow the verification email link. Local messages stay in Mailpit; they are not sent to real recipients.
- Sign in, reload the page, and sign out. Anonymous visits to
/appreturn to sign-in. - Request a password reset, open the Mailpit link, and complete it. Existing sessions are revoked.
- Follow the observability guide to inspect safe lifecycle events and duration metrics. Local exporter tests are verified; a ready-made auth funnel dashboard is not provided.
There is no shared demo user/password. Create your own local account; explicit local provisioning is documented in local development.
With the local API/Metro running and Xcode’s simulator ready, build and open the native app. Run this block from the repository root:
(
cd apps/mobile
node --import=../../scripts/load-env.mjs ../../node_modules/expo/bin/cli run:ios --no-bundler
)Complete Xcode’s first-run setup and install a simulator runtime first. Resolve any CocoaPods/native-dependency prompts reported by Expo. Simulator builds do not require store distribution setup; physical-device/release signing needs your own Apple configuration.
If Metro uses a custom port, also pass --port with the port printed by setup. --no-bundler reuses the Metro server already running from setup.
This is an additional build step; npm run dev:mobile starts Metro but does not itself compile a native binary. npm run ios --workspace=@starter/mobile starts Expo with iOS selected. Expo Go can help inspect supported screens, but it does not register this project’s custom auth callback scheme. Use a native build for the full email-link flow.
The iOS Simulator can reach the computer’s localhost API. On a physical phone, set EXPO_PUBLIC_API_URL to a reachable computer LAN address, configure matching public email-link URLs/origins, and allow the connection through your firewall. Android emulators commonly use http://10.0.2.2:4000 for the host. These addresses are development configuration; deployed apps need HTTPS and product-specific app/universal links.
The recipe is recorded in .starter/auth-selection.json. Its choice is one-time: rerunning the same choice preserves user edits; changing choices requires a fresh template copy. Modified recipe inputs are rejected before generation writes anything. The generator does not migrate or delete an existing product database.
For source generation alone, without starting Docker:
node scripts/scaffold-auth.mjs better-auth # Or: none
npm installThe full setup script also formats the no-auth output. If using source-only generation, follow the formatting step in the recipe guide before linting.
After selecting the recipe:
- Set your root package name and app display names, Expo slug/scheme and bundle/application identifiers. There is no automatic project renaming. If changing workspace package names, update their dependency references and imports together.
- Use a unique Compose project name and ports if running several projects at once; agent environments and
scripts/agent-env.shprovide isolated worktrees for parallel work. - Configure
.envand service profiles. The default enables Mailpit, observability and SeaweedFS. If disabling SeaweedFS, setSTORAGE_DRIVER=filesystem; if disabling observability, clearOTEL_EXPORTER_OTLP_ENDPOINT. - Adapt product copy, branding, schemas, migrations and business logic. Keep
AGENTS.md, design guidelines and project docs consistent with your fork. - Commit the generated source,
.starter/auth-selection.json, and updated lockfile. Keep.env, keys, native generated folders and build outputs out of Git.
See the source-of-truth decision for safe reruns and how starter maintainers refresh recipe fingerprints after changing canonical inputs.
A template/clone copy includes the committed AGENTS.md, .agents/skills/, .codex/hooks.json, and available .claude/ files. They are development aids, not app runtime dependencies. The auth recipe preserves them.
Setup does not install Codex/Claude, an editor extension, MCP/browser tooling, AI credentials, or global skills. Whether a tool discovers repository-local skills and runs hooks depends on that tool’s support and configuration. Review and enable them in your agent environment; read AGENTS.md before agent-assisted work. The apps run without an AI agent.
Impeccable’s committed launcher can obtain a pinned engine on first use; downloaded binaries are ignored by Git and are not included in a new clone. Network/tool permissions may be needed. Review PRODUCT.md, DESIGN.md, and docs/design-guidelines.md for your fork; run the skill’s initialization/context workflow when doing design work. Ordinary npm setup does not conduct a product interview or automatically create a new product design.
These are local test results. Remote CI and one staging deployment have also passed for this repository; production and recovery drills have not been verified. See the deployment guide for scope and setup details.
| Layer | Verified locally |
|---|---|
| API auth | 11 PostgreSQL-backed tests: registration, verification, sessions, renewal/expiry, reset/revocation, origins and safe responses |
| 5 configuration/template/failure tests; actual local SMTP flows use Mailpit | |
| Telemetry | 2 tests, including real log/metric/trace export to a local OTLP receiver, correlation and sentinel-secret checks |
| Web/mobile web | 12 Playwright tests across desktop Chromium and Chromium emulating mobile web; real lifecycle, failures, keyboard, overflow and privacy |
| Native | 10 component tests using the iOS Jest preset, plus iOS 26.5 simulator evidence for sign-in/out, relaunch persistence, reset, link handoff and keyboard focus |
| Recipe generator | 3 tests for selected/omitted output, preserved edits, rejected switching and changed-input rejection |
| Fresh generated copies | Dependency install, isolated fresh migrations, workspace lint/typecheck/build and Expo iOS/Android exports; auth suites on the selected copy |
Platform limits: native runtime verification focused on iOS. Android export passes; earlier styling probes ran on Android, but the complete Android auth lifecycle has not been runtime-verified. Chromium mobile emulation is not native iOS or Safari testing. Limited manual Safari responsive checks exist. Full VoiceOver/autofill and installed-mail-client handoff remain unverified; actual email URLs were tested through simulator Safari, which handed them to the native app. Passing component tests does not prove every device behavior.
Every generated app can run:
npm run lint
npm run typecheck
npm run buildAuth-selected output also provides:
npm run test:email --workspace=@starter/api
npm run test:telemetry --workspace=@starter/api
npm run test:auth --workspace=@starter/mobile
npx playwright install chromiumAPI and browser integration tests require running PostgreSQL/Mailpit and a disposable, migrated test database. Read the test guide before pointing tests at any database:
# Replace the placeholder with your test database URL, not starter_dev.
AUTH_TEST_DATABASE_URL='postgresql://USER:PASSWORD@localhost:PORT/starter_auth_test' npm run test:auth --workspace=@starter/api
AUTH_TEST_DATABASE_URL='postgresql://USER:PASSWORD@localhost:PORT/starter_auth_test' npm run test:auth --workspace=@starter/webFrom the intact reference checkout, maintainers can verify both generated paths:
node --test scripts/tests/auth-recipe.test.mjs
AUTH_TEST_DATABASE_URL='postgresql://USER:PASSWORD@localhost:PORT/starter_auth_test' node scripts/verify-auth-recipes.mjsThe full verifier creates and drops its own test databases and needs a role allowed to do so. It removes temporary copies after checking them. Generator tests belong in the reference checkout, where canonical auth sources still exist. They are not the product test suite for a generated no-auth project.
Stop local services with docker compose down; this keeps named data volumes. docker compose down -v deletes those volumes and their data.
Deployment files are supplied as a starting point, not an automatically provisioned hosting service. CI and one VPS staging deployment are verified for this repository. Production deployment, backup restoration, rollback drills, and mobile store releases have not been verified. Expo exports are JavaScript/assets bundles, not signed .ipa/.aab files or App Store/Play Store submissions.
Follow the VPS guide in this order:
- Create your own repository from this template and review workflow triggers before pushing. CI runs on pushes to
mainand pull requests. Image publishing and VPS deployment are opt-in through repository variables; see the VPS guide for the exact variable names and required GitHub Environments. Configure protected environments, hosting, and secrets before enabling them. Never put cloud credentials in workflow files. - For VPS deployment, provision one isolated VPS per environment and configure the web, API, and OpenObserve hostnames, TLS, SMTP, storage, database credentials, backups, GitHub Environments, and secrets. This Compose example runs Postgres and SeaweedFS on the same VPS as the app; splitting them onto another host requires additional configuration.
- Review the staging deployment and test the URLs, sign-up/email flows, migrations, object storage, and telemetry using your own domains and provider accounts. The reference repository's staging checks establish that the example deployment works; they do not verify your fork's configuration or data recovery process.
- Verify backup restoration, application rollback and database migration compatibility. Treat existing PostgreSQL version upgrades as separate maintenance work.
- After staging acceptance, promote the same tested immutable image SHA to a separate production VPS through its protected environment. Choose and tag a release version and write a changelog; there is no published scaffold-package release yet.
- Configure mobile signing, app identifiers, app/universal links and store accounts separately. Build and test native release binaries on devices before distributing them. Android runtime coverage remains work for a fork that ships Android.
The VPS example uses Ubuntu, Docker Compose, GHCR, Caddy, and Cloudflare DNS/TLS. It is not an automatically provisioned or certified production service. Replace all example values and credentials with unique values for each environment. The reference staging deployment had zero registered users when checked on 2026-11-18; that is a point-in-time check, not a promise about later staging data.
- Starter contract and capability map
- Local development and email
- Optional auth recipe, auth epic, and task/evidence checklist
- Test guide, auth observability, and failure runbook
- Design guidelines, PostgreSQL upgrades, and VPS deployment
- Open work, including staging acceptance and production readiness
Original project code is available under the MIT License. Keep its copyright and permission notice when copying or distributing substantial portions. Third-party dependencies, tools, fonts and imported skill assets retain their respective licenses; the project license does not replace those terms.