Giter Club home page Giter Club logo

contacts-api's Introduction

contacts-api

Contacts Management API written with Node.js

Currently application uses several techniques to verify, test and illustrate good practices.

Unit testing: Mocha/chai/Sinon. Mocha for unit test running, chai for assertions, Sinon for stubs (i.e. database pool is stubbed for unit testing).

BDD testing: Cucumber for feature description (Gherkin style), with chai and chai-http assertions to execute actual calls via API.

Database migrations: db-migrate used to manage database migrations, including scoped migrations for test data installation (required by BDD tests). Test data can be easily removed using the migrate down:test operation and npm script remove-test-data.

Database script to be executed by administrator to create database and user, as well as grant necessary privileges is provided separately.

Application requires Redis for in-memory database (session management) and MySQL/MariaDB for data storage. Abstract db-migrate modelling was not used.

Environment settings are managed using Dotenv, and sample file is available in .env.example.

Various links:

Related repos:

Installation

Clone, npm install, verify installation by running unit tests npm run test. Create database using provided SQL script (create-database.sql) and set up Redis to use provided password (or change it if needed). Copy .env.example to .env and populate variables with your own.

Run database migrations npm run migrate to create database schema. Run npm run install-test-data to install test data to database.

When done, start the application using npm start and run npm run bdd-test to verify that application is functioning properly.

contacts-api's People

Contributors

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