Skip to content

igorksk/HotelBookingApp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Hotel booking app built with ASP.NET Core (backend) and React + TypeScript (frontend). Uses an in-memory database for quick testing and Docker for easy deployment.

Architecture

  • Backend: ASP.NET Core (C#) — project located at backend/HotelBookingApi
  • Frontend: React + TypeScript — project located at frontend/hotel-booking-app

Prerequisites

  • .NET 8 SDK (for local backend run)
  • Node.js (18+) and npm or yarn (for frontend)
  • Docker & Docker Compose (for containerized run)

Run locally (development)

  1. Backend (run from PowerShell):
cd backend/HotelBookingApi dotnet restore dotnet run

The backend listens on port 7263 by default in this repository.

  1. Frontend (run from PowerShell):
cd frontend/hotel-booking-app npm install npm start

The frontend dev server runs on port 3000 and expects the API at http://localhost:7263 (the app uses REACT_APP_API_URL environment variable).

Run with Docker Compose

From repository root:

docker-compose up --build

This will start two services:

  • Frontend on host port 3000 → container 3000
  • Backend on host port 7263 → container 7263

Inside Docker the frontend communicates with the backend at http://backend:7263 (configured in docker-compose.yml).

API overview Common endpoints (see backend/Controllers):

  • GET /api/countries
  • GET /api/cities
  • GET /api/hotels
  • GET /api/rooms
  • GET/POST /api/bookings

Explore the controllers in backend/Controllers for full details and request/response DTOs in backend/DTOs.

Database / Seed data The project uses an in-memory database for quick testing and includes seeding logic in backend/Data/SeedData.cs. When the backend starts in development, sample data is automatically created.

Common tasks

  • Build backend: dotnet build (run inside backend/HotelBookingApi)
  • Run frontend build: npm run build (inside frontend/hotel-booking-app)
  • Rebuild Docker images: docker-compose build --no-cache

Troubleshooting

  • If ports are in use, stop conflicting services or change ports in docker-compose.yml and Program.cs.
  • If frontend cannot reach API when running outside Docker, ensure REACT_APP_API_URL points to http://localhost:7263.

Contributing Feel free to open issues or add PRs. Keep changes focused and include steps to reproduce when reporting bugs.


If you'd like, I can add example requests for each endpoint, or a quick Postman collection — tell me which you'd prefer.

About

Hotel booking app built with ASP.NET Core (backend) and React + TypeScript (frontend). Uses an in-memory database for quick testing and Docker for easy deployment.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors