!!Work in Progress!! PEDAC.md for outline of problem and process.
Task: [Build an Image repository] (https://docs.google.com/document/d/1eg3sJTOwtyFhDopKedRD6142CFkDfWp1QvRKXNTPIOc/edit) Demonstrates proficiency in the following areas:
- Data modeling
- Architect relational database models in Python and SQLite
- Utilize SQLAlchemy to conduct database queries
- API Architecture and Testing
- Follow RESTful principles of API development using Flask
- Structure endpoints to perform CRUD operations, as well as error handling
- Demonstrate validity of API behavior using the unittest library
- Third Party Authentication (TODO)
- Configure Role Based Authentication and roles-based access control (RBAC) in a Flask application utilizing Auth0
- Decode and verify JWTs from Authorization headers
- Deployment
- API will be hosted (TODO)
- Front End (TODO)
- Design and create a frontend which works with the API and redirects the user to Auth0 for login.
- Uses Flask and Jinja Templates
Developers should have Python3, and pip3 installed
!!TODO!!
In the main directory run:
python -m venv venv
To activate the virtual environment, in the main directory run:
souce venv/bin/activate
Once you have your virtual environment setup and running, install dependencies by running:
pip install -r requirements.txt
!!TODO!!
!!TODO!!
From within the main directory first ensure you are working using your created virtual environment.
To run the server, execute:
imagerepo run
!!TODO!!
!!TODO!! Base URL: Currently this application is only hosted locally. The backend is hosted at (to do) Authentication: In order to use the API users need to be authenticated. Users can either have a user or admin role. An overview of the API can be found below as well. There's also a Postman Collection(to do) provided.
There are four types of errors the API will return`;
- 400 - bad request
- 401 - unauthorised
- 404 - resource not found
- 422 - unprocessable
- 500 - internal server error
Admin have the following permissions:
- get:image
- post:image
- delete:image
email: admin@email.com password: user_id:
User has the following permissions:
- get:image
- Returns the home page and a welcome message
- returns the upload image form
- Uploads a new image (or images) to the database
- Requires admin account authorisation
- TODO
- returns the upload image form for updating an image
- updates the image on the database with any updated information
- Requires admin account authorisation
- TODO
- creates a new user
- TODO