A monorepo for Ameciclo's Atlas platform - a comprehensive solution for cyclist data management and analysis
This monorepo utilizes pnpm and Turbo for efficient development, building, and deployment of various applications and packages. It provides a standardized and maintainable environment for all projects within the Atlas ecosystem, focusing on cyclist data collection, analysis, and visualization.
- Monorepo Management: pnpm (https://pnpm.io/)
- Build System & Caching: Turbo (https://turbo.build/)
- Code Standardization: Biome (https://biomejs.dev/)
- Languages: TypeScript
- API Frameworks: Hono, Zod OpenAPI
- Database: PostgreSQL with Drizzle ORM
- Documentation: Scalar API Reference
- Containerization: Docker
- CI/CD: GitHub Actions
- Node.js 22.15.0
- pnpm 10.10.0
We recommend using mise for managing tool versions. A .tool-versions file is included in the repository.
-
Clone the Repository:
git clone https://github.com/ameciclo/atlas.git cd atlas -
Install Dependencies:
pnpm install
-
Start the Database:
# Start PostgreSQL with PostGIS docker-compose up -d # Run migrations pnpm --filter @atlas/database db:migrate
-
Development:
# Start all services pnpm dev # Or start a specific service pnpm --filter @atlas/cyclist-profile dev
-
Building:
# Build all applications/packages pnpm build # Or build a specific application pnpm --filter @atlas/cyclist-profile build
-
Testing:
# Run all tests pnpm test # Or test a specific application pnpm --filter @atlas/cyclist-profile test
-
Code Quality:
# Format code pnpm format # Lint code pnpm lint # Type check pnpm check-types
For more detailed instructions, see the Development Guide.
atlas/
├── .github/ # GitHub configuration
│ └── workflows/ # GitHub Actions workflows
├── apps/ # Applications
│ ├── docs/ # API documentation site
│ └── cyclist-profile/ # Cyclist profile service
├── docs/ # Documentation
│ ├── CREATE_NEW_SERVICE.md # Guide for creating new services
│ ├── SCAFFOLDING_TOOL.md # Scaffolding tool documentation
│ └── SUMMARY.md # Documentation index
├── packages/ # Shared packages
│ ├── database/ # Shared database package with Drizzle ORM
│ ├── typescript-config/ # Shared TypeScript configuration
│ └── create-atlas-app/ # Scaffolding tool for new services
├── .tool-versions # Tool versions for mise
├── biome.json # Biome configuration
├── turbo.json # Turborepo configuration
└── pnpm-workspace.yaml # PNPM workspace configuration
The CI/CD pipeline uses GitOps principles with GitHub Actions and ArgoCD:
-
Semantic Versioning: Automated releases using conventional commits and Release Please
-
Smart Dependency Detection:
- Uses Turborepo's
--affectedflag to only process packages that have changed - Compares with the base branch for PRs or the previous commit for pushes to main
- Automatically detects which apps need to be built and deployed
- Uses Turborepo's
-
GitOps Deployment:
- Staging: Auto-deploys on every main branch push
- Production: Auto-deploys on semantic releases + manual deployment option
- ArgoCD: Monitors groundwork repository and syncs changes automatically
-
Efficient Docker Builds:
- Only builds Docker images for applications that have changed
- Uses GitHub Actions caching for faster builds
- Pushes images to GitHub Container Registry (ghcr.io)
- Tags images with commit SHA, branch name, and 'latest' for main branch
-
GitOps Deployment:
- Staging environment auto-deploys on every main branch push
- Production deploys on semantic releases or manual triggers
- ArgoCD monitors groundwork repository for automatic synchronization
- Database migrations and seeding are handled by reusing the same Docker image with different commands
Atlas uses a GitOps deployment strategy with ArgoCD:
- Documentation: GitOps Deployment Guide
- Staging:
docs-staging.ameciclo.org(auto-deployed on main branch) - Production:
docs.ameciclo.org(deployed on releases or manually) - Infrastructure: Managed via Groundwork Repository
Atlas uses a shared database with single schema approach:
- Single Database: All services connect to the
atlasdatabase - Public Schema: All tables reside in the default
publicschema - Shared Tables: Services can query each other's tables when needed
- Centralized Migrations: Managed through the
@atlas/databasepackage
See Database Usage Guide for details.
The CI/CD pipeline automatically generates OpenAPI specifications for all API services:
- Build Phase: TypeScript is compiled (no database required)
- OpenAPI Generation Phase:
- PostgreSQL service starts in CI
- Database migrations run
- OpenAPI specs are generated with real database schema
- Specs are committed back to the repository
- Deployment: The docs app displays all OpenAPI specifications
For deployment, we use Docker images that are built and pushed to GitHub Container Registry:
# Pull the latest image for an app
docker pull ghcr.io/ameciclo/atlas/cyclist-profile:latest
# Run the container
docker run -p 3000:3000 --env-file .env ghcr.io/ameciclo/atlas/cyclist-profile:latestThe same image can be used for different purposes by overriding the command:
# Run database migrations
docker run --env-file .env ghcr.io/ameciclo/atlas/cyclist-profile:latest node apps/cyclist-profile/dist/db/migrate.js
# Seed the database
docker run --env-file .env ghcr.io/ameciclo/atlas/cyclist-profile:latest node apps/cyclist-profile/dist/db/seed.jsWe welcome contributions to the Atlas project! Here's how you can contribute:
- Fork the repository and clone it locally
- Create a new branch for your feature or bugfix
- Make your changes following our code style guidelines
- Write or update tests as necessary
- Run the test suite to ensure everything passes
- Submit a pull request with a clear description of the changes
We use Biome for code formatting and linting:
# Format code
pnpm format
# Lint code
pnpm lintAll code must pass type checking:
pnpm check-typesWe use Husky for Git hooks to ensure code quality before commits:
- pre-commit: Runs linting and formatting
- pre-push: Runs type checking and tests
We provide a scaffolding tool to quickly create new services with all the necessary boilerplate:
# Interactive mode
pnpm create-atlas-app
# With service name
pnpm create-atlas-app my-serviceThe tool will:
- ✅ Generate complete service structure with TypeScript, Hono, and Zod OpenAPI
- ✅ Create Dockerfile and docker-compose.yml
- ✅ Set up database with Drizzle ORM (optional)
- ✅ Add example routes, tests, and documentation
- ✅ Configure CI/CD integration automatically
For detailed instructions, see docs/CREATE_NEW_SERVICE.md and docs/SCAFFOLDING_TOOL.md.
This project is licensed under the MIT License - see the LICENSE file for details.