Before you begin, make sure you have the following installed:
-
Node.js (version 18) and npm: Download & Installation Guide
Also make sure you have accounts for the following:
git clone [REPO_URL]
cd [REPO_NAME]
Replace [REPO_URL] with the link to your GitHub repository and [REPO_NAME] with the repository's name.
Run the installation script to install the dependencies for both the frontend and backend applications:
npm run install:all
Copy the example .env files in both directories and fill them with your details:
cd packages/backend
cp .env.example .env
cd ../frontend
cp .env.example .env
Update the variables, especially the MongoDB connection string from MongoDB Atlas.
- Install cross-env for setting environment variables in scripts:
npm install cross-env
- If you face issues with native npm modules, run:
npm install --global windows-build-tools
For Bash scripts or UNIX commands, consider using Git Bash
To start the backend:
npm run start:backend
To start the frontend (separate terminal window required):
npm run start:frontend
Open your browser and navigate to http://localhost:3000
(or whatever port you've set in your .env for the frontend).
- Express: A minimal and flexible Node.js web application framework that provides a robust set of features for web and mobile applications.
- CORS: A Node.js package that provides a middleware to enable Cross-Origin Resource Sharing in your application.
- Dotenv: A zero-dependency module that loads environment variables from a .env file into process.env.
- Mongodb: The official MongoDB driver for Node.js, providing a high-level API on top of MongoDB's native drivers.
- Nodemon: A utility that monitors for any changes in your source and automatically restarts your server. Great for development.
- Helmet: Helps secure Express apps by setting various HTTP headers, guarding against some well-known web vulnerabilities.
- Nodemon: A utility to automatically restart Node server when your code changes.
- React: A JavaScript library for building user interfaces.
- React Router: A JavaScript library for routing in single-page applications built with React.
-
Remember to commit your changes frequently with meaningful commit messages. Consider using a standardised convention like Conventional Commits
-
Avoid commiting your .env file or any other sensitive credentials to the repository.
.gitignore
files are included in each application to help avoid accidental commits, which you can modify as necessary. -
Regularly pull updates from the repository to stay in sync with any changes.