An open API service indexing awesome lists of open source software.

https://github.com/nokodo-labs/monorepo-template

Modern full-stack boilerplate: FastAPI + Svelte 5. Production-ready with multi-stage builds.
https://github.com/nokodo-labs/monorepo-template

docker fastapi fullstack github-actions monorepo nginx postgresql production-ready pydantic python ruff sqlalchemy svelte sveltekit tailwindcss template typescript vite

Last synced: 5 months ago
JSON representation

Modern full-stack boilerplate: FastAPI + Svelte 5. Production-ready with multi-stage builds.

Awesome Lists containing this project

README

          

nokodo logo

---

Monorepo Template

**Modern & production-ready full-stack template that saves you weeks of setup: FastAPI backend + Svelte 5 frontend with containerization, full CI/CD, VS Code support, and AI integrations.**

[![License](https://img.shields.io/github/license/nokodo-labs/monorepo-template)](LICENSE)
[![Stars](https://img.shields.io/github/stars/nokodo-labs/monorepo-template?style=social)](https://github.com/nokodo-labs/monorepo-template/stargazers)
[![Issues](https://img.shields.io/github/issues/nokodo-labs/monorepo-template)](https://github.com/nokodo-labs/monorepo-template/issues)
[![Pull Requests](https://img.shields.io/github/issues-pr/nokodo-labs/monorepo-template)](https://github.com/nokodo-labs/monorepo-template/pulls)
[![Python](https://img.shields.io/badge/python-3.13+-blue.svg)](https://www.python.org/downloads/)
[![Node](https://img.shields.io/badge/node-24+-green.svg)](https://nodejs.org/)

## ๐Ÿ› ๏ธ Stack

- **Backend**: FastAPI (Python 3.13+), SQLAlchemy 2.0+, Pydantic, PostgreSQL 17, Alembic, uv
- **Frontend**: Svelte 5, Vite 6, Tailwind 4, TypeScript, native fetch (zero HTTP deps)
- **Type Safety**: OpenAPI TypeScript generator (auto-sync backend โ†’ frontend types)
- **Dev**: VS Code (tasks, debugger, extensions), Ruff, pytest, AI instructions
- **Deploy**: Docker Compose with production configs

## โœจ Features

- โšก **Opinionated by design**: Deliberate choices, cohesive stack, no decision fatigue
- ๐Ÿ—๏ธ **Production infrastructure**: PostgreSQL 17, multi-stage Docker builds, Nginx configs
- ๐Ÿ”’ **End-to-end type safety**: Python type hints โ†’ OpenAPI โ†’ auto-generated TypeScript types
- ๐Ÿค– **Full CI/CD pipeline**: Automated testing, Docker builds, GHCR publishing, releases
- ๐Ÿงช **Complete test setup**: pytest (backend) + Vitest (frontend) with fixtures and full coverage
- ๐Ÿ“ **Modern code standards**: EditorConfig, Ruff, ESLint, Prettier pre-configured
- ๐Ÿ’พ **Persistent data storage**: Volume-mounted data directory
- ๐Ÿ› ๏ธ **VS Code integration**: Tasks, debugger configs, recommended extensions
- ๐Ÿค– **AI agents ready**: Premade instructions & prompts with extensible patterns
- ๐ŸŽฏ **Minimal boilerplate**: No business logic, just a working foundation
- ๐Ÿ”ฎ **Future-proof stack**: Latest stable versions of everything, zero tech debt from day one

## ๐Ÿš€ Quick Start

### 1๏ธโƒฃ Create Your Repository

- Click **"Use this template"** on GitHub โ†’ Create your repo
- Clone your new repository locally

### 2๏ธโƒฃ Customize Project

Rename `backend/project_slug/` to your project name and update references. See [docs/setup.md](docs/setup.md#initial-customization-required) for detailed instructions.

### 3๏ธโƒฃ Start Development

```bash
cd .docker
docker compose up -d
```

**Your services:**

- Frontend: http://localhost
- Backend API: http://localhost:8000
- API Docs: http://localhost:8000/v1/docs

> ๐Ÿ’ก **VS Code users**: Open the workspace to get tasks, debugger configs, and recommended extensions automatically.

### 4๏ธโƒฃ Deploy to Production

CI/CD automatically builds and pushes Docker images to **GitHub Container Registry (GHCR)** on every commit. Images are tagged as:

- `ghcr.io/your-org/your-repo:latest` โ†’ production branch
- `ghcr.io/your-org/your-repo:dev` โ†’ dev branch
- `ghcr.io/your-org/your-repo:v1.2.3` โ†’ releases

**Deploy with Docker:**

```bash
# Pull pre-built images and deploy
docker compose pull
docker compose up -d
```

> ๐Ÿ’ก **Tip**: See [docs/setup.md](docs/setup.md#production-deployment) for full deployment instructions and environment configuration.

## ๐Ÿ“ Structure

```
backend/
โ”œโ”€โ”€ api/ # FastAPI application
โ”‚ โ”œโ”€โ”€ api/v1/endpoints/ # Route handlers
โ”‚ โ”œโ”€โ”€ core/ # Config, database
โ”‚ โ”œโ”€โ”€ models/ # SQLAlchemy ORM
โ”‚ โ”œโ”€โ”€ schemas/ # Pydantic validation
โ”‚ โ”œโ”€โ”€ tests/ # API & ORM tests
โ”‚ โ””โ”€โ”€ alembic/ # Database migrations
โ”œโ”€โ”€ project_slug/ # SDK/service layer (rename me!)
โ”‚ โ””โ”€โ”€ tests/ # SDK unit tests (optional)
โ”œโ”€โ”€ tests/ # E2E integration tests
โ””โ”€โ”€ data/ # Data storage (volume mounted)

frontend/
โ”œโ”€โ”€ src/
โ”‚ โ”œโ”€โ”€ lib/ # Components
โ”‚ โ””โ”€โ”€ main.ts # Entry point
โ””โ”€โ”€ nginx.conf # Production server

.docker/ # Docker configs
โ”œโ”€โ”€ Dockerfile.backend # Backend build
โ”œโ”€โ”€ Dockerfile.frontend # Frontend build
โ”œโ”€โ”€ docker-compose.yml # Production
โ””โ”€โ”€ docker-compose.dev.yml # Development

.github/ # CI/CD, Dependabot, CODEOWNERS
.vscode/ # Editor config, tasks, debugger
tools/release_please/ # Release automation config
```

### ๐Ÿ—๏ธ Architecture

**Backend:**

- **`api/`**: FastAPI app, routes, ORM, database setup
- **`project_slug/`**: Business logic SDK that can be packaged separately for pip/uv/PyPI distribution
- **Testing**: 3 tiers (API tests in `api/tests/`, SDK tests in `project_slug/tests/`, E2E in `tests/`)
- **URLs**: `/v1/users` (no `/api` prefix - deploy on `api.yourdomain.com`)

**Frontend:**

- **Native fetch** - Zero HTTP library dependencies, uses web standards
- **OpenAPI types** - Auto-generated TypeScript types from FastAPI schema
- **Type safety** - Backend changes = compile errors in frontend if incompatible

## ๐Ÿ“„ License

BSD 3-Clause - See [LICENSE](LICENSE) for details.