https://github.com/rafaumeu/inorbit-api
🚀 InOrbit REST API — Fastify + Drizzle ORM + PostgreSQL + JWT auth + Docker + Swagger. Clean Architecture & comprehensive testing.
https://github.com/rafaumeu/inorbit-api
api-docs backend biomejs ci-cd cuid database-migrations docker drizzle fastify gamification high-performance jwt-authentication nodejs orm postgresql rest-api swagger test-coverage typescript zod
Last synced: about 4 hours ago
JSON representation
🚀 InOrbit REST API — Fastify + Drizzle ORM + PostgreSQL + JWT auth + Docker + Swagger. Clean Architecture & comprehensive testing.
- Host: GitHub
- URL: https://github.com/rafaumeu/inorbit-api
- Owner: rafaumeu
- Created: 2025-01-15T23:26:11.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2026-05-05T00:06:11.000Z (2 months ago)
- Last Synced: 2026-05-05T00:27:18.021Z (2 months ago)
- Topics: api-docs, backend, biomejs, ci-cd, cuid, database-migrations, docker, drizzle, fastify, gamification, high-performance, jwt-authentication, nodejs, orm, postgresql, rest-api, swagger, test-coverage, typescript, zod
- Language: TypeScript
- Homepage:
- Size: 277 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Overview
A high-performance REST API for weekly goal tracking built with **Fastify** and **Drizzle ORM**. Create goals, track completions, and get weekly summaries with an optimized PostgreSQL backend.
## Features
- Create weekly goals with desired frequency
- Mark daily goal completions
- Get pending goals for the current week
- Weekly completion summary with visual progress
- Swagger/OpenAPI documentation
- Dockerized development environment
## Tech Stack
| Technology | Version | Purpose |
|---|---|---|
| **Fastify** | 5.x | High-performance HTTP framework |
| **Drizzle ORM** | 0.38.x | Type-safe SQL query builder |
| **PostgreSQL** | 16.x | Relational database |
| **Zod** | 3.x | Schema validation with type inference |
| **TypeScript** | 5.x | End-to-end type safety |
| **Docker** | — | Containerized development |
## API Endpoints
| Method | Route | Description |
|---|---|---|
| `POST` | `/goals` | Create a new weekly goal |
| `POST` | `/completions` | Mark a goal as completed |
| `GET` | `/pending-goals` | Get pending goals for current week |
| `GET` | `/summary` | Get weekly completion summary |
## API Documentation
Interactive Swagger UI available at `/docs` when running the server.

### Endpoints
| Method | Route | Description |
|---|---|---|
| `POST` | `/goals` | Create a new weekly goal |
| `POST` | `/completions` | Mark a goal as completed |
| `GET` | `/pending-goals` | Get pending goals for current week |
| `GET` | `/summary` | Get weekly completion summary |
| `GET` | `/stats` | Get goal statistics |
### Generate Typed Client
```bash
npx orval # generates typed API client from OpenAPI spec
```
## Getting Started
```bash
# Clone
git clone https://github.com/rafaumeu/inorbit-api.git
cd inorbit-api
# Install
npm install
# Set up environment
cp .env.example .env
# Run with Docker (PostgreSQL)
docker compose up -d
# Start dev server
npm run dev
```
### Environment Variables
```env
DATABASE_URL=postgresql://docker:docker@localhost:5432/inorbit
```
## Database Schema
```
goals
├── id (UUID, PK)
├── title (VARCHAR)
├── desiredWeeklyFrequency (INTEGER)
└── createdAt (TIMESTAMP)
goalCompletions
├── id (UUID, PK)
├── goalId (UUID, FK → goals)
└── createdAt (TIMESTAMP)
```
## Project Structure
```
src/
├── db/
│ ├── connection.ts
│ ├── schema/
│ └── migrations/
├── http/
│ ├── routes/
│ └── server.ts
└── env.ts
```
## License
MIT