A lightweight backend service built with modern Rust web technologies, ideal for full-stack or API-centric applications.


๐Ÿ“š GitHub Repository

Tools

Rust Version actix_web Version tokio version sqlx version serde version Build status

This project showcases a RESTful backend service built with the Actix-Web framework, ideal for handling fast, asynchronous HTTP operations.

It uses modern, production-ready Rust technologies like:

  • actix_web for the web server
  • tokio for async runtime
  • sqlx for SQL database interaction (with SQLite in this case)
  • serde for data serialization

๐Ÿ”ง Architecture Overview

Note Service is structured as a standalone binary crate designed to perform common backend tasks:

  • Asynchronous request handling
  • Persistent database support via SQLite
  • JSON serialization/deserialization
  • RESTful route definitions
  • Clean separation of logic and data access

๐Ÿš€ Features

  • โœ… Fully async using tokio and actix-web

  • ๐Ÿ“„ CRUD API for a simple note model:

    • GET /notes
    • GET /notes/{id}
    • POST /notes
    • PUT /notes/{id}
    • DELETE /notes/{id}
  • ๐Ÿ—ƒ๏ธ Database abstraction via sqlx

  • ๐Ÿงช Ready-to-run with migrations and seed setup

  • ๐Ÿงผ Structured error handling and API responses


โš™๏ธ Installation & Setup

1. Install Rust (if not already):

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

2. Install sqlx CLI:

cargo install sqlx-cli --features sqlite

3. Prepare the database:

cargo sqlx prepare
cargo sqlx migrate run

4. Run the server:

cargo build
cargo run

5. Open your browser:

http://127.0.0.1:8080

๐ŸŒ API Endpoints

MethodEndpointDescription
GET/notesList all notes
GET/notes/{id}Get a specific note
POST/notesCreate a new note
PUT/notes/{id}Update an existing note
DELETE/notes/{id}Delete a note

๐Ÿ’ก Use Cases

  • As a lightweight backend for a frontend SPA (e.g., Yew, React)
  • Great for learning real-world Actix patterns
  • Boilerplate for full-stack Rust apps with WebAssembly frontend

๐Ÿ“„ License

This project is licensed under the MIT License โ€” free for personal or commercial use.