Skip to content

dcodesdev/next-rust-todolist

Repository files navigation

Next Rust Todo list app

Next Rust Todo list app

This project is a simple todo list app written in Rust. It is a learning project for me to learn Rust.

How to run

  • Install the sqlx-cli for postgres:

    cargo install sqlx-cli --no-default-features --features postgres
  • Create a .env file in the apps/rust-server folder and add the following:

    DATABASE_URL="postgresql://postgres:password@localhost:5432/next-rust-todolist"

    Replace the postgres and password with your own postgres username and password and choose a database name of your choice.

  • Run a postgres server, the easiest way is to use docker:

    docker run --name postgres -e POSTGRES_PASSWORD=password -p 5432:5432 -d next-rust-todolist
  • Create the database:

    pnpm db:create
  • Apply the migrations

    pnpm migrate:run
  • Run the app:

    pnpm dev
  • Run server only (optional)

    pnpm dev:server
  • Run web only (optional)

    pnpm dev:ui
  • Create a migration

    pnpm migrate:create "<migration-name>"

Note: Sqlx requires the database to be running when compiling the Rust server, so make sure to run the postgres server before running pnpm dev or pnpm dev:server. To read more about sqlx and how to use it, check out the sqlx docs.

Progress

Rust Backend

  • Authentication (JWT)
  • Register/Login
  • Create a todo list
  • Update a todo list
  • Get all todo lists
  • Delete a todo list
  • Get a todo list details
  • Add a todo item
  • Remove a todo item
  • Update a todo item
  • Get all todo items

UI

  • Home page
  • Register/Login pages
  • Create a todo list
  • Add a todo item
  • Remove a todo item
  • Set a todo item as done

Apps

License

This project is licensed under the MIT License.