GithubHelp home page GithubHelp logo

negativo / current-account Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 81 KB

example app for current account ( create account, create transactions ) built in nodejs with typescript

Dockerfile 0.27% TSQL 0.07% TypeScript 99.67%

current-account's Introduction

Current Account Example Project

This project exposes various endpoints to:

  • create/read/update/delete/authenticate a customer
  • create/read/update/delete a current account
  • create/read/delete a transaction

and an 'Insomnia' export is provided to be used to check out the endpoints.

The main endpoints are:

  • POST /api/v1/accounts providing Auth token and body as ```{ customerId: some id, initialCredit: 2000} to create a current account.
  • GET /api/v1/accounts providing Auth token to get all the accounts and transactions for the logged in customer.

Some points of improvement are:

  • Encrypt the customer/account/transactions id sent in the http requests using (eg. using Hashids lib).
  • Move all the text and numeric constants in a separate configuration file.
  • Add in-memory database for testing in the CI.

Features

  • Graceful Shutdown, HealthCheck, SQL Database & Migrations, Authentication, Validation, Integration & Unit Testing, Git Hook

Installation

  • npm install - Install dependencies

Running with Docker

  • docker-compose up (compose and run, it also creates the mysql database)
  • docker-compose down (Destroy application and mysql containers)

Running tests

Make sure to have run docker-compose up before these steps. The database is needed.

  • npm run test - Run unit tests
  • npm run test:integration - Run integration tests
  • npm run test:all - Run Unit and Integration tests

current-account's People

Contributors

negativo avatar

Stargazers

Roman avatar

Watchers

 avatar  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.