This is an npm workspaces monorepo:
apps/api— Express + TypeScript backend (modular monolith)apps/web— Next.js + TypeScript web appapps/mobile— Expo + React Native + TypeScript apppackages/shared— shared types and validation schemaspackages/stellar— scaffold for future Stellar integration
See architecture.md for details on how the backend is organized into modules.
- TypeScript strict mode is enabled across all packages — avoid
anyand unnecessary type assertions. - ESLint and Prettier are configured per package; run
npm run lint -w <package>andnpm run formatbefore committing. - Naming: files use kebab-case (e.g.
auth.service.ts,auth.controller.ts); React components use PascalCase. - Validation: request/form validation schemas that are needed by both
the API and the web app belong in
@discoverly/shared. API-only or web-only validation stays local to that app. - Module boundaries (backend): business logic belongs inside
apps/api/src/modules/<module>. Cross-cutting infrastructure (config, database, logging, error handling) belongs inapps/api/src/shared. Do not put business logic inshared/.
- Install dependencies:
npm install - Build
@discoverly/shared:npm run build -w @discoverly/shared - Run the app(s) you're working on (see root README)
- Write or update tests alongside your change
- Run
npm run lintandnpm run testfor the affected workspace(s) - Open a pull request — CI runs lint, test, and build for each affected package
When adding new business functionality to apps/api, create a new folder
under src/modules/<name>/ following the same shape as modules/auth
(controllers/, services/, repositories/, validators/, routes/,
types/, tests/), and mount its router in src/app.ts. Avoid adding
business logic to src/shared/.
- Keep changes scoped — avoid mixing unrelated changes in one PR.
- Add tests for new behavior; CI will fail on lint, test, or build errors.
- Update relevant package README/docs when you change setup or developer-facing behavior.