This is a .NET Web API backend for a hotel/restaurant booking application. It provides APIs for user management, restaurant management, and booking management.
- User Management: Login, Registration
- Restaurant Management: List, Add, Update, Delete
- Booking Management: Create, View, Cancel Bookings
- .NET SDK installed
- A database (e.g., SQL Server, PostgreSQL, etc.)
- Clone the repository.
- Navigate to the project directory.
- Add a
.env
file with the required environment variables (see.env
section below). - Restore dependencies:
dotnet restore
- Run the application:
dotnet run
Create a .env
file in the project root with the following variables:
DB_CONNECTION_STRING=your_database_connection_string
JWT_SECRET=your_jwt_secret
- User Management
POST /api/users/register
: Register a new userPOST /api/users/login
: Login a user
- Restaurant Management
GET /api/restaurants
: List all restaurantsPOST /api/restaurants
: Add a new restaurantPUT /api/restaurants/{id}
: Update a restaurantDELETE /api/restaurants/{id}
: Delete a restaurant
- Booking Management
POST /api/bookings
: Create a new bookingGET /api/bookings
: View all bookingsDELETE /api/bookings/{id}
: Cancel a booking