https://github.com/rafaumeu/pocket-api
๐ InOrbit is a high-performance backend built with TypeScript โก, Fastify ๐, and PostgreSQL ๐. It features Drizzle ORM ๐พ, JWT authentication ๐, and Docker ๐ณ integration, ensuring seamless deployment and scalability. The platform offers efficient data management ๐, authentication ๐ก๏ธ, and goal tracking ๐ฏ for an enhanced user experience!
https://github.com/rafaumeu/pocket-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: 3 months ago
JSON representation
๐ InOrbit is a high-performance backend built with TypeScript โก, Fastify ๐, and PostgreSQL ๐. It features Drizzle ORM ๐พ, JWT authentication ๐, and Docker ๐ณ integration, ensuring seamless deployment and scalability. The platform offers efficient data management ๐, authentication ๐ก๏ธ, and goal tracking ๐ฏ for an enhanced user experience!
- Host: GitHub
- URL: https://github.com/rafaumeu/pocket-api
- Owner: rafaumeu
- Created: 2025-01-15T23:26:11.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2025-01-23T00:33:45.000Z (5 months ago)
- Last Synced: 2025-01-23T01:23:26.522Z (5 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: 267 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# InOrbit
A modern TypeScript backend application powered by Fastify and PostgreSQL.
[](https://www.typescriptlang.org/)
[](https://www.fastify.io/)
[](https://www.postgresql.org/)
[](https://orm.drizzle.team/)---
## ๐ Table of Contents
| [โก Tech Stack](#โก-tech-stack) | [๐ Development Tools](#๐ -development-tools) | [๐ Features](#๐-features) |
|--------------------------------|-----------------------------------------------|----------------------------|
| [๐ฆ Prerequisites](#๐ฆ-prerequisites) | [๐ ๏ธ Setup](#๐ ๏ธ-setup) | [๐ฏ API Endpoints](#๐ฏ-api-endpoints) |
| [๐๏ธ Project Structure](#๐๏ธ-project-structure) | [๐งช Running Tests](#๐งช-running-tests) | [๐ API Documentation](#๐-api-documentation) |
| [๐ก๏ธ License](#๐ก๏ธ-license) | [๐ค Contributing](#๐ค-contributing) | [๐ง Environment Variables](#๐ง-environment-variables) |---
### โก Tech Stack




---
### ๐ Development Tools




---
## ๐ Features
- **Modern TypeScript**: Built with the latest TypeScript features for type-safe development
- **High Performance**: Powered by Fastify, one of the fastest web frameworks for Node.js
- **Database Integration**: PostgreSQL with Drizzle ORM for efficient data management
- **Docker Ready**: Containerized setup for consistent development and deployment
- **Developer Experience**: Configured with Biome for linting and formatting
- **ID Generation**: Utilizes CUID2 for unique identifier generation
- **Date Handling**: Efficient date manipulation with Day.js
- **Database Seeding**: Built-in seeding functionality for development and testing
- **Schema Validation**: Request/Response validation with Zod and JSON Schema generation
- **Goals Management**: Complete system for creating and tracking goals with completion status
- **CORS Support**: Enabled with `@fastify/cors` for cross-origin requests
- **Pending Goals and Summaries**: Retrieve and summarize goals for the current week---
## ๐ฆ Prerequisites
- Node.js (Latest LTS version)
- Docker and Docker Compose
- Yarn package manager---
## ๐ ๏ธ Setup
> ๐จ **Important:** Ensure Docker is running before proceeding.
1. Clone the repository:
```bash
git clone https://github.com/rafaumeu/pocket-api.git
cd pocket-api
```2. Install dependencies:
```bash
yarn install
```3. Start the PostgreSQL database using Docker:
```bash
docker-compose up -d
```4. Set up your environment variables:
```bash
cp .env.example .env
```5. Run database migrations:
```bash
yarn migration:run
```6. Seed the database (optional):
```bash
yarn seed
```7. Start the development server:
```bash
yarn dev
```---
## ๐ฏ API Endpoints
### Goals
- `POST /goals` - Create a new goal
- `GET /pending-goals` - Retrieve pending goals for the current week
- `POST /completions` - Mark a goal as completed
- `GET /week-summary` - Get a summary of the current week---
## ๐๏ธ Project Structure
```
inorbit/
โโโ assets/ # Project-related assets
โโโ src/
โ โโโ db/ # Database configuration and schemas
โ โ โโโ index.ts # Database initialization
โ โ โโโ schema.ts # Database schema definitions
โ โ โโโ seed.ts # Database seeding functionality
โ โโโ functions/ # Business logic
โ โ โโโ create-goal.ts
โ โ โโโ get-week-pending-goals.ts
โ โ โโโ create-goal-completion.ts
โ โ โโโ get-week-summary.ts
โ โโโ http/ # HTTP server and route handlers
โ โ โโโ routes/ # Separate route handlers
โ โโโ env.ts # Environment variable configuration
โโโ .migrations/ # Database migration files
โโโ drizzle.config.ts # Drizzle ORM configuration
โโโ biome.json # Biome linting and formatting config
โโโ docker-compose.yml
```---
## ๐งช Running Tests
```bash
yarn test
```---
## ๐ API Documentation
API documentation is available at `http://localhost:3000/docs` when running the development server. The documentation includes request/response schemas generated from Zod definitions.
---
## ๐ก๏ธ License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
---
## ๐ค Contributing
1. Fork the Project
2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)
3. Commit your Changes (`git commit -m 'feat: add some amazing feature'`)
4. Push to the Branch (`git push origin feature/AmazingFeature`)
5. Open a Pull Request---
## ๐ง Environment Variables
```env
DATABASE_URL=postgresql://user:password@localhost:5432/inorbit
PORT=3000
```---
Made with โค๏ธ by Rafael Dias Zendron![]()
### Built with ๐ by Rafael Zendron
[](https://www.linkedin.com/in/rafael-dias-zendron-528290132/)
[](https://github.com/rafaumeu)