Backend workspace for MentiCode, organized as a multi-service monorepo with shared packages, domain-focused services, and multiple intelligence engine iterations.
This workspace contains:
- Service-oriented backend applications (gateway, auth, analyzer, course, intelligence engines).
- Shared packages reused across services.
- Infrastructure and architecture documentation.
- Utility scripts for running multiple services together in development.
backend/
├── auth/ # Standalone auth workspace package
├── docs/ # Architecture notes and analysis artifacts
├── infrastructure/ # Infra and deployment-related assets
├── packages/
│ └── shared/ # Reusable cross-service code
├── scripts/
│ └── run-all.mjs # Multi-service runner
├── services/
│ ├── analyzer-service/
│ ├── auth-service/
│ ├── course-service-demo/
│ ├── gateway/
│ ├── github-service/
│ ├── intelligence-engine/
│ ├── intelligence-enginev2/
│ ├── intelligence-enginev3/
│ ├── intelligence-enginev4/
│ ├── learning-service/
│ └── notification-service/
└── package.json # Workspace root configuration
The root uses npm workspaces:
packages/*services/*auth
This allows installing dependencies and running scripts per workspace from the backend root.
- Node.js 18+
- npm 9+
Some services may have additional runtime requirements (for example, databases, Python runtime, or service-specific environment variables). Check the README inside each service directory for details.
From the backend root:
npm installnpm run dev:allThis runs the default service set configured in scripts/run-all.mjs:
gatewayauthanalyzercourse-serviceintelligence-enginev3
npm run start:allnpm run dev:coursePowerShell:
$env:SERVICES = "gateway,auth"
node scripts/run-all.mjs devBash:
SERVICES=gateway,auth node scripts/run-all.mjs devnpm run dev:all: Run default backend services in development mode.npm run start:all: Run default backend services in start mode.npm run dev:course: Run development flow focused on the course service.
SERVICES(orSERVICE): Comma-separated service IDs for targeted runs.CMD: Script name override forrun-all.mjs.MENTICODE_SERVICE_COURSE_PORT/COURSE_PORT: Override course service port (default8001).MENTICODE_SERVICE_INTELLIGENCE_ENGINEV3_PORT/IEV3_PORT: Override intelligence-enginev3 port (default4003).KILL_AFTER_MS: Grace period before force-killing child processes on shutdown (default2500).
- Keep service boundaries explicit and avoid cross-service coupling.
- Place reusable logic in
packages/sharedrather than duplicating it in services. - Keep API contracts and environment variables documented per service.
- Add or update tests in the corresponding service when behavior changes.
Architecture and analysis artifacts are available under docs/, including engine evolution notes in docs/EngineAnalysis/.
- Create a feature branch.
- Implement changes in the relevant service or shared package.
- Run service-level tests and checks.
- Open a pull request with clear scope, test evidence, and migration notes (if applicable).