Giter Site home page Giter Site logo

supernova's Introduction

Supernova

CircleCI codecov

Table of Contents

Introduction

Supernova digitizes what today is done with excel sheets.

Backgroud

Even nowadays, many companies still rely on old technologies in order to store their call center, technical assistance, and field work information. Most of these companies use excel sheets. Therefore, there is a big oppoturnity to digitalize their information and help them to have a better managment of their processes.

Technology

Getting Started

To get started, you should install Docker and Docker Compose.

Then, clone the repository:

$ git clone [email protected]:black-atom/supernova.git

There are 3 default .env files. You can change them according to your needs..

Setup

To setup the environment you can change or create a .env file. Then run:

make database
make run-test-migration
make run-seeds

Running Server

To run locally, simply do the following command:

make server

This will start the development server listening on port 3000.

Running Tests

To run our tests, do:

$ make test

This will run both e2e and unit tests

Create Migrations

node_modules/.bin/sequelize migration:generate --name migration_name

supernova's People

Contributors

vitorsilvalima avatar alexandrejuk avatar

Watchers

James Cloos avatar  avatar Augusto Amaral avatar Vitor Capretz avatar

supernova's Issues

add session controll

Session control must be added to the project so we can control which user is logged and on which device he is logged:

  • user has one or many active sessions
{
  id: uuid,
  active: boolean,
  lastActivity: new Date(),
  type: 'app | browser | others',
  userId: uuid,
  companyId: uuid
}

add company model

The company model needs to be added. It will be one of the most important models as it will be linked to many others

add authentication and authorization middlewares

add authentication middleware:

  • user Authorization header to pass session id
  • should receive session id
  • responsible for checking if session is valid
  • return 403 if session is expired
  • session for browser should last for only 30 minutes - after that it will be considered invalid
  • update lastActivity of session
  • store authentication info in the following format in req object:
req.context = {
  user: user loader from session id,
  company: company loader from session id
}

get /profile

  • route responsible for returning info from the logged user
  • this route will use info from req.context.user

Criar endpoint para criacao de customer

Enpoint

POST /api/customer

Migrations

customer - faltou o campo type que e uma enum ["fisico","juridico"]
address_type
contact_type
customer_pj
customer_pf
customer_address
customer_contact

Description

Um cliente pode ser pessoa fisica ou juridica. Pelo diagrama, percebemos que ele pode ser as duas coisas ao mesmo tempo, porem isso e controlado na camada da aplicadao atraves do type do customer

PS

Os dados default para a tabela contact_type e address_type sao inseridos no comento que uma company e criado

add GET /api/profile endpoint

Add GET /api/profile endpoint which should return the logged user info.

Session id passed in header will be used there to retrieve the user info

company creation

company creation needs to be added in order to register new company and its users.

  • endpoint: /register
  • ensure: the data passed is corrected and it has a user

add contract

The contract needs models and the endpoints below.

Endpoints

  1. Post contract
  2. Get contract
  3. Put contract

Models

  1. contract
  2. customer
  3. product

Criar endpoint para cadastro de produto

Enpoint

POST /api/customer

Migrations

product
category

Description

Uma company(nosso cliente) pode cadastrar muitas categorias. Ela também pode cadastrar vários produtos, por essa razão, salvamos sempre o company id em ambos. Um produto pertence a uma categoria previamente cadastrada pela company.

PS

No momento de criação de uma company, podemos cadastrar categorias default pra ela como por exemplo:
Alimentos
Bebidas
Cama,mesa e banho
Diversos
........

#Schema
screen shot 2018-09-23 at 12 21 34

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.