Skip to content

Installation

hanan o edited this page May 2, 2024 · 5 revisions

Installation

Follow these steps to set up the project on your local machine:

Prerequisites

  • Node.js (v18.x or higher)
  • npm (v8.x or higher)
  • MongoDB (v7.x or higher)

Setup MongoDB Project and Cluster

  1. Create a new project and a cluster on MongoDB Atlas.

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

Steps

  1. Clone the Repository

    git clone https://github.com/SeattleColleges/belindas-closet-nextjs.git
  2. Navigate to Project Directory

    cd belindas-closet-nextjs
  3. Install Dependencies

    npm install
  4. 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
  5. Database Setup

    • Start your MongoDB instance
  6. Run the Application

    npm run dev

Your application should now be running at http://localhost:8080.

Clone this wiki locally