Coder Social home page Coder Social logo

ips138 / carbon_usage_api Goto Github PK

View Code? Open in Web Editor NEW

This project forked from manuelseromenho/carbon_usage_api

0.0 0.0 0.0 19 KB

API Rest that allow manage a database regarding carbon usage data for users

Shell 0.53% Python 98.75% Dockerfile 0.71%

carbon_usage_api's Introduction

Carbon Usage Api exercise

API Rest that allow manage a database regarding carbon usage data for users

# Be sure to have docker and docker-compose installed on you system.
Example for Ubuntu 20.04 can be found here: 

https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-compose-on-ubuntu-20-04-pt

#Build docker container
docker-compose build

#Run docker containers using docker-compose, first db then api
docker-compose up

#Run the migrations
docker-compose exec api python manage.py migrate

#Load initial data (usage types preload)
docker-compose exec api python manage.py loaddata initial_usage_types

#Create first admin user (user: admin, password: a)
docker-compose exec api python manage.py initadmin

API Documentation

  • Documentation of the API is available in https://documenter.getpostman.com/view/5401097/TzsZs8ue
  • Access the Postman Collection available in the root of the project
  • Run "Login JWT", get the token and use it as an global variable or as collection variable with the name 'token'.

Tests

  • The tool used for the tests was Pytest.
  • To run the tool e.g: "docker-compose exec api pytest".

Other Notes

  • Time of creation 5 hours for the API.
  • Time for testing 6 hours.
  • Most of my difficulty was related to testing. I had some experience with Pytest in the past but I've not been working with tests for some time.

carbon_usage_api's People

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.