Code Monkey home page Code Monkey logo

security-'s Introduction

(API) Security Plus

Backend for Security Plus app

Getting Started

Prerequisites

you need to have the following packages installed

Node and yarn

for install consult:

Installing

git clone [email protected]:CleytonRR/security-.git

After:

cd security-/

then, install all dependencies

yarn install

when finished, create the .env file in the root folder, follow the instructions for creating

Running the tests

For run the automated tests and sync database use:

yarn test

Running API

for run API use:

yarn start

How to use

We have this routes [POST] -> /user [POST] -> /login [POST] -> /newCall

[GET] -> /calls

[PUT] -> /changecall

example build with Insomnia

/user router use is a router which make create a new users accepts email, password , CPF, age and master in json format

usage example:


password - should have length minimal 8 a character have a character caps lock, number and character special

/login in this route should receive an email and password valid and return a token for authenticate and return master with true or false

example



**Authorization ** For authorization use token generated during login use:

/newcall
this route is protected to access it, a token that was generated during login must pass in the request header. This router create new calls this route should receive title, description, status, latitude e longitude

example

[GET] -> /calls
This route has two possible returns, if the user is a master it returns all open calls, if the logged in user is a normal user it returns all cases created by him

example

[PUT] -> /changecall
This route close a call, this route should receive id for call example

Built With

  • Express - The web framework used
  • Sequelize - ORM for Postgres, MySQL, MariaDB, SQLite and Microsoft SQL
  • Bcrypt - used for transform password in a hash
  • Jsonwebtoken - Module for generator tokens
  • Mocha - used for testing
  • Supertest - used to make requests in the api inside the test suite

JavaScript Style Guide

security-'s People

Contributors

cleytonrr avatar dependabot[bot] avatar

Watchers

 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.