- Built in Go version 1.23.3
- Uses the chi router
- Uses alex edwards SCS seassion management
- Uses nsurf
The Bookings and Reservations System is a full-stack web application designed to simplify the booking process for customers and streamline reservation management for hotels. This project provides a seamless user experience, integrating a responsive front-end with a robust back-end.
- Go installed on your system.
- PostgreSQL database set up and running.
- Optional: MailHog installed for email testing.
-
Clone the repository:
git clone https://github.com/fuad7161/Golang cd Golang/cmd/web
-
Set up the environment variables for database connection:
- Update your PostgreSQL connection string in the application config.
-
Install required Go packages:
go mod tidy
-
Run the application:
go run .
-
Access the application in your browser at
http://localhost:8080
.
- HTML, CSS, JavaScript, and Bootstrap for building a responsive and user-friendly interface.
- Golang for server-side development.
- Key Libraries/Packages:
- Routing and Middleware:
github.com/go-chi/chi
,github.com/gorilla/mux
- Session Management:
github.com/alexedwards/scs/v2
- Validation:
github.com/asaskevich/govalidator
- CSRF Protection:
github.com/justinas/nosurf
- Database Handling:
github.com/jackc/pgx/v4
- Email Services:
github.com/xhit/go-simple-mail/v2
,github.com/mailhog
- Routing and Middleware:
- PostgreSQL for efficient data storage and management.
- Room_Restrictions - Stores room-specific restrictions (e.g., availability, maintenance).
- Room_reservations - Tracks the reservations made for rooms.
- Reservations - Stores the overall reservation details.
- Restrictions - General restrictions (e.g., date, booking limits).
- Room - Contains information about each room (e.g., type, capacity, price).
- User - Stores user information (e.g., name, email, password).
- MailHog for email testing.
- Static File Serving:
http.FileServer
for serving static assets. - Postman for API validation.
-
Home and Information Pages:
/
- Home page/about
- About us/contact
- Contact page
-
User Authentication:
/user/login
(GET, POST) - Login functionality/user/logout
- Logout endpoint
-
Room Reservations:
/reservation
(GET, POST) - Make a reservation/reservation-summary
- View reservation summary/search-availability
(GET, POST) - Search room availability/choose-room/{id}
- Choose a specific room/book-room
- Book a selected room
-
Static File Handling:
/static/*
- Serves static files (CSS, JS, images)
- Dashboard and Management:
/admin/dashboard
- Admin dashboard/admin/reservations-new
- View new reservations/admin/reservations-all
- View all reservations/admin/reservations-calendar
(GET, POST) - Manage reservations via calendar/admin/reservations/{src}/{id}
(GET, POST) - View and edit individual reservations
/addUser
(GET, POST) - Add a new user/show-all-User
- Display all users
For any inquiries or feedback, feel free to reach out:
- Email: [email protected]
- GitHub: https://github.com/fuad7161