Skip to content
My personal Koa2 API startup kit, feel free to use and contribute if you like
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Koa API Startup Kit

My personal Koa2 API startup kit, feel free to use and contribute if you like.


Setup Development Environment

Create Config Files

Create an .env file based on the .env.example

  cp .env.example .env

Check and replace the environment variables in the new file.

Initialize Database

Here you can either choose to have and instance of Postgres installed locally in your machine or use a docker container.

Simple example of using Postgres through Docker:

  docker run -it -p 5432:5432 -e POSTGRES_USER='root' -e POSTGRES_PASSWORD='password' -e POSTGRES_DB='db_koa' postgres:10

Keep in mind that sample above don't generate a volume, so it wont persist the data after you stop your docker container.

Install dependencies

  yarn install

Migrate database

  yarn migrate

Starting App

  yarn dev

The server will be available in the port you set in the .env file


# Unit
yarn test

# Integration
yarn test:i

# Acceptance
yarn test:a

# All (Sequential)
yarn test:all

You need a database running with all migrations for the integration and acceptance tests


  • Docker compose infrastructure
  • CI/CD Jenkinks
  • Production environment



You can’t perform that action at this time.