Git Product home page Git Product logo

transactions-app-backend's Introduction

Transactions App Backend

Transactions App is a simple Financial tracking tool made with love from Belo Horizonte, Brazil. It is not a complete application and it has the objetive to be an instructional repository to learn and teach backend development with JavaScript technologies, design patterns and clean architecture principles.

Related repositories:

Diagram

TBD

Technologies

Feel free to explore package.json dependencies and devDependencies to learn more. But in summary we have:

  • Node.js, Express.js as core tecnologies
  • Jest and Supertest for testing
  • MySQL with Sequelize at persistence layer
  • And more

Design patterns covered

  • The core objects is represented with Domain model pattern
  • For object relational mapping was chose Sequelize ORM
  • The application is organized in layers (routes, controller, models)

Before you start

Before you starting clone this repository, make sure that you've already done the following steps:

  1. Install nvm:

    $ brew install nvm
  2. After nvm installation, use it to install the proper version of node.js:

    $ nvm use
  3. Considering MAC OS, you may use homebrew to install a local Mysql Server and then opt to start server as a service or manually. Installation and some security configurations:

    $ brew install mysql
    $ mysql_secure_installation
    

Running the app locally

  1. Install dependencies:

    $ npm i
    
  2. Create a .env file (you can duplicate .env.sample) and configure your local dev environment varaibles. Remember that you should never commit this file.

  3. Execute the project:

    $ npm run start:local
    
  4. You can access the API in: http://localhost:3000/

Ps. The first time you run, make sure your database server is running and that all the migrations are up. More info bellow.

Database server

Start Mysql server (Mac will re-start it at reboot)

$ brew services start mysql
$ brew services stop mysql

Start Mysql server (Mac will not re-start it at reboot)

$ mysql.server start
$ mysql.server status
$ mysql.server stop

To login on Mysql server with/without password

$ mysql -u root -p
$ mysql -uroot

Migrations

To create database and schema:

$ npm run db:create
$ npm run db:migrate
$ npm run db:migrate:status

Test

To execut all unit tests:

$ npm run test
$ npm run test:watch

To execute all unit tests with coverage:

$ npm run test:coverage

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.