Giter Club home page Giter Club logo

express-apirest's Introduction

express-apirest

Hello and welcome to yet another express-backend/apirest that i've made.

I promise, this one will be the last, and the best of all 3 versions, mainly because I'm not using TS nor Docker, this is but just a simple express apirest, with JWT and Sequelize.

Its very easy to use as a template, and its extremely customizable.

So, what does this apirest contains?

  • jsonwebtoken: for session management.
  • Sequelize: ORM for database connection and transactions.
  • dotenv: for environment variables ( configuration ).
  • express-boom: for error response standardization.
  • morgan: for console ( or to file ) logging.
  • cors: for easy enabling cors.

Folder and files you should check:

  • ./utils/: A folder with utils to develop faster and better.

    • .env: File that holds a simulation of environment variables. ( you should pass your config values through env variables when deploying, its good practice!).
    • requests.http: File used by the REST Client vscode extension, used to do requests to our api, similar to Postman but far lighter, and simpler.
  • ./helpers/: A folder containing tiny modules that will help us.

    • session.js: A file containing all JSON web token logic, and also a middleware using in server.js that verifies the token for each url-path, and also refreshes it.
  • ./config/: folder holding our configuration files.

    • general.js: General configuration used through all the application. Grabs all configuration values from .env, and if they are not defined, it gives default values.
    • database.js: Database configuration.
  • ./models/: A folder containing database table models.

    • modelsManager.js: A file used to manage models, such as creating/altering tables, or even associating them.
  • ./routers/: A folder containing all routers of each controller.

    • masterRouter: A file encapsulating all routers, from each router file.
  • ./controllers/: A folder containing all express endpoints, and business logic.

  • ./server.js: You should at least open this file once if you're going to use this :p .

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.