A Rust backend service for managing notes, using Rust, Salvo, PosgreSQL and Docker.
- RESTful API for notes (add, get, delete)
- JWT-based authentication
- PostgreSQL database integration
- Dockerized for easy deployment
.
├── .env # Environment variables
├── Cargo.toml # Rust dependencies and metadata
├── compose.yml # Docker Compose configuration
├── Dockerfile # Docker build instructions
├── migrations/ # SQL migrations for database setup
│ └── 1_create_notes_table.up.sql
├── src/
│ └── main.rs # Main application source
└── README.md # Project documentation
Docker compose will manage everything for you
docker compose up --build-
Clone the repository:
git clone git@github.com:JooNiv/portfolio-backend.git cd portfolio-backend -
Configure environment variables:
- Copy
.env.exampleto.envand update values as needed.
- Copy
-
Run with Docker Compose:
docker compose up --build
-
Run locally (without Docker):
cargo run
POST /login- Authenticate and receive a JWTGET /login- Check validity of JWTPOST /notes- Add a new note (requires JWT)GET /notes- Retrieve all notesDELETE /notes/:id- Delete a note by ID (requires JWT)