Skip to content

Code Institute Full Stack Developer Course - Portfolio Project 5 - Advanced Front-End. Back end API for the Tick It productivity app.

Notifications You must be signed in to change notification settings

jkingportfolio/CI_PP5_Tick_It_drf_api

Repository files navigation

Tick It API in DRF

Developer: Jamie King

💻 Live link

This repository contains the API set up using Django REST Framework for the Tick It front-end application (repository here and live website here)

Table of Contents

User Stories

The back-end section of the project focuses on its administration side and covers one user story:

  • As an admin, I want to be able to create, edit and delete users, tasks, packs, comments and watches, so that I can have control over the content of the application and also remove any potential inappropriate content.

Database

The following models were created to represent the database model structure of the application:

User Model

  • The User model contains information about the user. It is part of the Django allauth library.
  • One-to-one relation with the Profile model owner field
  • ForeignKey relation with the Task model owner
  • ForeignKey relation with the Pack model owner
  • ForeignKey relation with the Comment model owner
  • ForeignKey relation with the Watch model owner

Profile Model

  • The Profile model contains the following fields: owner, name, job_role, created_on, updated_on and an image
  • One-to-one relation between the owner field and User id field

Task Model

  • The Task model contains the following fields: owner, created_on, title, task_body, updated_on, priority, due_date, assigned_to, completed and pack.
  • ForeignKey relation with the owner field
  • ForeignKey relation with the assigned_to field
  • ForeignKey relation with the pack field

Watch Model

  • The Watch model contains the following fields: owner, task and created_on
  • ForeignKey relation between the owner field and the User id field
  • ForeignKey relation between the task field and the Task id field

Comment Model

  • The Comment model contains the following fields: owner, task, created_on, updated_on and comment_body
  • ForeignKey relation between the ownner and User id field
  • ForeignKey relation between the task and Task id field

Pack Model

  • The Pack model contains the following fields: owner, created_on, title, pack_description, updated_on and tasks
  • ForeignKey relation between to owner and User id field
  • ManyToMany relation between the tasks and Task id field

Contact Model

  • The Contact model contains the following fields: reason, name, email, message and message date
Back to top

Technologies Used

Languages & Frameworks

  • Python
  • Django

Libraries & Tools

  • Cloudinary - File storage. Justification: I used this to store static files
  • Graphviz - Image generator. Justification: I used this used for the database model diagram
  • Git - Version control system. Justification: I used this for version control and to push the code to GitHub
  • GitHub - Cloud based hosting service. Justification: I used this as a remote repository to store project code
  • Gitpod - Cloud development environment. Justification: I used this to host a virtual workspace
  • Heroku - Cloud platform. Justification: I used this was used to deploy the project into live environment
  • Django REST Framework - API toolkit. Justification: I used this to build the back-end API
  • Django AllAuth - API Module. Justification: I used this for user authentication
  • Psycopg2 - PostgreSQL database adaptor. Justification: This was used as a PostgreSQL database adapter for Python
  • ElephantSQL - Database hosting service – Justification: This was used as the deployed project on Heroku uses an ElephantSQL database
Back to top

Validation

Python Validation

PEP8 was unavailable at the time of creating this project so Pycodestyle was used instead to continually check all Python code for errors and warnings.

Testing

The following tests were carried out on the app:

  1. Manual testing of user stories
  2. Automated testing

Manual testing of user stories

  • As an admin, I want to be able to create, edit and delete the users, posts, comments and likes, so that I can have a control over the content of the application and remove any potential inappropriate content
Test Action Expected Result Actual Result
User Create, update & delete user A user can be created, edited or deleted Works as expected
User Change permissions User permissions can be updated Works as expected
Profile Create, update & delete User profile can be created, edited or deleted Works as expected
Task Create, update & delete A Task can be created, edited or deleted Works as expected
Comment Create, update & delete A comment can be created, edited or deleted Works as expected
Watch Create & delete A Watch relationship between a Task and a User can be created or deleted Works as expected
Pack Create & delete A Pack can be created, edited or deleted Works as expected
Contact Create & delete A Contact message can be created or deleted Works as expected

In addition, tasks, comments, packs and watches can be created by logged-in users only. Users can only update or delete the content which was created by themselves.

Screenshots - USER
Create user


Screenshots - PROFILE
Update profile


Delete profile



Screenshots - TASK
Create task


Update task

Delete task


Screenshots - COMMENT
Create comment


Update comment

Delete comment


Screenshots - PACK
Create pack


Edit pack


Delete pack


Screenshots - WATCH
Create - Watch Task

Delete - UnWatch Task


Screenshots - Contact
Create - Contact message

Delete - Contact message (superuser only)



Automated testing

Automated testing was done using the Django Rest Framework APITestCase.

  • Tests summary
Individual app report
Combined report
Back to top

Credits

Code

This project was created based on the Code Institute's Django REST API walkthrough project 'Moments'.

Back to top

About

Code Institute Full Stack Developer Course - Portfolio Project 5 - Advanced Front-End. Back end API for the Tick It productivity app.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published