Skip to content

reza72rg/TodoApp

Repository files navigation

Todo List Program

License: MIT

This is a Todo List program built with Django, which allows users to record and manage their daily tasks. The program provides a user-friendly interface to prevent forgetting important tasks. It also includes a REST API to retrieve data from the program. The project is Dockerized for easy deployment and management.

Features

  • Todo List Management: Users can create, update, and delete tasks in their todo list.
  • User Authentication: The program uses the Django AbstractBaseUser to customize the user model, providing secure user authentication.
  • Docker Support: The project includes a Docker structure for easy deployment and management.
  • API Support: The app includes a REST API that allows users to interact with the app's functionality programmatically. The API documentation can be found at http://127.0.0.1:8000/swagger/.
  • Email Verification: The app uses the smtp4dev element in the Docker file format to send emails and verify user accounts.
  • Testing: The app includes unit tests written with pytest to ensure the correctness of different parts of the app.
  • Random Data Generation: The app utilizes the faker library to create random data for testing and populating the database.
  • Performance Testing: The app includes an API tolerance threshold that allows testing the performance using artificial traffic generated by Locust. The performance testing can be accessed at http://127.0.0.1:8089/.
  • Background Tasks: The app explores the use of background tasks in Django projects by integrating with Brokers like Redis and using the Celery module to create and manage different tasks.
  • Caching: The app implements caching of information in different views using Redis to improve performance.

Installation

  1. Clone this repository to your local machine:

bash git clone https://github.com/reza72rg/TodoApp

  1. Install the required dependencies:

bash pip install -r requirements.txt

  1. Set up the database by running migrations:

bash python manage.py migrate

  1. Start the development server:

bash python manage.py runserver

  1. Open the program in your web browser at http://127.0.0.1:8000.

  2. Build the Docker image by running the following command in the base directory:

     docker build -t todoapp .
    
  3. Once the image is built, you need to run the container. Use the following command:

     docker-compose up --build.
    

API Documentation

The API documentation can be found at http://127.0.0.1:8000/api/v1/ and http://127.0.0.1:8000/accounts/api/v1/, providing details on how to interact with the REST API endpoints.

Contributing

Contributions are welcome! If you have any suggestions, bug reports, or feature requests, please open an issue or submit a pull request.

License

This project is licensed under the MIT License.

Acknowledgements

  • Special thanks to [Ali Bigdali] for their assistance and feedback during the development of this project.

Performance Testing

Using Locust, the API tolerance threshold is created and its performance is checked by generating artificial traffic on the site. It can be tested at the address http://127.0.0.1:8089/.

Features

  • Django LTS
  • Function Based View
  • Django RestFramework
  • User authentication
  • Black
  • Flake8
  • Responsive Design
  • Bootstrap5

options

Project it self has the user creation form but still in order to use the admin you need to create a super user.you can use the createsuperuser option to make a super user.

python manage.py createsuperuser

And lastly let's make the App run. We just need to start the server now and then we can start using our simple todo App. Start the server by following command

python manage.py runserver

Once the server is up and running, head over to http://127.0.0.1:8000 for the App.

Reformat and check

If you want your code to be check by pep8 and all the guide lines, there are two packages added to requirements in order to check and reformat code. you can use it by this command:

black -l 79 . && flake8

Database schema

A simple view of the project model schema.

database schema

Todo

  • refactor javascript codes in list.html
  • leave comments for codes
  • add unit tests
  • add heroku config files
  • complete the documentation
  • create a video tutorial

Bugs or Opinion

Feel free to let me know if there are any problems or any request you have for this repo.

About

Todo App with CBV And rest Api

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published