This project includes a Node.js backend application with Sequelize and a React frontend application. Both projects are configured to work together using Docker and Docker Compose.
server/
- Contains the Node.js backend application.client/
- Contains the React frontend application.
Before you begin, ensure you have the following installed:
-
Configure the
.env
FileCreate a
.env
file in the root of the backend project with the following variables:DB_USER=your_username
DB_PASSWORD=your_password
DB_SERVER=sqlserver
DB_NAME=your_database
-
Build and Run Containers
Navigate to the backend project folder:
cd server
Then, build and run the containers using Docker Compose:
docker-compose build
docker-compose up
This will start the backend application and the SQL Server container.
-
Configure Environment Variables Create a .env file in the root of the frontend project with the following variable:
REACT_APP_API_URL=http://localhost:PORT/api
Ensure the URL matches the backend exposed by Docker.
-
Build and Run the React Application
Navigate to the frontend project folder:
cd client
Then, build and run the React application using Docker Compose:
docker-compose build
docker-compose up
The React application will be available at http://localhost:3000.