Skip to content

emresha/fastapi-todolist

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FastAPI "To Do" Web Application

Short Description

This is a small todo project for testing out FastAPI capabilities and gaining the experience necessary to work with web applications using front and back -end communication via frontend's JavaScript's fetches.
This is also my university-related project.
I know this project probably has massive security-related (and not only security-related) issues, which I might fix later, however, if you wish (for some reason) to point some of them out to me, don't be shy and create an Issue. I might take a look at it at some point.

How To Run

No matter the system you use, you must have 'uvicorn' and python 3.10+ installed.
If something isn't installed, pip install "fastapi[all]" should do the trick.
(Next time I will try to understand how Docker works to make it easier for everybody, but for now this will have to do).
Clone the repository wherever you want: git clone https://github.com/emresha/fastapi-todolist.git
Open terminal in the project's root folder and type:
uvicorn main:app --reload
This will start the server on localhost:8000.
Now open up your favourite browser and go to the address mentioned above.
That's basically it. The frontend is pretty intuitive.
By the way, python3 main.py or python main.py will work as well.
That's it. Thanks:)

How It Works

Basically, you have a backend.
When you try to go the "/", you will first be redirected to "/login" and asked to sign in OR to log in, since you don't have an active session (yes, I am using cookies for this). Then you log in or register (after registration you will be asked to log in) and you are once again redirected back to "/", where you will have your tasks! Your session lasts exactly 3600 seconds === 1 hour. After that you will be asked to log in.
To add a task you simply click on a button on the right bottom corner (which is a plus sign) and write in a title and a description and then press "Add".
Now you have your first task, and you can mark it as complete using the "Mark As Done" button. Complete tasks can be once again marked as incomplete using the "Mark As Undone" button.
You can log out using the button in the bottom left corner.

That's basically it.

What Was Used

  • Python 3.10;
  • SQLite;
  • SQL requests;
  • CSS;
  • HTML;
  • JavaScript;
  • .svg images.

Maybe I will do this later

  • Make the application safer to use;
  • Add the ability to edit the ToDos;
  • Add a profile page;
  • Show completed ToDos at the end;
  • Code style changes;
  • Use Jinja HTML templates.

About

A small todo project made using FastAPI

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published