This project is a simple CRUD (Create, Read, Update, Delete) API implemented in Rust using the Actix Web framework and the Diesel ORM for interacting with a PostgreSQL database. It provides basic functionalities to manage samples data, including creating, retrieving, updating, and deleting sample records.
Before getting started, make sure you have the following installed on your system:
- Install Diesel CLI:
cargo install diesel_cli --no-default-features --features "postgres"
- Set up the database:
- Start the PostgreSQL database using Docker:
docker-compose up -d
- Create the database schema:
diesel setup
- Set environment variables:
- Create a .env file in the root directory and add the following content with your desired database credentials:
DATABASE_URL=postgres:https://your-db-user:your-db-password@localhost/sampledb
- Build and run the API using Cargo:
cargo run
- Refer the postman collection json in the root directory for all the details