Skip to content

RESTful API to report/track technical problems (student project)

Notifications You must be signed in to change notification settings

nanakin/Django-REST-Framework-OC

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Issue Tracking RESTful API

Table Of Contents

Preamble

This website was designed for a school project with specific requirements and fixed constraints. It was developed in a limited period of time and in this context this project is not intended to evolve that much once finished. This project is not open to contribution. The following need is fictive.

About the project

SoftDesk logo

Project context

SoftDesk, a software publishing company, decided to develop an application to report and track technical problems. I was hired as a software engineer to create an efficient and secure back-end to serve front-end applications on different platforms, using a RESTful API for their communications.

About the API

Resources

The API provides the following resources :

  • Users:
    • Username, password, birthdate, RGPD data.
  • Contributors:
    • User-project association.
  • Projects:
    • Title, description, type of project, list of contributors.
  • Issues (related to a project):
    • Title, description, assignment to a contributor, priority, type of issue, status of progression.
  • Comments (related to an issue):
    • Description.

Permissions

The API allows:

  • Unauthenticated users to:
    • create users.
  • Authenticated users to:
    • modify or delete their user profile,
    • create projects,
    • add contributors to their created projects,
    • delete added contributors,
    • modify and delete their created projects.
  • Authenticated contributors to:
    • add contributors to collaborating projects,
    • delete added contributors,
    • create issues and comments to collaborating projects,
    • read access to projects details, issues and comments from collaborating projects,
    • modify and delete their posted issues and comments.

Note : The API uses bearer authentication (token) as HTTP authentication scheme.

API Endpoints

The API exposes the following URLs:

Where <resourcename_pk> is the primary key (often an id) of the database entry.

About the project design and compliance

The back-end :

  • is a REST API
  • is GDPR (General Data Protection Regulation) compliant
  • is optimized (using pagination and method adapted serializers)
  • is secure (using token authentication and custom permissions)

The python code:

  • is following Django's best practices,
  • is PEP8 compliant (flake8 valid),
  • is Black formatted.

Technology

This application was tested with python 3.11 and poetry 1.5 (for the virtual environnement and dependencies).

Projects dependencies:

DRF

Installation

  1. Clone this repository:

    git clone https://github.com/nanakin/OC-P10-DRF.git DRF-project
  2. Move to the project directory:

    cd DRF-project
  3. Install poetry if not installed yet, by following the official documentation here : https://python-poetry.org/docs/#installation

  4. Install project dependencies in a new virtual environment using poetry:

    poetry install

    and use it:

    poetry shell
  5. Migrate the database

    python3 manage.py migrate
  6. Launch the server:

    python3 manage.py runserver
  7. Start using API endpoints http://localhost:8000/api/...