A simple, containerized Train Booking System. It uses React for the frontend, Node.js/Express for the backend, and MySQL for the database. Everything runs inside Docker, so you don't need to install MySQL or Node locally.
- Docker Desktop installed and running
- Git installed
Open your terminal (or VS Code terminal) and run:
git clone https://github.com/RaviKumarYadav15/train-booking-app-dockercd train-booking-appThen install all the dependencies for both client and server:
cd client
npm installcd ../server
npm installThis single command builds and starts the Frontend, Backend, and Database all at once:
cd ..
docker-compose up --buildOnce you see Server running... or ready for connections in the terminal, open your browser:
| Service | URL |
|---|---|
| Frontend | http://localhost:5173 |
| Backend API | http://localhost:5000 |
The database is automatically created on startup. If you want to inspect the data using a tool like MySQL Workbench, use these credentials:
| Setting | Value |
|---|---|
| Host | 127.0.0.1 |
| Port | 3307 |
| Username | root |
| Password | password |
| Database | train_db |
Port
3307is used to avoid conflicts if MySQL is already running on your machine.
write this access
docker exec -it my-sql-container mysql -u root -p
password> passwordPause the app:
Ctrl + CRemove containers completely:
docker-compose downTo delete the volume also : write this:
docker-compose down -vThanks....