Skip to content

A modern, high-performance, and lightweight dummy API built with Hono, Drizzle ORM, and Bun. Designed to be the perfect starting point for scalable TypeScript microservices.

License

Notifications You must be signed in to change notification settings

awaiden/kekik-api

Repository files navigation

🌿 Kekik API

A modern, high-performance, and lightweight REST API built with Hono, Drizzle ORM, and Bun. Designed as a perfect starting point for scalable TypeScript applications.

License Bun Docker PostgreSQL TypeScript

Features

  • Blazing Fast: Powered by Bun and Hono framework
  • Type-Safe: 100% TypeScript with Drizzle ORM
  • Modern Database: PostgreSQL with UUIDs and relational integrity
  • Containerized: Docker & Docker Compose ready
  • Production Ready: CI/CD with GitHub Actions and automated deployments

🛠️ Tech Stack

Component Technology
Runtime Bun
Framework Hono
ORM Drizzle
Database PostgreSQL
Language TypeScript
Container Docker & Docker Compose

Quick Start

Prerequisites

  • Bun installed
  • Docker & Docker Compose (optional)

Installation

  1. Clone the repository

    git clone https://github.com/awaiden/kekik-api.git
    cd kekik-api
  2. Install dependencies

    bun install
  3. Set up environment variables

    cp .env.example .env

    Create a .env file with:

    DB_USER=postgres
    DB_PASSWORD=your_secure_password
    DB_NAME=kekik_db
    DB_HOST=localhost
    DB_PORT=5432
    
    DATABASE_URL=postgresql://${DB_USER}:${DB_PASSWORD}@${DB_HOST}:${DB_PORT}/${DB_NAME}
  4. Start PostgreSQL (Docker)

    docker-compose up -d
  5. Run migrations

    bun db:push
    bun db:seed
  6. Start development server

    bun dev

The API will be available at http://localhost:3000


API Routes

Method Endpoint Description
GET / Health check
GET /users Get all users
GET /users/:id Get user by ID
GET /posts Get all posts
GET /posts/:id Get post by ID
GET /comments Get all comments
GET /comments/:id Get comment by ID

Project Structure

src/
├── index.ts           # Application entry point & routes
└── db/
    ├── index.ts       # Database connection
    └── schema.ts      # Drizzle ORM schema definitions

scripts/
└── seed.ts            # Database seeding script

deploy/
└── docker-compose.yml # Production deployment config

Available Scripts

# Development
bun dev              # Start dev server with hot reload

# Database
bun db:push          # Apply schema changes
bun db:studio        # Open Drizzle Studio UI
bun db:seed          # Seed database with sample data

# Production
bun build            # Build for production
bun start            # Run production build

# Docker
docker-compose up -d          # Start PostgreSQL
docker-compose down           # Stop PostgreSQL

Docker Deployment

Run with Docker Compose

docker-compose up -d

Pull Pre-built Image

docker pull ghcr.io/awaiden/kekik-api:latest
docker run -p 3000:3000 --env-file .env ghcr.io/awaiden/kekik-api:latest

License

This project is licensed under the MIT License. See LICENSE file for details.


Contributing

Contributions are welcome! Feel free to open issues and submit pull requests.


Contact

For questions or support, please reach out via GitHub issues.

About

A modern, high-performance, and lightweight dummy API built with Hono, Drizzle ORM, and Bun. Designed to be the perfect starting point for scalable TypeScript microservices.

Resources

License

Stars

Watchers

Forks

Packages