This project is a Wedding Reservation API built using Rust.
- RESTful API: Provides endpoints for managing wedding reservations.
- Database Integration: Employs SeaORM for seamless database interactions.
- Authentication: Authentication and Middleware
- CORS Handling: Handling CORS with Tower HTTP CorsLayer
- API Docs: OpenAPI Swager Ready
- Object Storage: Integrated with Minio
- Rust: Ensure that Rust is installed on your system. You can install it from rust-lang.org.
- Database: Set up a SurrealDB database and note the connection details, You can install it from surrealdb.com
- Docker: if you want build this project using docker, you need docker, You can install it from docker.com
- Nix: if you want build this project using nix, you need nix, You can install it from nixos.org
-
Clone the Repository:
git clone https://github.com/maulanasdqn/wedding-api.git cd wedding-api
-
Set Up Environment Variables:
Copy a
.env.exanple
file:cp .env.example .env
-
Install Dependencies:
cargo build --release
cargo install sea-orm-cli
-
Run Database Migrations:
sea-orm-cli -d .migration migrate up
-
Start the Server:
cargo run -p api --release
The API will be accessible at
http://localhost:3000/api/docs
.
-
Build the Docker Image:
docker build -t wedding-api .
-
Run the Docker Container:
docker run -p 3000:3000 --env-file .env wedding-api wedding-api:latest
The API will be accessible at
http://localhost:3000/api/docs
.
-
Install Nix:
curl -L https://nixos.org/nix/install | sh
-
Switch to Nix Shell or Nix Flake:
nix develop
-
Build the Project:
nix build
-
Run the Server:
nix run
- API Docs
http://localhost/3000/api/docs
- Get Reservations
http://localhost:3000/api/reservations
- Create Reservation
http://localhost:3000/api/reservations/create
- Upload Files
http://localhost:3000/api/upload
Contributions are welcome! Please fork the repository and create a pull request with your changes.
This project is licensed under the MIT License. See the LICENSE file for details.