Coder Social home page Coder Social logo

webeetle / cherry Goto Github PK

View Code? Open in Web Editor NEW
6.0 7.0 1.0 216 KB

Simple scaffolding for Node REST microservice

Shell 0.80% TypeScript 92.47% Dockerfile 2.59% JavaScript 4.14%
backend-server fastify hexagonal-architecture microservice node nodejs rest typescript

cherry's Introduction

Cherry ๐Ÿ’

This project was born to be a scaffold for a new Node REST microservice. It is a simple project that uses the following technologies / tools / architectures:

  • Hexagonal Architecture Ready ๐Ÿ›
  • Typescript ๐Ÿ”’
  • Fastify โฉ
  • OpenAPI docs ready ๐Ÿ“–
  • JsonRPC server/client ready ๐Ÿ“ฆ
  • SQLite3 with Knex ๐Ÿ”ง
  • Tap for tests ๐Ÿงช

How to install

  • Clone this repository
  • Run npm install for install all dependencies
  • Run npm run db:init for create the database
  • Run npm run start:dev for start the server in development mode
  • Have fun ๐ŸŽ‰

Commands available

  • Run npm run start:dev to start the server in development mode
  • Run npm run start to start the project in production mode
  • Run npm run test to run the tests
  • Run npm run build:${env} to build the project
  • Run npm run db:init to reset or create the database
  • Run npm run db:migrate:latest to run the latest migrations
  • Run npm run db:migrate:reset to rollback all the migrations

env:

  • development
  • staging
  • production

Using Fastify

Fastify is a web framework highly focused on providing the best developer experience with the least overhead and a powerful plugin architecture. It is inspired by Hapi and Express and as far as we know, it is one of the fastest web frameworks in town. Check out the Fastify documentation.

Using Knex

Knex is a SQL query builder that can be used to build queries for different databases. It is used in this project to build queries for SQLite3, but it can be used for other SQL databases as well. To learn more about Knex, check out the Knex documentation.

Migration

To folders migrations and seeds are used to create the database and populate it with data. See the Knex documentation for more information.

Using Tap

Tap is a test framework for Node.js. It is used in this project to run the tests. To learn more about Tap, check out the Tap documentation.

Docker

Build docker image

env:

  • development
  • staging
  • production

`docker build --build-arg env=${env} -t cherry:latest -f Docker/Dockerfile .'

cherry's People

Contributors

dependabot[bot] avatar mainick avatar paranoiasystem avatar riktar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

paranoiasystem

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.