This repository provides a robust foundation for developing a server-side application with a well-structured domain architecture.
This starter template is designed to be cloud platform and database independent, giving you the flexibility to choose your preferred infrastructure. For specialized implementations tailored to specific cloud providers, explore these extensions:
- Google Cloud Platform (GCP): A complete implementation leveraging Firebase Authentication for user authentication, Cloud Firestore for data storage, and Cloud Run for serverless deployment.
This monorepo includes the following packages and applications:
internal-api: A Fastify application that provides a REST API and MCP server implementation. Designed for server-to-server communication with authentication via API keys or service accounts. Ideally it should be used in a internal network to ensure secure data transmission.public-api: A Fastify application that provides a REST API implementation. Designed for secure internet-facing access with robust authentication and authorization protocols such as OIDC.@repo/configs: Shared configuration files for ESLint, Jest, Prettier and TypeScript to ensure consistent code quality and style across all packages.@repo/fastify: Shared Fastify utilities and plugins providing common server functionality, middleware, and helper methods.@repo/shared: Shared business logic including domain models, services, interfaces and utilities used across all applications.
This monorepo comes pre-configured with essential development tools:
- PNPM Fast, disk space efficient package manager.
- Turborepo for efficient monorepo management and shared library handling.
- TypeScript for robust type checking.
- ESLint for code quality and consistency.
- Prettier for automated code formatting.
.vscode/ # VS Code workspace settings and configurations
apps/ # Application source codes
contexts/ # Documentation for developers and vibe coding to be used as context.
packages/ # Shared packages and libraries
.gitignore # Git ignore rules for the project
.lintstagedrc.json # Lint-staged configuration for pre-commit hooks
.markdownlint.json # Markdown linting rules
.monorepo.code-workspace # VS Code workspace configuration
package.json # Root package.json for workspace configuration
pnpm-lock.yaml # PNPM lock file for dependency versioning
pnpm-workspace.yaml # PNPM workspace configuration
PROMPTS.md # AI prompt templates for development assistance
TODOs.md # Project roadmap and pending tasks
turbo.json # Turborepo configuration fileBefore you begin, ensure you have the following installed:
-
Node.js version 22 (we recommend using nvm for version management)
-
pnpm package manager.
-
Turborepo CLI globally installed:
pnpm install turbo --global
Install all repository dependencies by running:
pnpm installThe build process will create optimized production bundles in the dist directory of each package.
To build all applications and packages in the monorepo:
# Build for production (with optimizations)
pnpm buildYou can also build individual packages or applications by navigating to their respective directories:
# Example: Building a shared package
cd packages/shared
pnpm run build
# Example: Building a specific application
cd apps/public-api
pnpm run buildThis project contains multiple applications that can be run independently. For development, we use development builds that support hot-reloading and provide better debugging capabilities.
To start development, choose one of the following applications:
pnpm run dev:internal-apipnpm run dev:public-apiNote: Each application may require specific environment variables to function properly. Check the
.env.examplefile in each application's directory and create a.envfile with the required variables before starting the development server.
The project uses Jest as the testing framework. Here's how to run tests:
To run tests across all apps and packages from the root directory:
pnpm run testTo run tests for a specific app or package:
- Navigate to the target directory:
cd packages/shared # or any other package/app directory- Run the tests:
pnpm run testEach package and app generates test coverage reports. To view detailed coverage information:
- Navigate to the package/app directory
- Open
coverage/lcov-report/index.htmlin your browser
Before starting a new development, please review the [Project Conventions] documentation inside the /contexts folder. Following these guidelines helps ensure consistency, maintainability, and smoother code reviews during Pull Requests.
Explore more Turborepo features:
- Fork the repository
- Create your feature branch (
git checkout -b feature/your-feature). - Commit your changes (
git commit -am 'Add new feature'). - Push to the branch (
git push origin feature/your-feature). - Open a pull request from your branch to
main.
This project is licensed under the MIT License.
For questions or feedback, please contact lhpaul11@gmail.com.