-
Notifications
You must be signed in to change notification settings - Fork 6
Installation
hanan o edited this page May 2, 2024
·
5 revisions
Follow these steps to set up the project on your local machine:
- Node.js (v18.x or higher)
- npm (v8.x or higher)
- MongoDB (v7.x or higher)
-
Create a new project and a cluster on MongoDB Atlas.
-
To get the connection string:
- From Database Cluster 0 → Click Connect (next to cluster name) → Select Compass → Select
I have MongoDB Compass installed
→ Copy the string (<password>
will need to be replaced with your cluster password)
- From Database Cluster 0 → Click Connect (next to cluster name) → Select Compass → Select
-
Clone the Repository
git clone https://github.com/SeattleColleges/belindas-closet-nextjs.git
-
Navigate to Project Directory
cd belindas-closet-nextjs
-
Install Dependencies
npm install
-
Environment Variables
- Create an
.env
file in the root directory and paste the following:MONGODB_URI=<replace-with-your-connection-string>/<replace-with-name-of-db> NEXTAUTH_URL=http://localhost:3000 NEXTAUTH_SECRET=secret JWT_SECRET=secret JWT_EXPIRES="1d" PRODUCT_KEY=secret
- Update
MONGODB_URI
in.env
to use your connection string and name of database - Update
JWT_SECRET
in.env
- Update
JWT_EXPIRES
in.env
- Update
PRODUCT_KEY
in.env
- Create an
-
Database Setup
- Start your MongoDB instance
-
Run the Application
npm run dev
Your application should now be running at http://localhost:8080
.