This repository contains the backend code for a task management system developed using Django and Django REST Framework (DRF). It supports user authentication, task and subtask management, contact management, and assignment of contacts to tasks.
- User Authentication: Token-based authentication system using Django's built-in user model and DRF's token authentication.
- Task Management: Create, update, retrieve, and delete tasks with support for categories, priorities, status, due dates, and subtasks.
- Subtask Management: Each task can have multiple subtasks, which can be managed independently.
- Contact Management: Manage contacts, with the ability to assign contacts to tasks.
- Sphinx Documentation: Docstrings have been added across views, models, serializers, and admin modules to generate automated documentation using Sphinx.
- models.py: Contains the database models for tasks, subtasks, and contacts, as well as many-to-many relationships between tasks and contacts.
- views.py: API views for handling task, subtask, and contact-related requests.
- serializers.py: DRF serializers for converting complex data types like model instances into native Python datatypes.
- admin.py: Custom admin interface to manage tasks, subtasks, and contacts.
- urls.py: Contains all URL routing for API endpoints.
- Sphinx Documentation: Docstrings have been added to the key files (
views.py,models.py,serializers.py, andadmin.py) for generating documentation.
- Clone the repository:
git clone https://github.com/BenjaminTietz/join-backend.git cd join-backend - Set up the virtual environment and install dependencies: python3 -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate pip install -r requirements.txt
- Run database migrations: python manage.py migrate
- Create a superuser: python manage.py createsuperuser
- Start the development server: python manage.py runserver
API Endpoints
Authentication
- Login: /login/ (POST)
- Signup: /signup/ (POST)
Tasks
- List all tasks: /tasks/ (GET)
- Create a task: /tasks/ (POST)
- Retrieve a task: /tasks/{task_id}/ (GET)
- Update a task: /tasks/{task_id}/ (PATCH)
- Add subtasks: /tasks/{task_id}/subtasks/ (POST)
- Assign contacts: /tasks/{task_id}/assignees/ (POST)
Contacts
- List all contacts: /contacts/ (GET)
- Create a contact: /contacts/ (POST)
- Retrieve a contact: /contacts/{contact_id}/ (GET)
- Update a contact: /contacts/{contact_id}/ (PATCH)
Testing To run tests, use the following command: python manage.py test
Documentation This project is documented using Sphinx. To generate the documentation locally:
-
Install Sphinx: pip install sphinx
-
Generate the documentation: cd docs make html
-
Open the documentation: open _build/html/index.html
Contributing Feel free to open issues or submit pull requests if you'd like to contribute to the project.
License This project is licensed under the MIT License. See the LICENSE file for more details.