Skip to content

RaviKumarYadav15/train-booking-app-docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Train Booking App (MERN + MySQL + Docker)

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.


Prerequisites

  1. Docker Desktop installed and running
  2. Git installed

How to Run

1. Clone the Repository

Open your terminal (or VS Code terminal) and run:

git clone https://github.com/RaviKumarYadav15/train-booking-app-docker

2. Enter the Project Folder

cd train-booking-app

Then install all the dependencies for both client and server:

cd client
npm install
cd ../server
npm install

3. Start the App

This single command builds and starts the Frontend, Backend, and Database all at once:

cd ..
docker-compose up --build

4. Open the Application

Once 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

Database Access (Optional)

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 3307 is used to avoid conflicts if MySQL is already running on your machine.

Database access in command panel

write this access

  docker exec -it my-sql-container mysql -u root -p
  password> password

How to Stop

Pause the app:

Ctrl + C

Remove containers completely:

docker-compose down

To delete the volume also : write this:

docker-compose down -v

Thanks....

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages