Welcome to the backend repository for GlobeHoppin, a project built using Node.js, Express, and MongoDB. This document provides instructions on setting up the project, running it locally, and contributing to the codebase.
Before you begin, ensure you have the following installed:
Fork
button at the top right corner to create a copy of the repository in your account.Clone your forked repository to your local machine using Git or GitHub Desktop.
git clone https://github.com/your-username/globe-hoppin-backend.git
File > Clone Repository
.cd globe-hoppin-backend
Install the required dependencies using npm:
npm install
Create a .env
file in the root directory of the project and add the following configuration values:
PORT=8080
MONGO_DBNAME=yourDatabaseName
MONGO_HOSTS=localhost:27017
MONGO_USERNAME=yourUsername
MONGO_PASSWORD=yourPassword
SECRET=yourSecretKey
TOKEN_EXPIRY=3600
You can run the application in development mode with nodemon or normally with npm:
npm run dev
npm start
We welcome contributions to improve GlobeHoppin. To contribute, follow these steps:
Click the Fork
button to create a copy of the repository in your account.
Make sure to start working only after creating or selecting an issue.
Create a new branch for your work, including the issue number in the branch name (e.g., edit-readme-14
):
git checkout -b 'edit-readme-14'
Implement your changes to the codebase.
Commit your changes, including the issue number in the commit message:
git commit -m 'Enhanced README.md #14'
Push your changes to your forked repository:
git push origin <your-branch-name>
Open a pull request to merge your changes into the main repository.
Rebase with Main: Always rebase with the main branch instead of merging:
git reset --soft $(git merge-base main HEAD)
git add .
git commit -m 'commit message'
git push origin <branch-name> --force-with-lease
To keep your fork updated with the original repository, you need to pull and merge updates from the upstream repository:
# Fetch upstream repository
git fetch upstream
# Switch to main branch
git checkout main
# Merge upstream changes into your local main branch
git merge upstream/main
Or using a single command:
# Switch to main branch
git checkout main
# Pull and merge upstream changes
git pull origin main