{"id":26649003,"url":"https://github.com/jellydn/monorepo-starter","last_synced_at":"2026-04-18T04:32:05.398Z","repository":{"id":282549150,"uuid":"948583143","full_name":"jellydn/monorepo-starter","owner":"jellydn","description":"A feature-rich monorepo starter with full Kubernetes support base on with-docker turbo example","archived":false,"fork":false,"pushed_at":"2026-04-15T08:53:09.000Z","size":992,"stargazers_count":5,"open_issues_count":11,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-04-15T10:37:19.525Z","etag":null,"topics":["docker","docker-compose","k8s","monorepo","starter-template","turborepo"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jellydn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":["jellydn"],"ko_fi":"dunghd","buy_me_a_coffee":"dunghd","polar":"jellydn"}},"created_at":"2025-03-14T15:34:56.000Z","updated_at":"2026-04-14T05:45:53.000Z","dependencies_parsed_at":"2025-03-31T05:23:11.082Z","dependency_job_id":"876d6bc2-a794-47da-8f80-e111e81067ce","html_url":"https://github.com/jellydn/monorepo-starter","commit_stats":null,"previous_names":["jellydn/monorepo-starter"],"tags_count":0,"template":true,"template_full_name":null,"purl":"pkg:github/jellydn/monorepo-starter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jellydn%2Fmonorepo-starter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jellydn%2Fmonorepo-starter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jellydn%2Fmonorepo-starter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jellydn%2Fmonorepo-starter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jellydn","download_url":"https://codeload.github.com/jellydn/monorepo-starter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jellydn%2Fmonorepo-starter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31956845,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T00:39:45.007Z","status":"online","status_checked_at":"2026-04-18T02:00:07.018Z","response_time":103,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","docker-compose","k8s","monorepo","starter-template","turborepo"],"created_at":"2025-03-25T00:47:37.769Z","updated_at":"2026-04-18T04:32:05.377Z","avatar_url":"https://github.com/jellydn.png","language":"Shell","funding_links":["https://github.com/sponsors/jellydn","https://ko-fi.com/dunghd","https://buymeacoffee.com/dunghd","https://polar.sh/jellydn"],"categories":[],"sub_categories":[],"readme":"# Monorepo Starter\n\nA modern monorepo starter template with web frontend, API backend, and PostgreSQL database.\n\n## Features\n\n- 🚀 **Modern Stack**: React/NextJs, Express.js, PostgreSQL\n- 📦 **Monorepo Structure**: Using pnpm workspaces\n- 🐳 **Docker Support**: Development and production ready\n- ☸️ **Kubernetes Support**: Production-grade deployment\n- 🔄 **TypeScript**: Full type safety\n- 📝 **Prisma**: Type-safe database access\n- 🧪 **Testing**: Vitest for unit and integration tests\n\n## Project Structure\n\n```\n.\n├── apps/\n│   ├── web/          # React frontend\n│   └── api/          # Express.js backend\n├── packages/         # Shared packages\n│   ├── auth/         # Authentication package\n│   ├── db/           # Database package\n│   ├── logger/       # Logging package\n│   ├── ui/           # UI components\n│   └── typescript-config/ # TypeScript configuration\n├── docs/             # Documentation\n│   ├── architecture.md # Architecture documentation\n│   └── kubernetes.md # Kubernetes documentation\n├── kubernetes/       # Kubernetes configurations\n└── docker-compose.yml\n```\n\n## Getting Started\n\n### Prerequisites\n\n- Node.js 22+\n- pnpm\n- Docker and Docker Compose\n- Kubernetes (for production deployment)\n\n### Development\n\n1. Install dependencies:\n\n```bash\npnpm install\n```\n\n2. Start development environment:\n\n```bash\ndocker-compose up -d\n```\n\n3. Start development servers:\n\n```bash\n# Terminal 1 - Web\npnpm --filter web dev\n\n# Terminal 2 - API\npnpm --filter api dev\n```\n\nThe application will be available at:\n\n- Web: http://localhost:3000\n- API: http://localhost:3001\n- Database: localhost:5432\n\n### Production Deployment\n\n#### Docker Compose\n\n```bash\ndocker-compose -f docker-compose.prod.yml up -d\n```\n\n#### Kubernetes\n\nSee [Kubernetes Deployment Guide](docs/k8s.md) for detailed instructions.\n\n## Architecture\n\nThe application consists of three main components:\n\n1. **Web Frontend**: React application with Tailwind CSS\n2. **API Backend**: Express.js server with Prisma ORM\n3. **Database**: PostgreSQL for data persistence\n\nSee [Architecture Documentation](docs/architecture.md) for detailed diagrams and explanations.\n\n## Development\n\n### Available Scripts\n\n```bash\n# Install dependencies\npnpm install\n\n# Start development servers\npnpm dev\n\n# Build all packages and applications\npnpm build\n\n# Run tests\npnpm test\n\n# Lint code\npnpm lint\n\n# Type check\npnpm typecheck\n```\n\n### Database Management\n\n```bash\n# Generate Prisma client\npnpm --filter api prisma generate\n\n# Run database migrations\npnpm --filter api prisma migrate dev\n\n# Reset database\npnpm --filter api prisma migrate reset\n```\n\n## Testing\n\n```bash\n# Run all tests\npnpm test\n\n# Run tests for specific package\npnpm --filter @repo/api test\n```\n\n## Contributing\n\n1. Fork the repository\n2. Create your feature branch (`git checkout -b feature/amazing-feature`)\n3. Commit your changes (`git commit -m 'Add some amazing feature'`)\n4. Push to the branch (`git push origin feature/amazing-feature`)\n5. Open a Pull Request\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## Using this template\n\nRun the following command:\n\n```sh\ngit clone https://github.com/jellydn/monorepo-starter\n```\n\nor\n\n```sh\npnpm dlx create-turbo@latest -m pnpm -e https://github.com/jellydn/monorepo-starter YOUR_PROJECT\n```\n\n## What's inside?\n\nThis Turborepo includes the following:\n\n### Apps and Packages\n\n- `web`: a [Next.js](https://nextjs.org/) app\n- `api`: an [Express](https://expressjs.com/) server\n- `@repo/ui`: a React component library\n- `@repo/typescript-config`: tsconfig.json's used throughout the monorepo\n\nEach package/app is 100% [TypeScript](https://www.typescriptlang.org/).\n\n### Docker\n\nThis repo is configured to be built with Docker, and Docker compose. To build all apps in this repo:\n\n```sh\n# Install dependencies\npnpm install\n\n# Create a network, which allows containers to communicate\n# with each other, by using their container name as a hostname\ndocker network create app_network\n\n# Build prod using new BuildKit engine\nCOMPOSE_DOCKER_CLI_BUILD=1 DOCKER_BUILDKIT=1 docker-compose -f docker-compose.yml build\n\n# Start prod in detached mode\ndocker-compose -f docker-compose.yml up -d\n```\n\nOpen http://localhost:3000.\n\nTo shutdown all runnin containers:\n\n```sh\n# Stop all running containers\ndocker kill $(docker ps -q) \u0026\u0026 docker rm $(docker ps -a -q)\n```\n\n### GitHub Container Registry (GHCR)\n\nThis repo is configured to publish Docker images to GitHub Container Registry (GHCR). The images are automatically built and published when you push to the `main` branch or create a new tag.\n\n#### CI/CD Workflow\n\nThe GitHub Actions workflow builds and publishes Docker images in parallel for faster execution:\n\n- The web and API images are built simultaneously in separate jobs\n- Each build supports multi-architecture images\n- A summary job runs after all builds are complete to report the status\n\n#### Multi-Architecture Support\n\nThe Docker images are built for multiple architectures:\n\n- `linux/amd64` - For Intel/AMD processors (standard x86_64 architecture)\n- `linux/arm64` - For ARM processors (Apple Silicon M1/M2/M3, AWS Graviton, etc.)\n\nThis ensures that the images can run on various platforms without compatibility issues.\n\n#### Using GHCR Images Locally\n\nInstead of building Docker images locally, you can use the pre-built images from GHCR:\n\n1. Create a `.env` file based on the `.env.example` template:\n\n```sh\ncp .env.example .env\n```\n\n2. Edit the `.env` file with your GitHub username and repository name:\n\n```\nGHCR_USERNAME=your-github-username\nGHCR_REPO=monorepo-starter\nGHCR_REGISTRY=ghcr.io\nGHCR_TAG=latest\n```\n\n3. Log in to GitHub Container Registry:\n\n```sh\necho $GITHUB_TOKEN | docker login ghcr.io -u USERNAME --password-stdin\n```\n\n4. Start the containers using the pre-built images:\n\n```sh\ndocker-compose up -d\n```\n\n#### Helper Script\n\nFor convenience, a helper script is provided to simplify working with GHCR images:\n\n```sh\n./use-ghcr-images.sh\n```\n\nThis interactive script provides the following options:\n\n- Pull and use GHCR images with docker-compose\n- Pull and use GHCR images with Kubernetes\n- Check available tags for images\n- Login to GitHub Container Registry\n\nThe script will automatically create a `.env` file with default values if one doesn't exist.\n\n#### Available Tags\n\nThe following tags are available for the Docker images:\n\n- `latest`: The latest build from the `main` branch\n- `main`: The latest build from the `main` branch\n- `vX.Y.Z`: Specific version tags (e.g., `v1.0.0`)\n- `sha-XXXXXXX`: Specific commit SHA\n\n### Kubernetes Deployment\n\nThis repo includes Kubernetes manifests and scripts to deploy the application to any Kubernetes cluster, whether local, cloud-based, or on-premises.\n\n#### Kubernetes Templates\n\nThis repository offers two Kubernetes deployment templates:\n\n##### 1. Basic Template (For Beginners)\n\nIf you're new to Kubernetes, you can use the basic template available at [basic-k8s branch](https://github.com/jellydn/monorepo-starter/tree/basic-k8s). This template provides a simpler structure with all configuration in a single `k8s` directory.\n\n```sh\n# Clone the repository with the basic-k8s branch\ngit clone -b basic-k8s https://github.com/jellydn/monorepo-starter.git\ncd monorepo-starter\n\n# Set up a local Kubernetes cluster with kind\n./k8s/setup-local.sh\n\n# Deploy the application to the local cluster\n./k8s/deploy.sh\n```\n\n##### 2. Advanced Template (Main Branch)\n\nThe main branch uses a more sophisticated structure with Kustomize overlays for different environments. This approach is better suited for production deployments and multi-environment setups.\n\n#### Local Development with Kubernetes\n\nTo set up a local Kubernetes environment:\n\n```sh\n# Set up a local Kubernetes cluster with kind\n./kubernetes/scripts/setup-local.sh\n\n# Deploy the application to the local cluster\n./kubernetes/scripts/deploy-local.sh\n```\n\n#### Production Deployment with Cloudflare\n\nFor production deployment with Cloudflare as a proxy:\n\n```sh\n# Deploy with Cloudflare integration\nREGISTRY_URL=your-registry.example.com \\\nCONTEXT=your-production-context \\\nDOMAIN=next-app-demo.itman.fyi \\\nAPI_DOMAIN=express-api-demo.itman.fyi \\\n./kubernetes/scripts/deploy-production.sh\n```\n\nFor more details, see the [Kubernetes Documentation](./docs/kubernetes.md).\n\n### Remote Caching\n\n\u003e [!TIP]\n\u003e Vercel Remote Cache is free for all plans. Get started today at [vercel.com](https://vercel.com/signup?/signup?utm_source=remote-cache-sdk\u0026utm_campaign=free_remote_cache).\n\nThis example includes optional remote caching. In the Dockerfiles of the apps, uncomment the build arguments for `TURBO_TEAM` and `TURBO_TOKEN`. Then, pass these build arguments to your Docker build.\n\nYou can test this behavior using a command like:\n\n`docker build -f apps/web/Dockerfile . --build-arg TURBO_TEAM=\"your-team-name\" --build-arg TURBO_TOKEN=\"your-token\" --no-cache`\n\n### Utilities\n\nThis Turborepo has some additional tools already setup for you:\n\n- [TypeScript](https://www.typescriptlang.org/) for static type checking\n- [Biome](https://biomejs.dev) for format, lint, and more in a fraction of a second.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjellydn%2Fmonorepo-starter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjellydn%2Fmonorepo-starter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjellydn%2Fmonorepo-starter/lists"}