Skip to content

tpiva/package-quality

Repository files navigation

PackageQuality

Simple tool to compare open source libs in Github.

At moment only 3 open sources can be compare: React, Angular and Vue

How use

This project needs a database Postgres, so that It's neccessary to have it install and running in your machine. If you don't have, please follow steps in next session.

Github token

It's necessary to add GitHub token to this project works. See Github token

The access token needs to be in enviroment: GITHUB_TOKEN

Instancing database and initializing it

First of all install all dependecies of project by command:

npm run install
  1. At the main folder of PackageQuality project run command:
docker-compose up
  1. After container instanced, change name of file .env-development to .env - This files has the enviroment variables to connect into dabase to create tables and insert initial data.

  2. Migrate database and seed it by command:

// create tables
npm run db:create

// insert initial data
npm run db:seed

Run server

We strongly recommend to make a request to endpoint /v1/scheduler/sync to initalize database with Github projects, it'll do a sync

After database is instanced to run server, it's just necessary to run command - .env should exists:

npm run start

Run tests

  1. Change file .env to .env-development and change .env-test to .env - This .env-test has system enviroments for test

  2. Run step 3 in section Instancing database and initializing it - This will create tables and seed it in test enviroment's

  3. Run command:

npm run test

Routes Documentation

All routes are document on swagger Link: http://localhost:3000/v1/swagger

Future features

  1. Add jwt token to authentication requests.
  2. Add state of connection with database in health route.
  3. Make phase 3 with more info about projects.

Libs

3rd party libs used.

Production:

  • koa: Make the code more easible to read and implement.
  • dotenv: Load enviroment into code
  • lodash: It has a huge number of helper's functions that make the code more declarative.
  • log4js: Log everthing make on code, more easily to see what happens in case any bug
  • node-schedule: Widely used scheduler to run at an period of day to dowload every data from github.
  • sequelize: Easily ORM to transpile database into models and make easily to migrate database during any change
  • app-module-path: Make easily to import module without require or import be big.

Development

  • eslint: Static analyzer of code, it can found error into code making the code more robust
  • babel: Transpiler to ES6 features.
  • chai: Help to make assertions for test
  • mocha: Framework used to make some tests in javascript.
  • sinon: Lib used to make more easily mock and spy some functions, classes and other stuffs in javascript
  • supertest: Use to make easily HTTP test
  • husky: Run scripts before commits to avoid erros, in this project we use to run eslint to found issues.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors