Giter VIP home page Giter VIP logo

pokedex-api's Introduction

Pokedex API ๐Ÿš€

The structure of this project aims to structure the code based on components. Instead of repeating the name of the component in a folder of controllers or domain, each component is composed of its own entity, routes, controller, services, repository, test, among other files.

Each component has its providers file to avoid contact with the other files from the outside. Anyone who requires a file of its component should request it from the *.providers.ts file.

This project follows the DDD architecture and simulates the behavior of microservices.

The dependencies are managed by a container (IoC) to have a low or no coupling.

Followed best practices โค๏ธ


  1. ๐Ÿ”— NodeJS Best Practices
  2. ๐Ÿ”— DDD Architecture
  3. ๐Ÿ”— Inversion of control (IoC)

Main Technologies โš™๏ธ


  1. ๐Ÿ”— NodeJS >=12.6.0
  2. ๐Ÿ”— ExpressJS
  3. ๐Ÿ”— TypeScript
  4. ๐Ÿ”— TYPEORM
  5. ๐Ÿ”— PostgreSQL
  6. ๐Ÿ”— Jest

Getting Started ๐Ÿ“Œ


This API is consumed by the Pokedex hosted in the following repository: Pokedex

  1. Clone
  2. Move to --> cd pokedex-api
  3. copy .example.env to .env
  4. Run npm install
  5. Be sure to create your Postgres database.

Env variables ๐Ÿ“Œ


  • PORT : The port used by the application to expose itself. Default --> 2302
  • PREFIX_ROUTES : Prefix that routes use. Default --> /api/v1
  • DB_HOST : Database address. Default --> localhost
  • POSTGRES_USER : Database user.
  • POSTGRES_PASSWORD Database pass.
  • POSTGRES_DB : The database name used by the application.
  • TOKEN_EXPIRE : When authentication tokens expire. default --> 72h
  • SECRET : Secret word to generate authentication tokens. default --> secret-pokedex-api
  • SMTP_EMAIL : Your GMAIL email to send emails. example --> [email protected]
  • SMTP_PASSWORD : Password of your GMAIL email.
  • AGENT_CLIENT_URI : Base URL of your Frontend client. default --> http://localhost:3000

Ready ๐Ÿ“Œ


Run npm run watch โœ”๏ธ

NOTE ๐Ÿ“ข


The first registered user is assigned the ROLE = OWNER, this will have special permissions in all its pokedex, according to the requirements.

  • Update, Delete, Disable, List and view users.
  • Update, Delete, Disable, List and view pokedex.
  • If the OWNER deletes a user or pokedex, all data related to it is deleted.

Password validation ๐Ÿ“ข

User passwords have a small layer of additional validation to avoid the use of common or highly insecure passwords.

You can see this list of common passwords in

src/infrastructure/utils/commonPasswords.txt

You can add more passwords or delete from this file.

Contribute ๐Ÿ“Œ


To contribute to this repo you must consider the following:

  1. ๐Ÿ”— Use Conventional Commits
  2. Consider the use of dependencies well.
  3. Read about Node JS Best Practices.
  4. Follow the architecture that takes the project.
  5. ๐Ÿ”— Use Git Flow

End ๐Ÿ“Œ

If he came this far it is because we are ready. โœ”๏ธ

You can consult the Documentation at this URL:

๐ŸŒ Pokedex Docs

pokedex-api's People

Contributors

efraa avatar

Stargazers

 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.