https://github.com/hmzelidrissi/hotel-reservation-system-api
This is a simple hotel reservation system backend API. It is built using the Gin web framework and MongoDB as the database. The API provides endpoints for customers to book rooms and get reservations, and for admins to manage rooms and reservations. The API also provides authentication and authorization using JWT tokens.
https://github.com/hmzelidrissi/hotel-reservation-system-api
gin-framework gin-gonic go golang
Last synced: 5 months ago
JSON representation
This is a simple hotel reservation system backend API. It is built using the Gin web framework and MongoDB as the database. The API provides endpoints for customers to book rooms and get reservations, and for admins to manage rooms and reservations. The API also provides authentication and authorization using JWT tokens.
- Host: GitHub
- URL: https://github.com/hmzelidrissi/hotel-reservation-system-api
- Owner: HMZElidrissi
- Created: 2024-05-17T22:21:10.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-06-09T14:48:25.000Z (about 2 years ago)
- Last Synced: 2025-02-01T17:44:19.286Z (over 1 year ago)
- Topics: gin-framework, gin-gonic, go, golang
- Language: Go
- Homepage:
- Size: 7.88 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Hotel reservation backend
## Project environment variables
```
HTTP_LISTEN_ADDRESS=:3000
JWT_SECRET=somethingsupersecretthatNOBODYKNOWS
MONGO_DB_NAME=hotel-reservation
MONGO_DB_URL=mongodb://localhost:27017
MONGO_DB_URL_TEST=mongodb://localhost:27017
```
## Project outline
- customers -> book rooms, get reservations
- admins -> manage rooms and reservations
- Authentication and authorization -> JWT tokens
- Rooms -> CRUD API -> JSON
- Reservations -> CRUD API -> JSON
- Scripts -> database management -> seeding, migration
## Installation
- Clone the repository: `git clone https://github.com/HMZElidrissi/hotel-reservation-system-api.git`
- Define the environment variables in a `.env` file: `cp .env.example .env`
- Run `make deps` to install dependencies
- Run `make run` to start the server
- To run tests, run `make test`
## Technologies Used
### Mongodb driver
Documentation
```
https://mongodb.com/docs/drivers/go/current/quick-start
```
Installing mongodb client
```
go get go.mongodb.org/mongo-driver/mongo
```
### Gin Web Framework
Documentation
```
https://gin-gonic.com
```
Installing gin
```
go get github.com/gin-gonic/gin
```
## To DO
- [x] Test Customer handlers
- [ ] Test Admin reservation handlers
- [ ] Test Admin room handlers
- [ ] Scripts -> database management -> seeding, migration