This repository contains everything needed to run the backend for a local version of GoodPlates.
You can find the frontend repository here.
- Clone the repository
git clone https://github.com/SebastianHog/GoodPlatesBackend.git
- Navigate into the project directory
cd GoodPlatesBackend
- Install dependencies
npm install
- Create a
.envfile
-
Add
MONGO_CONNECTION_STRINGandSECRET_KEY. -
The
MONGO_CONNECTION_STRINGshould be in this format:mongodb+srv://<username>:<password>@<cluster>/<database>?retryWrites=true&w=majorityMost(or all) of it will likely be given to you when you make your DB, but this is a good reference point.
Replace
<username>,<password>,<cluster>, and<database>with your MongoDB credentials and cluster information.Generate a
SECRET_KEY:node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"
- Start the server with
npm run dev
The backend should now be running locally.
- The backend connects to a MongoDB database using the
MONGO_CONNECTION_STRINGdefined in the.envfile.