Skip to content
Public template

About

πŸš€ InOrbit REST API β€” Fastify + Drizzle ORM + PostgreSQL + JWT auth + Docker + Swagger. Clean Architecture & comprehensive testing.

Topics

Resources

Security policy

Stars

1 star

Watchers

1 watching

Forks

Repository files navigation

Node Fastify TypeScript Drizzle ORM PostgreSQL Vitest Docker Swagger Biome

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.

Swagger UI

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

npx orval  # generates typed API client from OpenAPI spec

Getting Started

# 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

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


Built with ❀️ by Rafael Zendron

Use this template

About

πŸš€ InOrbit REST API β€” Fastify + Drizzle ORM + PostgreSQL + JWT auth + Docker + Swagger. Clean Architecture & comprehensive testing.

Topics

Resources

Security policy

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages