Hi, welcome to todo-site. This is a revolutionary todo site tailored for the future you. On todo-site, you are able to log in, create projects, and within them create todos. Todo-site is created and maintained by:
- Logi Sigurðarson - Github /lsig
- Kristófer Fannar Björnsson - Github /kristoferfannar
Our Todo app consists of a frontend, backend and database. We decided against choosing the default tech-stack (flask), and instead wanted to get a bit more creative, as we enjoy learning new technologies and making our app our own.
For our frontend, we decided to choose the popular reactjs framework built on javascript, which we run with vitejs. However, instead of using regular javascript, we chose to go with typescript, as it provides a much better developer experience with more robust code.
For styling, we went with tailwindcss, as it offers layers on top of css which makes styling much more user friendly, easier to manage, more consistant and removes redundancy.
For our backend, we went with the revolutionary rust programming language, which is set to take over the world soon enough. Our backend framework for building an http api in rust was actix-web, and to connect to our database we used sqlx. To run our backend, we dockerized it.
For our database we used a Postgresql Docker image, which we set up on port 6432 and created a volume for persisting data.
To run our database and backend, you are required to have docker set up and running on your system. If you are reading this, you likely have docker already setup, but in case you don't, here is the official docker website. Try it out, it's really cool.
When you have docker setup and running, simply go to this directory and type in a terminal docker-compose up
. This command will run the docker-compose.yaml file in the same directory, which will boot up the entire frontend + backend + database for you.
The frontend runs on port:5173, the backend runs on port:8080 and the database container runs on port:6432. So make sure these ports are not in use!
All our backend endpoints start with the prefix /api, as is common in backend development. The backend's version is then added as the next route, which is /v1 here.
The port used for the backend is 8080
Get all users:
GET :8080/api/v1/users
Get user by id:
GET :8080/api/v1/users/{user_id}
Create new user
POST :8080/api/v1/users
body : {
username: str
password: str
}
Login user
POST :8080/api/v1/login
body : {
username: str
password: str
}
View all projects for a specific user
GET /api/v1/users/{user_id}/projects
View project by id for a specific user
GET /api/v1/users/{user_id}/projects/{project_id}
Create project for specific user
POST /api/v1/users/{user_id}/projects
body : {
project_name: str
}
Update project by id for a specific user
PATCH /api/v1/users/{user_id}/projects/{project_id}
body : {
?project_name: str
}
Delete project by id for a specific user
DELETE /api/v1/users/{user_id}/projects/{project_id}
Get all todos in a specific project for a specific user
GET /api/v1/users/{user_id}/projects/{project_id}/todos
Get todo by id in a specific project for a specific user
GET /api/v1/users/{user_id}/projects/{project_id}/todos/{todo_id}
Create todo in a specific project for a specific user
POST /api/v1/users/{user_id}/projects/{project_id}/todos
body : {
title: str,
?description: str,
priority: int,
?completed: bool,
?due_date: date,
}
Update todo by id in a specific project for a specific user
PATCH /api/v1/users/{user_id}/projects/{project_id}/todos/{todo_id}
body : {
?title: str,
?description: str,
?priority: int,
?completed: bool,
?due_date: date,
}
Delete todo by id in a specific project for a specific user
DELETE /api/v1/users/{user_id}/projects/{project_id}/todos/{todo_id}
For creating our database tables, we have a migration script inside of ./backend/migrations/. In that script, all tables are created with relationships and some initial data.
All database queries are kept inside ./backend/src/routes/{projects,todos,users}.rs. There, we have implemented various CRUD queries used by our application.
This project is group 90's submission for Kobenhavns Universitet's Databases and Information Systems course for the spring 2023 semester. Course information can be found here.