Awesome Open Source
Awesome Open Source

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.
See docs: https://buzzl.herokuapp.com/docs.

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 [email protected]: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

Related Awesome Lists
Top Programming Languages

Get A Weekly Email With Trending Projects For These Topics
No Spam. Unsubscribe easily at any time.
Typescript (282,558
Docker (98,935
Postgresql (24,396
Jwt (10,149
Feedback (5,778
Github Actions (5,594
Tdd (4,252
Design Patterns (3,213
Ddd (2,566
Ci Cd (2,436
Typeorm (1,005
Rate Limiting (440
Solid Principles (334
Argon2 (215