This RESTful API for a task management system leverages a Vector Retrieval System for efficient search and retrieval. It allows users to manage tasks with features like creation, update, deletion, and a powerful search functionality based on task similarity.
- CRUD operations for task management.
- Automatic vector representation generation for tasks.
- Search functionality using vector similarity.
- Token-based authentication.
- Pagination for list retrieval.
- Custom permissions for task operations.
- Django & Django REST Framework
- Sentence Transformers for Vector Representation
- SQLite
- Python 3.10
- pip
- conda (optional)
- Clone the Repository
git clone https://github.com/tejangupta/taskvectorapi.git cd taskvectorapi - Set up a Virtual Environment (Optional but recommended)
conda create -n taskenv python=3.10 -y
- Install Dependencies
pip install -r requirements.txt
- Initial Database Setup
python manage.py makemigrations python manage.py migrate
- Create Superuser (Optional, for admin access)
python manage.py createsuperuser
- Run the Server
python manage.py runserver
Access the API endpoints via http://localhost:8000/api/
Endpoints include:
GET /api/tasks/- List all tasksPOST /api/tasks/- Create a new taskGET /api/tasks/{id}/- Retrieve a specific taskPUT /api/tasks/{id}/- Update a taskDELETE /api/tasks/{id}/- Delete a taskGET /api/tasks/search/{query}/- Search tasks
- Vector Representation: Used Sentence Transformers for efficient and accurate text embeddings.
- Authentication: Token-based for simplicity and effectiveness.
- Pagination: Implemented to handle large numbers of tasks efficiently.
- Permissions: Custom permissions ensure only owners can modify their tasks.
Run unit tests using:
python manage.py test tasks