- Git: Install Git on your local machine.
- Node.js: Install Node.js (preferably the LTS version).
- Create a folder named
IPMSon your local machine.
-
Open the Command Prompt (CMD), navigate to the
IPMSfolder, and run:git clone https://github.com/IPMS-Project/IPMS.git
- After cloning, you will see the
clientandserverfolders under theIPMSdirectory.
- Open the
IPMSfolder in Visual Studio Code.
-
Open terminals for both
clientandserverfolders. -
Run the following command in each folder:
npm install
-
After installation, a
node_modulesfolder will appear in bothclientandserverdirectories.
-
Navigate to the
serverfolder and run:npm start
-
This will start the server and connect to MongoDB.
-
Navigate to the
clientfolder and run:npm start
-
This will open a page on port 3000.
-
The displayed page is a sample page to verify that the client is running (not the final product).
- If you see a
"Failed to create user"error, the server might not be running. - Ensure the server is started before trying to create a user.
- Download and install MongoDB Community Edition from here.
- Follow the installation instructions for your operating system.
- Make sure the MongoDB service is running.
- The project uses a local MongoDB database.
- Default connection string:
mongodb://localhost:27017/IPMS
- Download and install Studio 3T from here.
- Open Studio 3T and create a new connection to
mongodb://localhost:27017. - Use Studio 3T to view, query, and manage your database.
- Follow the steps carefully to set up your environment.
- If you encounter issues, refer to the troubleshooting section.
- Ensure you are working on the latest version of the repository.
The project uses GitHub Actions for automated testing and deployment. The workflow is configured in .github/workflows/main.yml.
-
Continuous Integration (CI):
- Runs on every push to main branch and pull requests
- Installs dependencies for both frontend and backend
- Builds the frontend application
- Verifies that both frontend and backend can be built successfully
-
Continuous Deployment (CD):
- Automatically deploys to the server when changes are pushed to main
- Only runs on pushes to main (not on pull requests)
- Deploys both frontend and backend code
- Restarts the application on the server
-
For Regular Development:
- Create a new branch for your feature/devlopment
- Make your changes
- Create a pull request to feature/devlopment
- now review all the changes and merge into feature branch
- Create a pull request to main from feature branch
- The CI workflow will run automatically to verify your changes
- Important: Always keep your branch updated with the latest changes from the target branch before creating a pull request:
git checkout your-branch git fetch origin git merge origin/feature # or origin/main # Resolve any conflicts and then push git push origin your-branch
-
For Deployment:
- Push your changes to main
- The CD workflow will automatically deploy to the server
The following secrets need to be set up in your GitHub repository:
SERVER_HOST: Server IP address or hostnameSERVER_USERNAME: SSH usernameSERVER_PASSWORD: SSH passwordPROJECT_PATH: Path to project on server
To set up secrets:
- Go to your GitHub repository
- Click "Settings"
- Click "Secrets and variables" → "Actions"
- Click "New repository secret"
- Add each secret with its corresponding value
- If the workflow fails, check the "Actions" tab in your repository
- Common issues:
- Missing dependencies in package.json
- Build errors in the frontend
- Server connection issues
- Incorrect server credentials
