/acmevita

Test of Telavita

Primary LanguagePython

Introduction

This is an application for the test proposed by Telavita for a job opportunity as a Senior Back-end developer.

It is written in Python using framework Flask, the ORM SQL Alchemy and a MySQL database server.

For more information about the test itself, follow this link

If you're looking for the API's documentation and reference guide, follow this Postman Link


Requirements


Dependencies


Installation Steps

  1. Download the project on your computer and unzip it under some folder. (Ex.: /foo/bar/acmevita)
  2. Open up your terminal and navigate to its folder:
cd /foo/bar/acmevita
  1. Create a Python virtual environment:
python3 -m venv venv
  1. Activate Python virtual environment:
source venv/bin/activate
  1. Install the dependencies:

Install Flask Framework:

pip install flask

Install PyMySQL:

pip install pymysql

Install Flask-SQLAlchemy:

pip install flask_sqlalchemy

Configuration

Under the root folder of the project(Ex.: /foo/bar/acmevita) you will find a file named config.json. This file contains all configs that you must do in order to run this Acmevita Application, such as Database settings and so on.

Here's an example:

{
    "dbconfigs": {
        "dbhost": "localhost",
        "dbname": "acmevita",
        "dbuser": "acmevita",
        "dbpass": "Senha123#",
        "dbport": 3306
    }
}

Just change "dbconfigs" to fulfill your database setup.


Running the Application

  1. From a terminal, navigate to the application's root folder:
cd /foo/bar/acmevita
  1. Activate the Python Virtual Environment:
source venv/bin/activate
  1. Run the application itself:
python main.py

Done and done! Now you can access its API's endpoints to see data at "localhost:5000". The documentation and reference guide about the API is documented on this Postman Link

OBS: You can populate database automatically with dummy data accessing endpoint "/populate". See documentation and reference guide for further info