MainTraq (from Maintenance Tracker) is an online maintenance/repairs requests tracker that keeps record of maintenance tasks requested by its users within a particular facility. It provides a platform where a user can file a maintenance request online and obtain feedback about the same from the facility admin. The facility can be (but not limited to) an organisation or an organisation's department.
https://maintraqa.herokuapp.com/
Prerequisites
Python 3.6
Virtual Environment
Flask
Postman
Postgresql and have a user: postgres and a matching password.
API Endpoints
- POST /api/v2/auth/register Register a user.
- POST /api/v2/auth/login Login a user.
- GET /api/v2/users/requests Fetch all the requests of a logged in user.
- GET /api/v2/users/requests/int:id Fetch a request that belongs to a logged in user.
- POST /api/v2/Auth/request Create a request.
- PUT /api/v2/users/requests/int:id Modify a request. This operation should not be possible when the admin has approved of the request.
- GET /api/v2/requests Fetch all the requests. This is available only to admin users.
- GET /requests/int:request_id Fetch any of existing requests. This is available only to admin users.
- PUT /api/v2/requests/int:id/approve Approve request. This is available only to admin users. When this endpoint is called, the status of the request should be pending.
- PUT /api/v2/requests/int:id/disapprove Disapprove request. This is available only to admin users.
- PUT /api/v2/requests/int:id/resolve Resolve request. This is available only to admin users.
Clone or download the repo. Navigate to the directory called UI and open any of the html file on any browser. Clone the repository
git clone https://github.com/migot01/Maintraq/
Change directory
cd Maintraq
Checkout on challenge-3-develop branch
git checkout challenge-3-develop
To view UI designs navigate to the UI/ directory.
cd ui/
Then open index.html on your browser.
To setup API locally, make sure you are in the base project folder Maintenance-Tracker
Set up a virtual environment and activate (python 3.6)
pip install virtualenv virtualenv -p python3.6 venv source venv/bin/activate
Install app dependencies
pip install -r requirements.txt
Set up the database and environment variables.
python migrations.py
Provide your `postgres` user password.
Provide a database name on which the app will run
Ensure database setup is successful.
source .env
python migration.py
Run tests
Either
pytest or
nosetests --exe --with-coverage --cover-package=app
The nosetests give a more comprehensive report about test coverage.
Run the flask app
python run.py
- Users can register for a free account.
- Users can log into their accounts.
- Users can make requests to the app.
- Users can see all their requests.
- Admin can respond to a request.
- Admin can log in.
- Admin can view all requests made to this app and respond accordingly.
HTML
CSS
Github Pages :https://migot01.github.io/Maintraq/UI/index.html