Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ibbus93/koa-typescript-boilerplate
Koa Typescript Boilerplate
https://github.com/ibbus93/koa-typescript-boilerplate
jest joi koa koa-bodyparser koa-boilerplate koa-json koa-router koa-typescript koa-typescript-boilerplate nvm
Last synced: 14 days ago
JSON representation
Koa Typescript Boilerplate
- Host: GitHub
- URL: https://github.com/ibbus93/koa-typescript-boilerplate
- Owner: Ibbus93
- Created: 2023-08-21T14:37:31.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2023-09-25T11:08:01.000Z (over 1 year ago)
- Last Synced: 2025-01-26T15:47:53.099Z (14 days ago)
- Topics: jest, joi, koa, koa-bodyparser, koa-boilerplate, koa-json, koa-router, koa-typescript, koa-typescript-boilerplate, nvm
- Language: TypeScript
- Homepage:
- Size: 444 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# KOA Typescript Boilerplate
## Description and Motivations
This project is intended to be a personal boilerplate, but also built for the community. It will help in further personal projects, having a good fork-able project.
As you will see, there is an example CRUD controller, but no ORM DB library is installed. This is because the project is intended to be the most flexible, allowing the dev to use the
service as it may like the most.## Technologies
The boilerplate contains the following technologies:
- [NVM](https://github.com/nvm-sh/nvm)
- [Typescript](https://www.typescriptlang.org/)
- [Koa](https://github.com/koajs/koa)
- [Jest](https://jestjs.io/)
- [Joi](https://joi.dev/)
- [Prettier](https://prettier.io/)
- [Eslint](https://eslint.org/)## Project structure
The structure allows the developer to split the code following the single-responsibility principle, so it contains folders for:
- `constants`: the constants that can be created inside the project
- `controllers`: folder for the various service controllers;
- `errors`: list of errors of the application;
- `mocks`: mocks that will be useful mainly for testing;
- `routes`: list of routes files;
- `tests`: this is the test folder and all the test files placed here will be run by Jest;
- `types`: folder for the types declaration in the project;
- `validators`: this folder contains validators written in Joi and fungible as middleware.## Development commands
If you use [nvm](https://github.com/nvm-sh/nvm), in order to use the right node version run:
```bash
nvm use
```After this, install the dependencies with:
```bash
npm i
```### Run the server
To run the server, just execute:
```bash
npm start
```### Development server
To run the server in listening mode, run:
```bash
npm run dev
```### Test the application
To run the test suite, just run:
```bash
npm test
```### Build the application
To build the service, that will produce a `/build` folder as output, run:
```bash
npm build
```