Skip to content

Commit 2a52d5e

Browse files
authored
Merge pull request #86 from SPWwj/br-config
Br config
2 parents 66f8ceb + 5b63b1e commit 2a52d5e

File tree

3 files changed

+44
-11
lines changed

3 files changed

+44
-11
lines changed

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,25 @@ This project follows a microservices architecture with the following services:
1616
11. **Chat Service** (Located in addon/chat)
1717

1818
### Setting up the Project
19+
20+
### Running the Project with `start.sh`
21+
22+
A `start.sh` script is provided in the root directory to simplify setup. This script will start all services, check for any `.env.example` files, and create the required `.env` files if they don’t already exist.
23+
24+
To run the project, open a terminal in the `cs3219-ay2425s1-project-g25` directory and execute:
25+
26+
./start.sh
27+
28+
This script can be run on **Linux**, **macOS**, and **Windows** (with Git Bash or WSL). It will initialize all services and ensure the environment files are set up as needed.
29+
30+
Ensure the script has execute permissions. If needed, set them by running:
31+
32+
chmod +x start.sh
33+
34+
35+
This will initialize all services and ensure the environment files are set up as needed. Note that running `start.sh` requires Git Bash, WSL, or a similar terminal environment capable of executing Bash scripts.
36+
37+
### Manual Setup
1938
Copy and paste the .env.example files in each service. Rename them as .env files.
2039
Files to do this in:
2140
1. ./

addon/chat/Chatio/appsettings.Development.json

Lines changed: 0 additions & 11 deletions
This file was deleted.

start.sh

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/bin/bash
2+
3+
# Define the docker-compose files with relative paths
4+
COMPOSE_FILES=(
5+
"./docker-compose.yml"
6+
"./addon/chat/docker-compose.yml"
7+
)
8+
9+
# Start each docker-compose file
10+
for FILE in "${COMPOSE_FILES[@]}"; do
11+
if [ -f "$FILE" ]; then
12+
docker-compose -f "$FILE" up -d
13+
else
14+
echo "File not found: $FILE"
15+
fi
16+
done
17+
18+
# Copy .env.example to .env if .env does not exist
19+
find . -name ".env.example" | while read -r EXAMPLE_FILE; do
20+
ENV_FILE="${EXAMPLE_FILE%.example}"
21+
if [ ! -f "$ENV_FILE" ]; then
22+
cp "$EXAMPLE_FILE" "$ENV_FILE"
23+
echo "Created .env from .env.example at $ENV_FILE"
24+
fi
25+
done

0 commit comments

Comments
 (0)