Giter Club home page Giter Club logo

hubla-transactions's Introduction

Hubla Transactions


Built with

  • TypeScript
  • NestJS
  • Prisma
  • Postgres
  • Vue.js
  • TailwindCSS

Setup

The project can be run in a production environment with a single docker-compose located on project root

  1. Install docker and docker-compose
  2. Copy .env.example to a .env file on project root, making changes if necessary
    • The NGINX_PORT variabel defines the port in wich the application will be exposed
  3. The web interface can be accessed at http://localhost:NGINX_PORT and the server at http://localhost:NGINX_PORT/api/
    • Setting NGINX_PORT to 80, the default HTTP port, exposes the app at http://localhost and http://localhost/api/
  4. At project root run:
    • docker-compose up

Testing

There is also a docker-compose setup in the server directory for running the backend test suites

  1. cd server
  2. Make sure the variables in .env.test have appropriate values
  3. Run:
    • yarn docker:test:run

Development

Curently there is no docker development environment setup

  • Prerequisites
  1. A running postgres service, either in a Docker container or in a local instance
  2. Having Node installed
  • Back-end
  1. cd server
  2. Copy .env.example to a .env file, making changes if necessary
  3. yarn start:dev
  • Front-end
  1. cd client
  2. Copy .env.example to a .env file, making changes if necessary
    • The VITE_SERVER_BASE_URL environment variable should point to the running server URL
  3. yarn dev

Database ERD

Logo

๐Ÿš€ Routes

  • The default responses are:

    • 200 - Successful GET request
    • 201 - Successful POST request
    • 204 - Successful DELETE request
    • 401 - Auth errors
    • 404 - Resource not found
    • 422 - Body validation error on POST requests
  • By default routes require: Authorization: Bearer TOKEN header for JWT auth

  • ๐Ÿ”“ denotes an open route

GET /
- ๐Ÿ”“ Hello from running server!

Auth

POST /auth/signup
    - ๐Ÿ”“ Route for creating a new user
    - body:{
        "username": "jondoe",
        "password": "DonJoe27"
      }
    - response: {"token": "JWT_TOKEN"}
POST /auth/signin
    - ๐Ÿ”“ Route for signing an existing user
    - body:{
        "username": "jondoe",
        "password": "DonJoe27"
    }
    - Response: {"token": JWT_TOKEN}
POST /auth/delete
    - Deletes current signed user
    - headers: {"Authorization": "Bearer TOKEN"}

Transactions

POST /transactions/upload
    - Route for creating many transactions via input file
    - Duplicate transactions are ignored by a unique (vendorId & productId & date) contraint
    - headers: {"Authorization": "Bearer TOKEN"}
    - Form Data: { file }
GET /transactions
    - Route for getting all trnasactions
    - headers: {"Authorization": "Bearer TOKEN"}
    - Response: array of transactions
GET /credentials/:id
    - Route for finding one transaction
    - headers: {"Authorization": "Bearer TOKEN"}
    - Response: transaction
DELETE /credentials/:id
    - Route for deleting one transaction
    - headers: {"Authorization": "Bearer TOKEN"}

hubla-transactions's People

Contributors

celsobenedetti avatar

Stargazers

 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.