Coder Social home page Coder Social logo

pokemon-go's Introduction

pokemon go

Description

This is a simple pokemon go api that allows you to create a user, login, and add pokemon to your collection.

tools and technologies used

setup

  1. Clone this repo

  2. run docker-compose up in the root directory

seeded data

  • there is a user with the email [email protected] and password admin1234 that is an admin user

  • there is about 800 pokemon in the database (same as in the excel sheet provided)

tests and test coverage

  • to run the tests you cna run this command docker-compose exec app sh then npm run test:cov

test coverage

postman collection

note go to the environment and set the URL variable to http://localhost:8080/api/v1

postman environment

note you will need to create a user and login to get a TOKEN to use the other routes

the token will be assigned to the token variable in the environment automatically when you login

routes

auth routes

  • POST /auth/signup

    • body: { username: string, password: string }
    • response: { token: string }
  • POST /auth/login

    • body: { username: string, password: string }
    • response: { token: string }

pokemon routes

note you should be authenticated to view the pokemon routes but only admin users can add, update, and delete pokemon

  • GET /pokemons
    • response: { pokemon: Pokemon[] }

this endpoint will get all the pokemon in the database and its paginated it takes 5 params

+ page: number => the page number you want to get
+ pageSize: number => the number of pokemon you want to get per page
+ filters :
    + name: string => the name of the pokemon you want to filter by (string)
    + generation: number => the generation of the pokemon you want to filter by (number)
    + evolutionStage: string => the evolution stage of the pokemon you want to filter by (string)
  • POST /pokemons/add

    • body: { name: string, type: string }
    • response: { pokemon: Pokemon }
  • GET /pokemons/:id

    • response: { pokemon: Pokemon }

note these rest of the endpoints require you to be logged in as an admin user to use them

  • DELETE /pokemons/:id (admin only)

    • response: { pokemon: Pokemon }
  • PUT /pokemons/:id (admin only)

    • body: { name: string, type: string }
    • response: { pokemon: Pokemon }

user routes

note you will need to create a user and login to get a TOKEN to use them

  • GET /user

    • response: { user: User }
  • PATCH /user

    • body: { name: string, email: string }
    • response: { user: User }
  • DELETE /user

    • response: { user: User }
  • PATCH /user/change-password

    • body: { password: string }
    • response: { user: User }

pokemon-go's People

Contributors

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