Skip to content

viniciusnascimento95/flask-b2w

Repository files navigation

API B2W

Tools used

  • python-dotenv
  • flask
  • Flask restfull
  • Mongodb
  • MongoEngine
  • Pymongo
  • Flask-Marshmallow
  • ipython
  • ipdb
  • flask-shell-ipython
  • isort
  • pytest-flask
  • flake8
  • pytest
  • pytest-cov
  • pytest-runner
  • Faker
  • flask-mongoengine
  • gunicorn
  • marshmallow

Project description

Flask-B2W is a Restful API, a CRUD of planets was implemented using MongoDB database, this challenge for the backend developer position on B2W DIGITAL.

Example

Requirements to use for test local

  1. enter in directory flask-b2w
  2. run the command pip install pipenv
  3. run the command pipenv install
  4. run the command python application.py or make run

Postman

  1. Open postman.
  2. Go to file tab and click import or Ctrl+O
  3. Open file in directory flask-b2w/docs/API-B2W.postman_collection.json
  4. Do the operations according to the documentation

Using Postman for request client

List planets

Search planet by ID

Create planet

Put planet

Delete planet

Search by name

Entity this project

  • id
  • name
  • climate
  • terrain
  • films
  • films_appearances
  • created_at

Endpoints Actions

Path Method Status Code Description
/planets GET 200 List all planets
/planets/<string:planet_id> GET 200 Get a planet by id
/planets POST 201 Create a planet
/planets/<string:planet_id> PUT 200 Update all fields
/planets/<string:planet_id> DELETE 204 Delete a planet
/planets/name/<string:planet_name> GET 200 Get a planet by name

Run tests local

make test