Logo Lanfrica

MaureenMumbi/FSND-Shamba

Domain:

agriculture

Record type:

software
Creator:
Mau
Host:
Shamba app contains APIs that allow for farm management. The farmer is able to track the procedures done on the farm # Backend - Shamba API Shamba App is an app to be used to manage the activities in the farm so as to monitor the various steps in farming, It involves tracking the procedures to be done, all inputs such as fertilizer, the field it was done on( if a farm has different fields) and the worker who worked on it. # API URL Heroku: [shamba.herokuapp.com] Localhost: base URL is localhost:5000 Login # Authentication The tokens are provided in the setup.sh file and are valid for 24hours. A postman collectiom is also included within the project. # User Roles ## Manager Can do all CRUD activites, e.g create farm procedures, create inputs. delete etc ## Farm manager Does the bulk of the farm management activities except deleting any data. The Farm manager can add, update and view all records. ### Installing Dependencies for the Backend 1. **Python 3.7** - Follow instructions to install the latest version of python for your platform in the python docs 2. **Virtual Enviornment** - We recommend working within a virtual environment whenever using Python for projects. This keeps your dependencies for each project separate and organaized. Instructions for setting up a virual enviornment for your platform can be found in the python docs 3. **PIP Dependencies** - Once you have your virtual environment setup and running, install dependencies by naviging to the `/backend` directory and running: ```bash pip install -r requirements.txt ``` This will install all of the required packages we selected within the `requirements.txt` file. 4. **Key Dependencies** - Flask is a lightweight backend microservices framework. Flask is required to handle requests and responses. - SQLAlchemy is the Python SQL toolkit and ORM we'll use handle the lightweight sqlite database. You'll primarily work in app.py and can reference models.py. - Flask-CORS is the extension we'll use to handle cross origin requests from our frontend server. ### Database Setup With Postgres running, create …