Code Monkey home page Code Monkey logo

4all-locadora's Introduction

4all-locadora

Api REST for 4all-locadora app

Build Setup

# install dependencies
$ npm install

# compose container with postgres
$ docker-compose up -d

# migrate database
$ node_modules/.bin/sequelize db:migrate
# or with sequelize-cli
$ npx sequelize-cli db:migrate

# seed database
$ node_modules/.bin/sequelize db:seed:all
# or with with sequelize-cli
$ npx sequelize-cli db:seed:all

# serve with hot reload at localhost:4000
$ npm run dev

# launch server
$ npm start

# test application
$ npm run test

# API DOCS: http://localhost:4000/api-docs

Instructions

After runing the project in dev mode, you can access the documentation with every route specification at

If you seeded the database as described above, you can use theese default sample users to authenticate

You should provide the authorization token in the request header when accessing a restricted endpoint, it must be in the following format

  • Authorization: Bearer < token >

If you need to change any database configuration params, you can do it at

  • ./config
    • config.json

If you are using the docker container setted up from docker-compose.yaml file, the default pgAdmin4 credentals are

  • email: admin@admin
  • password: admin

and postgres default password:

  • password: adminadmin

What was used here

Project bootstrapping

  • config - contains config file, which tells CLI how to connect with database
  • models - contains all models and data structure
  • migrations - contains all database migration files
  • seeders - contains all seed files,
  • tests - contains all tests code,
  • services - contains all services and business logic
  • controllers - contains all controllers that links routes with services
  • middlewares - contains all middlewares, like jwt validation for authenticated users
  • routes - contains all declared express http routes

4all-locadora's People

Contributors

gabrielsp92 avatar

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.