A starter kit for building Koa.JS based restful api
Fully featured Koa.JS restful api starter application. The goal of this project is to solve all routine tasks and keep your focus on the product and business logic of the application, not on the common things, such logging, configuration, dev/production environments
Out of the box support following features:
Fill data from google in src/config/environment/index.js
google: {
clientId: 'clientId',
clientSecret: 'clientSecret',
redirectUri: 'redirectUri',
}
In order to start server in the docker container you can use bash file ./bin/start.sh
:
$ ./bin/start.sh
To start the project not in the docker container just run: npm run dev
. This command will start the application on port 3001
and will automatically restart whenever you change any file in ./src
directory.
We try to keep things as simple as possible, so you can focus on building product instead of learning concepts.
There are three main directories within project:
src/config - consist of configuration for the environment, koa server and API routes.
src/config/routes - consist of public (don't require access token) and authenticated (require access token) routes and middlewares.
src/resources - REST api resources and everything related to the resource:
src/services - application services for various purposes. Not this directory contains the following services:
All other files, that does not fit that structure should be placed straight in the src
folder. We can always introduce more folders as we need them. Currently root folder consist following: