Skip to content

BenjaminRiderelli/cleanapipractice

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CLEAN api

This is a small api template I made following the interpretation I can currently give to a Clean architecture.

I splited into different middleware and helper functions some of the standard functionalities of a REST api so its easier to switch or add new technologies without compromising everything in the way.

Get it going

npm install and .env as follows is enough to get the rest api going and connected to your mongoDB.

  • MONGO_URL=
  • HOST_URL=
  • JWT_ISSUER=
  • JWT_SECRET=

Features

Rest api's are one of the most common backend applications, with this template you can:

  • Register users and authenticate them (jwt)
  • Add jwtMiddleware to a route to make it private
  • Add centralized Error handling in a middleware with user identification for protected routes
  • Use tryCatch utility function for effortless error handling.
  • invoke all basic CRUD operations on the models that you create by using the functions in the services folder and receive meaningfull errors if something happens.

About

Small project to practice error handling and clean file architecture

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published