Skip to content

Latest commit

 

History

History
138 lines (78 loc) · 3.88 KB

File metadata and controls

138 lines (78 loc) · 3.88 KB

Getting started with this project on your machine

Prerequisites

Before you begin, make sure you have the following installed:

  1. Node.js (version 18) and npm: Download & Installation Guide

  2. Git: Download & Installation Guide

Also make sure you have accounts for the following:

  1. MongoDB Atlas

  2. GitHub

Step by step Setup

1. Clone the Repository

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.

2. Install Dependencies

Run the installation script to install the dependencies for both the frontend and backend applications:

npm run install:all

3. Environment Variables

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.

4. (Windows Users Only) Additional Setup

  • 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

5. Running the Application

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).

Libraries already included

Backend

  • Express: A minimal and flexible Node.js web application framework that provides a robust set of features for web and mobile applications.

Documentation

  • CORS: A Node.js package that provides a middleware to enable Cross-Origin Resource Sharing in your application.

Documentation

  • Dotenv: A zero-dependency module that loads environment variables from a .env file into process.env.

Documentation

  • Mongodb: The official MongoDB driver for Node.js, providing a high-level API on top of MongoDB's native drivers.

Documentation

  • Nodemon: A utility that monitors for any changes in your source and automatically restarts your server. Great for development.

Documentation

  • Helmet: Helps secure Express apps by setting various HTTP headers, guarding against some well-known web vulnerabilities.

Documentation

  • Nodemon: A utility to automatically restart Node server when your code changes.

Documentation

Frontend

  • React: A JavaScript library for building user interfaces.

Documentation

  • React Router: A JavaScript library for routing in single-page applications built with React.

Documentation

Additional Notes

  • 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.