fefi95 / cross-solar

Solution for Crossover test

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Project Assessment: Cross-Solar is a backend web application created in a hurry by a startup company called “Green Energy Analytics” in Texas - USA. This application collects energy analytics data for solar panels every hour.

Notes: - The project accepts data for registered panels only, and to register a panel, a serial number along with latitude and longitude is required. The serial number must exact be 16 characters in length (for ex. AAAA1111BBBB2222); latitude and longitude should contain 6 decimal places and must have valid values within latitude range (-90 to 90) and longitude range (-180 to 180) respectively. - Frontend application is excluded from the current scope. It is a separate, fully-functioning application handled by another team, so we do not want to modify it.

Tasks: 1) Frontend team wants to display panel’s all historical data in a chart, in which each point represents electricity generated by this panel each day [sum, min, max, average of hourly kilowatt values] up to the end of the previous day. Your goal is to implement the backend part of this task. The API specifications are already there in the code as agreed with Frontend team. Please also include unit tests for the code that write. 2) The URLs for the API are mapped directly in the cross_solar project's urls.py, please refactor it so that the mappings are moved to api project and included from there. 3) There are a few bugs in the application that we'd like you to fix. Even though the project might not be in a great structure, please do not spend your valuable time on structure modifications, focus on fixing bugs.

PLEASE NOTE THAT ALL THE TASKS LISTED ABOVE ARE MANDATORY. We'll be evaluating your submission on the following parameters:
- Code quality and best practices
- Implementation of new feature
- Bug fixes
- Unit Tests

Prerequisites: - pip - Python 3.x - SQLite3 - Any IDE

Development Environment: Cross-solar application:

    - The application currently uses SQLite3 and should work without any configuration changes.
    - On any terminal move to the "cross_solar" folder and execute the following commands:
    pip install -r requirements.txt
    python manage.py migrate
    python manage.py runserver

    - You can call the API using any tool, like Postman, Curl, etc. You can also utilize the Web browsable API if you want but keep in mind that analytics endpoints are not visible under 'Api Root'

- To run the unit tests, execute:
    python manage.py test

- To check the code coverage, execute:
    coverage run manage.py test
    coverage report

How to deliver: This is how we are going to access and evaluate your submission, so please make sure you go through the following steps before submitting your answer.

1) Make sure that you have run unit tests, there are no errors, and any new dependencies are specified/included.
2) Zip your project folder and name it 'cross-solar-python_<YourNameHere>.zip'.
3) Store your file in a shared location where Crossover team can access and download it for evaluation. Do not forget to paste the shared link in the answer field of this question.

About

Solution for Crossover test


Languages

Language:Python 100.0%