Skip to content

Refactor to modular production-ready Express + TypeScript starter with CI, Docker and tests#1

Merged
mirrrjr merged 2 commits into
masterfrom
codex/perform-starter-kit-audit-of-repository
Jun 8, 2026
Merged

Refactor to modular production-ready Express + TypeScript starter with CI, Docker and tests#1
mirrrjr merged 2 commits into
masterfrom
codex/perform-starter-kit-audit-of-repository

Conversation

@mirrrjr

@mirrrjr mirrrjr commented Jun 6, 2026

Copy link
Copy Markdown
Member

Motivation

  • Move from a minimal example to a production-minded, modular architecture with clear separation of concerns (config, infra, modules, shared middleware, and typed services/repositories).
  • Add operational primitives required for running in real environments: structured logging, environment validation, health/readiness, graceful shutdown, rate limiting, CORS/security headers, and Docker support.

Description

  • Introduces a modular app factory and bootstrapping: createApp, start with graceful shutdown, and database lifecycle in src/infrastructure/database/mongoose.ts and src/index.ts.
  • Implements a typed users feature module with schema/validation, service, controller, repository implementations (MongooseUserRepository and InMemoryUserRepository), password hashing, and request validation under src/modules/users/* and src/shared/* helper middleware and errors.
  • Adds environment parsing and logger in src/config/env.ts and src/config/logger.ts, plus middlewares for request IDs, request logging, security headers, rate limiting, not-found and error handling in src/shared/middleware/*.
  • Adds health and OpenAPI endpoints in src/modules/health and src/modules/openapi, a test/app.test.ts exercising health and user flows against an in-memory repo, TypeScript config tightening in tsconfig.json, Dockerfile, docker-compose.yml, .dockerignore, GitHub Actions CI (.github/workflows/ci.yml), and README updates; also updates package.json to PNPM tooling and scripts and replaces package-lock.json with pnpm-lock.yaml updates.

Testing

  • Ran lint with pnpm lint, the TypeScript checks completed successfully. (CI includes pnpm lint.)
  • Ran the test suite with pnpm test which executes the node test runner on test/*.test.ts, and the tests passed locally/CI. (CI workflow runs pnpm test.)
  • Built the project with pnpm build, and the build completed successfully; the CI job also runs pnpm build.

Codex Task

Comment thread src/modules/users/user.repository.ts Fixed
… from user-controlled sources'

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@mirrrjr
mirrrjr merged commit 9aa5902 into master Jun 8, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants