This Rust-based Restaurant Management Backend API is designed to streamline restaurant operations through a server-client architecture. The application server, built with the Warp framework, handles HTTP routes, database interactions using SQLite, and includes comprehensive unit tests to ensure reliability. The client server simulates multiple asynchronous requests to test the system's responsiveness. By leveraging Rust's safety and concurrency features, this project aims to replicate restaurant operations.
- tokio: An asynchronous runtime for Rust, enabling concurrent tasks and I/O operations with support for async/await syntax.
- rusqlite: A SQLite database library for Rust, providing a bundled version for ease of use and integration.
- warp: A web server framework for Rust, designed for building fast and reliable HTTP APIs.
- serde: A serialization and deserialization library for Rust, allowing easy conversion of data structures to and from JSON with derive macros.
- serde_json: A JSON parsing and serialization library for Rust, working seamlessly with Serde for efficient JSON handling.
- main.rs: Sets up a basic web server by initializing the database, combining HTTP routes from the routes module, starting the Warp server, and adding request tracing for incoming requests.
- models.rs: Defines the data models and their associated functions
- routes.rs: Defines the HTTP routes for a restaurant management API
- db.rs: Includes functions for database initialization and regular DB connection usage
- handlers.rs: Defines the handlers for various operations and also includes unit tests.
- main.rs: This file simulates a client generating multiple asynchronous requests to the restaurant (i.e. application server)
- Change to Project Directory:
cd application_server
- Install Dependencies:
cargo build
- Run the unit test cases:
cargo test
- Run the project:
cargo run
- Change to Project Directory:
cd client_server
- Install Dependencies:
cargo build
- Run the project:
cargo run