A Computer Science Project for the University of Helsinki CSM11006 course.
Create a .env.local file in the root (same place as package.json)
Add the connection string to .env.local, replace with the connection string.
MONGODB_URI="<ask for connection string>"
GOOGLE_API_URL="<ask>"
GROQ_API_URL="<ask>"
If you use nvmrc that is recommended, run nvm use to get the correct Node version.
npm ci - to install dependencies
npm run dev - to start the development server
Upon successful connection to MongoDB, the application will be accessible at url localhost:3000
To seed the database with a sample user and preferences, run the following command:
npm run seed
This script will:
Connect to the MongoDB database specified in your .env.local file.
Clear the existing users in the database.
Add a sample user with predefined preferences.
Notes:
- Ensure that your
.env.localfile contains theMONGODB_URIpointing to your MongoDB instance. - The path to the
Usermodel in theseed.jsscript (./src/models/User.js) should be adjusted based on your project's directory structure. - Before running the seed script, make sure all dependencies are installed by executing
npm install.
By following these steps, you'll set up a seed script that initializes your MongoDB database with a sample user and preferences, facilitating development and testing.