- Django for the backend application structure and ORM.
- Django Rest Framework for RESTful APIs.
- djangorestframework-simplejwt for JWT authentication.
- drf-spectacular for API endpoints schema.
have used
APPEND_SLASH=False, so add/to end of the endpoint is prohibited.
- API Endpoints Schema
/api/docs
- GET /api/users: Retrieve a list of authenticated users.
- POST /api/users/register: Create a new user.
- POST /api/users/login: Authenticate a user and return pair token.
- GET /api/users/{user_uid}: Retrieve details of a specific user.
- PATCH /api/users/{user_uid}: Allow users to update their own information.
- DELETE /api/users/{user_uid}: Allow users to delete their account.
- POST /api/users/token/refresh: Generate a new access token.
- GET /api/projects: Retrieve a list of all projects.
- POST /api/projects: Create a new project.
- GET /api/projects/{project_uid}: Retrieve details of a specific project.
- PATCH /api/projects/{project_uid}: Update project details.
- DELETE /api/projects/{project_uid}: Delete a project.
- GET /api/projects/{project_uid}/tasks: Retrieve a list of all tasks in a particular project.
- POST /api/projects/{project_uid}/tasks: Create a new task in a project.
- GET /api/tasks/{task_uid}/comments: Retrieve a list of all comments on a task.
- POST /api/tasks/{task_uid}/comments: Create a new comment on a task.
- GET /api/tasks/{task_uid}: Retrieve details of a specific task.
- PATCH /api/tasks/{task_uid}: Update task details.
- DELETE /api/tasks/{task_uid}: Delete a task.
- GET /api/comments/{comment_uid}: Retrieve details of a specific comment.
- PATCH /api/comments/{comment_uid}: Update comment details.
- DELETE /api/comments/{comment_uid}: Delete a comment.
>> git clone https://github.com/imrand-dev/teamcollab-backend.git
>> cd teamcollab-backendIf your version does not match mine (Python 3.12), follow these steps to update the project configuration.
- Update Pipfile:
- Open
Pipfilefrom your project directory. - Change the "python_version" to "3.10" in the "[requires]" section.
[requires] python_version = "3.10"
- Open
- Update Pipfile.lock:
- Open
Pipfile.lockfrom your project directory. - Change the "python_version" in the "requires" section to "3.10".
"requires": { "python_version": "3.10" },
- Open
- After making changes to the "Pipfile", regenerate the "Pipfile.lock" using
pipenv lockcommand.
Before creating a virtual environment, make sure you've already installed pipenv globally on your machine.
>> pipenv install (To create a new virtual env)
>> pipenv shell (To activate the virtual env)Although when you run pipenv install this command for the first time to create a virtual environment, all project dependencies are also installed inside the new environment.
So run this command kinda optional pip install -r requirements/developemt.txt.
- Enter the main project directory
cd projectile. - There you'll see
.env.examplefile, rename it to.envand fill out all the fields.
I've used SQLit3 as default database, so when you run python manage.py migrate this command, all tables will be stored in sqlite database.
>> python manage.py makemigrations
>> python manage.py migrateI've already added a command that will generate a superuser with predefined fields.
>> python manage.py superuser- Then use this email and password
- Email - johnsnow@gmail.com
- Password - 123456
If you want to create a superuser on your own, run this command instead.
python manage.py createsuperuser>> python manage.py runserverThis command will start the development server, now open your browser and got to http://127.0.0.1:8000/api/projects to see all projects.
Go to http://127.0.0.1:8000/admin/ and log in with the superuser credentials you created. This will allow you to manage users, tasks and other data using the Django admin interface.
Contributions are welcome! Please fork this repository and submit pull requests to contribute to the development of this project.
This project is licensed under the MIT License - see the LICENSE file for details.