All Projects → pinceladasdaweb → docker-fastify-restful-api

pinceladasdaweb / docker-fastify-restful-api

Licence: MIT License
Node.js RESTful API boilerplate using Traefik, Docker, Docker Compose, Fastify, JWT and Mongodb

Programming Languages

javascript
184084 projects - #8 most used programming language
Dockerfile
14818 projects
Makefile
30231 projects
shell
77523 projects

Projects that are alternatives of or similar to docker-fastify-restful-api

generator-mitosis
A micro-service infrastructure generator based on Yeoman/Chatbot, Kubernetes/Docker Swarm, Traefik, Ansible, Jenkins, Spark, Hadoop, Kafka, etc.
Stars: ✭ 78 (+95%)
Mutual labels:  sonarqube, traefik
Android-CICD
This repo demonstrates how to work on CI/CD for Mobile Apps 📱 using Github Actions 💊 + Firebase Distribution 🎉
Stars: ✭ 37 (-7.5%)
Mutual labels:  sonarqube
fastify-kafka
Fastify plugin to interact with Apache Kafka.
Stars: ✭ 37 (-7.5%)
Mutual labels:  fastify
sonar-jdepend-plugin
Sonar plugin for jDepend
Stars: ✭ 22 (-45%)
Mutual labels:  sonarqube
sonar-issueresolver-plugin
Export and import resolved issues
Stars: ✭ 12 (-70%)
Mutual labels:  sonarqube
JAlgoArena
JAlgoArena programming contest platform
Stars: ✭ 32 (-20%)
Mutual labels:  traefik
docker-qbittorrent
qBittorrent Docker image based on Alpine Linux
Stars: ✭ 42 (+5%)
Mutual labels:  traefik
pirate
🏴‍☠️ A personal platform for R programming
Stars: ✭ 36 (-10%)
Mutual labels:  traefik
tyrion
No description or website provided.
Stars: ✭ 83 (+107.5%)
Mutual labels:  sonarqube
framework
The target of this framework is to help in all the needs of a full featured API REST, from top to bottom, and at the same time having the best possible performance and security.
Stars: ✭ 88 (+120%)
Mutual labels:  fastify
sonar-fsharp-plugin
F# SonarQube (TM) plugin - support for F#
Stars: ✭ 46 (+15%)
Mutual labels:  sonarqube
kubernetes-kitchen
Learning Kubernetes
Stars: ✭ 27 (-32.5%)
Mutual labels:  traefik
traefik-library-image
store.docker.com/images/traefik
Stars: ✭ 36 (-10%)
Mutual labels:  traefik
sonar-gherkin-plugin
SonarQube Cucumber Gherkin Analyzer
Stars: ✭ 33 (-17.5%)
Mutual labels:  sonarqube
hc-pdf-server
Convert HTML to PDF Server by headless chrome with TypeScript. The new version of hcep-pdf-server.
Stars: ✭ 24 (-40%)
Mutual labels:  fastify
plex-traefik
Plex media server with traefik 2 in docker and docker-compose
Stars: ✭ 30 (-25%)
Mutual labels:  traefik
fastify-response-validation
A simple plugin that enables response validation for Fastify.
Stars: ✭ 20 (-50%)
Mutual labels:  fastify
fastify-openapi-glue
A plugin for Fastify to autogenerate a configuration based on a OpenApi(v2/v3) specification.
Stars: ✭ 94 (+135%)
Mutual labels:  fastify
Saltbox
Ansible-based solution for rapidly deploying a Docker containerized cloud media server.
Stars: ✭ 117 (+192.5%)
Mutual labels:  traefik
sonar-openedge
CABL (Code Analyzer for ABL in SonarQube)
Stars: ✭ 57 (+42.5%)
Mutual labels:  sonarqube

Docker Fastify RESTful API

Node.js RESTful API boilerplate using Traefik, Docker, Docker Compose, Fastify, JWT and Mongodb.

Requirements

  1. Node.js >= 14
  2. Docker
  3. Docker compose

Getting started

Install packages using docker:

docker run --rm -it \
-v ${PWD}:/usr/src/app \
-w /usr/src/app \
node:16-alpine npm i

Windows users should switch the PWD variable to your current directory. Alternatively, you can run npm install as follows:

docker-compose run --rm api npm install

Or if you have node installed in your system, install using npm:

npm install

Configuration

  1. Rename the .env.example file to .env and fill variables. The Postgres variables are required for Sonarqube. The SENTRY_DSN variable is not obligatory.

  2. Edit your hosts file with:

127.0.0.1 fastify.localhost

127.0.0.1 sonarqube.localhost

Run

In the root of project, run:

docker-compose up

API Request

Endpoint HTTP Method Description
/api/v1 GET Healthcheck
/api/v1/users/register POST Adds a new user
/api/v1/users/auth POST Authenticate user
/api/v1/movies GET List all movies
/api/v1/movies/:id GET Get movie
/api/v1/movies POST Adds a new movie
/api/v1/movies/:id PATCH Update a movie
/api/v1/movies/:id DELETE Delete a movie

Test API locally using curl

  • Healthcheck

Request

curl -i --request GET 'http://fastify.localhost/api/v1'

Response

{
  "message": "Fastify API is on fire"
}

Insominia Collection

I exported Insomnia collection/data for so you can test all the endpoints.

Sonarqube dashboard

To access Sonarqube dashboard, simple access in your browser:

http://sonarqube.localhost

Follow the guide to learn more about the settings and how to run Sonar code analysis.

Traefik dashboard

To access Traefik dashboard, simple access in your browser:

http://localhost:8080

Happy coding!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].