gabriellopes00 / buzzl

A platform providing a easy way to get and manage your service's feedbacks and NPS. A system made with Node.JS, Typescript and PostgreSQL

Home Page:https://buzzl.herokuapp.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Buzzl

Main Workflow Coverage Status License: GPL v3 Stars GitHub tag (latest by date) Lines of Code Quality Gate Status Maintainability Rating Reliability Rating Security Rating

An API built with

typescript javascript nodejs jwt docker postgres eslint jest heroku swagger coveralls typeorm

Application hosted at heroku.

About Buzzl πŸ“š

Buzzl is being built to offer a complete platform for everyone seeing have a better control over their services, and their customers opinion about them. Here you can register yourself on the platform and create services, that will be able to receive feedbacks and rates from your customers. This will allow you have a contact with customers feedbacks, which can be a ISSUE, an IDEA, or OTHERS, and calculate your services NPS, knowing how your customers are evaluating your services. This is an open source application, which is begin built using Nodejs, including a lot of other concepts and new technologies such as Typescript, SOLID principles, Clean Architecture, DDD, TDD, Docker, PostgreSQL, Redis...

Api Structure

Clean Architecture Schema

This project structure is inspired in clean architecture code structure, by Uncle Bob. The main purpose of clean architecture, hexagonal architecture, and others softwares architecture structure, is creating a strong, readable, understandable and maintainable project code, splitting all the application code in layers, each one with their own responsibilities and characteristics. The best advantage of using it, is create a application independent of any frameworks, tool, database or technology (infra layer), being easy to handle the code, create a new features, fix any issue, or change some framework, becoming less vulnerable to changes to frameworks and libs, thanks to the adapters and ports technique, that make this frameworks being just a part of the software, and uncoupling them to the domain business rules.

Clean Architecture Cone

As is shown in the images, the ideia is that external layers can know internal layers, but never the opposite, because a framework, for example, can know the entity, to execute specific tasks. But domain is totally independent of external libs, so it never know each lib or framework is persisting the data for example.

Folders Structure πŸ—‚

root
β”œβ”€β”€ .github                 β†’ Github files
β”‚     └── assets
β”‚     └── workflow
β”œβ”€β”€ src                     β†’ Application main code
β”‚    │── app                β†’ Composition layer, entry point code, server setup...
β”‚    β”‚    └── server.ts     β†’ Server entry point
β”‚    β”œβ”€β”€ modules            β†’ App modules
β”‚    β”‚    β”œβ”€β”€ domain        β†’ Module's entities
β”‚    β”‚    β”œβ”€β”€ usecases      β†’ Business rules
β”‚    β”‚    β”œβ”€β”€ controllers   β†’ Controllers
β”‚    β”‚    └── repositories  β†’ Module's repository interface
β”‚    β”œβ”€β”€ infra              β†’ External frameworks and libs ports implementation (orm, encrypter)
β”‚    β”œβ”€β”€ presentation       β†’ External api communication layer (controllers, validators)
└─── tests                  β†’ Application tests code
      └── e2e
      └── unit

Security πŸ”’

Users password are hashed with Argon2 hasher, winner of the Password Hashing Competition (PHC), the most recommended and secure hashing algorithm option. Authentications tokens are generated using JWT, most used tool to generate authentication tokens for web applications, which are encoded with a key pair of RSA keys using RS256 asymmetric cryptography algorithm, increasing token's authenticity.

Building and running πŸ› 

To run this project locally, you will have to install Nodejs and PostgreSQL on the machine, or run everything with Docker and docker-compose. Before run the project, go to .env.example file, on project root, and rename it to .env only, filling all the properties in the file with your information (api port, db credentials...). Public and private keys must be generated with the commands below, and pasted in ..env file, with \n and no spaces after each line; something like this: TOKEN_PUBLIC_KEY="-----BEGIN PUBLIC KEY-----\nMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDBiYJxPJIC/XiBo50AKFcSmHlZ\nS9lVPBTFk7c4rP/4cIt9dtLYms3eOVWLZem8/KW48u1P6tcbdfQx7kuuXonDYoWx\nUm2paTlQ6+eB4ffjNp2gtuXndab0WgUc93700Wn5H1edqT90eP5Z2Xp44Cgr33Gf\n6YdJ0I8Yb8E9uRSTkwIDAQAB\n-----END PUBLIC KEY-----\n".

Cloning Repository
git clone https://github.com/gabriellopes00/buzzl.git
or
git clone git@github.com:gabriellopes00/buzzl.git
Generating RSA key pair
openssl genrsa -out private_key.pem 1024 && \
openssl rsa -pubout -in private_key.pem -out public_key.pem
Running with Docker
docker-compose up -d --build
Running locally
npm install
npm run build
npm run start
Tests (jest) πŸ§ͺ
  • All ❯ yarn test
  • Coverage ❯ yarn test:ci
  • Unit ❯ yarn test:unit
  • e2e ❯ yarn test:e2e
Linting 🎭
  • Lint(eslint) ❯ yarn lint
  • Style(prettier) ❯ yarn style
Statistics of the types of commits πŸ“ŠπŸ“ˆ

Following the standard of the Conventional Commits.

  • feature commits(amount) ❯ git shortlog -s --grep feat
  • test commits(amount) ❯ git shortlog -s --grep test
  • refactor commits(amount) ❯ git shortlog -s --grep refactor
  • chore commits(amount) ❯ git shortlog -s --grep chore
  • docs commits(amount) ❯ git shortlog -s --grep docs
  • build commits(amount) ❯ git shortlog -s --grep build

License βœ’

This project uses GPL-3.0 license, which allows anyone modify, distribute and use the application code in many different ways. However there are many conditions, such as License and copyright notice, State changes, Disclose source and Use the same license. Read complete license to know more about permissions and copyright.

Contact πŸ“±

Github Badge Linkedin Badge Twitter Badge Gmail Badge Facebook Badge Instagram Badge StackOverflow Badge

About

A platform providing a easy way to get and manage your service's feedbacks and NPS. A system made with Node.JS, Typescript and PostgreSQL

https://buzzl.herokuapp.com

License:GNU General Public License v3.0


Languages

Language:TypeScript 98.6%Language:JavaScript 0.8%Language:Dockerfile 0.4%Language:Shell 0.1%