This guide will help you set up the Global Connect project on your local machine for development and testing purposes. Follow the steps below to get started.
Before you begin, ensure you have the following installed on your machine:
First, clone the Global Connect repository from GitHub:
git clone https://github.com/KOSASIH/Global-Connect.git
cd Global-Connect
Navigate to the backend directory and install the required dependencies:
cd backend
npm install
Create a .env
file in the backend
directory and add the following environment variables:
PORT=5000
MONGODB_URI=mongodb://localhost:27017/global_connect
REDIS_URL=redis://localhost:6379
JWT_SECRET=your_jwt_secret
Make sure to replace your_jwt_secret
with a secure secret key.
You can start the backend server using the following command:
npm start
The backend server should now be running on http://localhost:5000
.
Navigate to the frontend directory and install the required dependencies:
cd ../frontend
npm install
In the frontend/src/services/api.js
file, ensure that the API base URL points to your backend server:
const API_BASE_URL = 'http://localhost:5000/api';
You can start the frontend application using the following command:
npm start
The frontend application should now be running on http://localhost:3000
.
If you want to use Redis for caching, ensure that Redis is installed and running on your machine. You can start Redis with the following command:
redis-server
Open your web browser and navigate to http://localhost:3000
to access the Global Connect application. You should see the homepage, and you can start interacting with the features.
To run the tests for the backend and frontend, you can use the following commands:
Navigate to the backend directory and run:
npm test
Navigate to the frontend directory and run:
npm test
If you prefer to run the application using Docker, you can use the provided docker-compose.yml
file. Make sure Docker is installed and running, then execute the following command in the root directory of the project:
docker-compose up
This will start both the backend and frontend services in Docker containers.
You have successfully set up the Global Connect project on your local machine. You can now explore the features, contribute to the codebase, and help improve the project. If you encounter any issues, please refer to the documentation or reach out to the maintainers for assistance.
Happy coding!