did (always stylised in lowercase) is a calendar-to-timesheet web application built with React/TypeScript frontend and Node.js/Express backend, using GraphQL for API communication with Microsoft Graph API integration.
Scoped AGENTS.md files exist for areas with distinct concerns. Read the relevant one when working in that area:
| Folder | Covers |
|---|---|
client/AGENTS.md |
Component patterns, styling, GraphQL client, i18n, accessibility, error handling, performance |
server/AGENTS.md |
Auth flow, multi-tenant MongoDB, Redis, TypeGraphQL resolvers, security middleware, logging |
shared/AGENTS.md |
RBAC/permissions config, shared utilities, cross-platform constraints |
docker/AGENTS.md |
Docker commands, agent/worktree setup scripts, sample data |
webpack/AGENTS.md |
Webpack 5 config structure, loaders, plugins, production build flags |
npm run watch- Primary development command (concurrent client/server watching with hot reload)npm run debug:server- Server debugging with TypeScript compilation and Node inspectornpm run create-env- Generate .env file for local development (run this first)
npm run package- Full production build (client + server + archive)npm run package:client- Build client onlynpm run build:server- Build server with TypeScript compilation
npm run lint- ESLint check for client/server TypeScriptnpm run lint:fix- Auto-fix linting issuesnpm run prettier:write- Auto-format code (single quotes, no semicolons, 2-space indent)npm test- Run AVA test suite (2-minute timeout per test)
npm run commit- Interactive commit with emojis using sexy-commits (recommended)- Format:
commit "[changes]" "[type]" "[message]"where type is from package.json gitmoji config
- Separate
tsconfig.jsonfor client (ES2018 target) and server (Node.js target) - Decorators enabled server-side for TypeGraphQL
- Prefer interfaces over type aliases
- Explicit return types required
# Authentication
MICROSOFT_CLIENT_ID=your_azure_ad_client_id
MICROSOFT_CLIENT_SECRET=your_azure_ad_client_secret
# Database
MONGO_DB_CONNECTION_STRING=mongodb://localhost:27017
MONGO_DB_DB_NAME=main
# Sessions & Security
SESSION_SIGNING_KEY=your_session_key
REDIS_CACHE_HOSTNAME=localhost
REDIS_CACHE_KEY=your_redis_key
REDIS_CACHE_PORT=6379
# Optional: Explicit TLS/SSL port (falls back to 6380 automatically when REDIS_CACHE_KEY is set and REDIS_CACHE_PORT=6379)
# REDIS_CACHE_SSL_PORT=6380
API_TOKEN_SECRET=your_api_secret- Node.js >= 24 LTS (see .nvmrc)
- npm >= 11.0.0
- AVA test framework with TypeScript support
- Tests alongside source files with
.test.tsextension - 2-minute timeout per test
- Worker threads enabled for performance
npm test- Run all tests with verbose output- Tests run automatically on PRs via GitHub Actions
- Use
[ava]in commit message to trigger tests;[skip-ci]to skip CI entirely
main- Production (did.crayonconsulting.no)dev- Development (didapp-dev.azurewebsites.net)feat/- Feature branches (deploy to dev)
- Slot swapping for zero-downtime deployments
- Environment-specific configuration per slot
- Automatic scaling based on load
- Maintenance mode: set
MAINTENANCE_MODE=trueenvironment variable