This repository includes a seeding script to populate the database with initial data, including users, schedules, and events. This is helpful for setting up the development environment with predefined data for testing or demonstration purposes.
Before running the seeding script, ensure you have the following:
- Node.js (v14+ recommended)
- MongoDB installed and running
- MongoDB connection string set up in your environment (if you're not using the default
mongodb://localhost:27017/streamlinedscheduler) - bcrypt installed (used for password hashing)
-
Clone the Repository
git clone https://github.com/grahamprimm/streamlinedscheduler.git cd streamlinedscheduler -
Install Dependencies
Install the required Node.js packages by running:
npm install
-
Run the Seeding Script
To seed the database with users, schedules, and events, execute the following command:
node seed.js
This will populate the database with the following data:
- 5 Users:
- 1 Admin user with email
admin@domain.com - 4 Regular users with different emails and passwords
- 1 Admin user with email
- Schedules:
- Each user has their own schedule.
- Events:
- Each user (except the admin) has events associated with their schedule, and some events are shared between users.
- 5 Users:
-
Verify Successful Seeding
After running the script, you should see a message indicating that the seeding completed successfully.
To verify the seeded data, you can connect to your MongoDB instance using the MongoDB shell or any MongoDB GUI tool (e.g., MongoDB Compass) and run queries like:
db.users.find().pretty()
db.schedules.find().pretty()
db.events.find().pretty()Here are the login details for the users created by the seeding script:
-
Admin User:
- Email:
admin@domain.com - Password:
P@ssword1
- Email:
-
User 1:
- Email:
user1@domain.com - Password:
P@ssword2
- Email:
-
User 2:
- Email:
user2@domain.com - Password:
P@ssword3
- Email:
-
User 3:
- Email:
user3@domain.com - Password:
P@ssword4
- Email:
-
User 4:
- Email:
user4@domain.com - Password:
P@ssword5
- Email:
This README.md should provide all the necessary information to set up the project and seed the database with initial data, along with user login details for testing. Let me know if you need any further adjustments!