Skip to content

mithesh06/airbnb_backend_clone

Repository files navigation

Airbnb Backend API

This repository contains a Rust backend API built with Actix-web and Diesel ORM for an Airbnb-like reservation system. It uses PostgreSQL as the database.


Features so far

  • User signup/signin (under /users)
  • Listing creation and retrieval (under /listings)
  • Reservation creation with conflict detection (under /reservations)
  • PostgreSQL database connection with Diesel
  • Dockerized with multi-stage Dockerfile for Rust + PostgreSQL
  • Basic error handling and idempotency support for reservations

Running the API (Without docker)

  1. Clone this repository
git clone https://github.com/mithesh06/airbnb_backend_clone.git
cd airbnb
  1. Setup the DB as required

  2. Run the program

cargo run

Running the API (With docker)

  1. Clone this repository
git clone https://github.com/mithesh06/airbnb_backend_clone.git
cd airbnb
  1. set up docker
docker compose up -d

Testing

  • Run tests to see if everyhting works as intended
cargo test

API Endpoints

Users

POST /users/signup - Signup a new user

POST /users/signin - Signin existing user

Listings

POST /listings/ - Create a new listing

GET /listings/{id} - Get listing by ID

Reservations

POST /reservations/ - Create a reservation (handles conflicts and calculates amount)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published