Project 2, Milestone 1: Community Events Document Database
In this milestone, you will create a MongoDB Shell script to initialize a document database with sample event data for a community events single-page application.
The course material needed to complete this part was covered in classes 13 and 14.
Project Overview
For your second project you will design and implement an interactive community events single-page application using the MERN stack. For this project, you may only use the methods taught in this course.
The idea for this project to encourage community engagement by providing a platform for community members to discover and participate in local events. However, community engagement is not a strict requirement for this project. You may create an events web application for any type of events you like regardless of whether it promotes community engagement.
Learning Objectives
- Initialize a document database (MongoDB) with a MongoDB Shell script.
- Plan database operations to create, read, update, and delete documents in a MongoDB collection.
- Test database operations using the MongoDB Shell.
- Employ the reference documentation to solve problems independently.
Help & Support Resources
We want you to get the help and support you need. Use the course's support resources for help with this assignment.
Git Repository & Codespace
-
Create your assignment repository.
Visit https://landrace.infosci.cornell.edu/courses/info2310-2026sp/repos/project2 in your browser to create your assignment repository.
-
Open your assignment repository in GitHub.
After creating your repository, visit https://landrace.infosci.cornell.edu/courses/info2310-2026sp/repos/project2 in your browser and follow the link to open the repository on github.com
-
Open your assignment repository as a codespace.
Submission Requirements
Your assignment should meet the following requirements for credit:
-
Submit your own original work (design and code) for this assignment.
No credit is provided for submitting design and/or code that is taken from the course-provided examples.
-
Your code should be original. However, the structure of the code will mirror the class examples.
The structure of your code will align with the class examples. This is to be expected. We are learning web programming and there's only so many ways to structure code to solve its problems.
-
You are required to use the methods and techniques covered in class.
No credit is provided for using methods that are not covered in this class.
-
Your single-page application should be visible in the browser and functional upon launching the development web server Start Debugging from the Run menu.
If your single-page application does not launch using this method or is not visible in the browser after launching the server, we are unable to provide any credit.
-
All files should be in the location specified in this document for credit.
Professionalism is important. Incorrectly placed files will not be graded; no partial credit is provided either.
-
Follow the submission instructions below.
Submit all materials to your GitHub repository's main branch for this assignment. When you're finished stage, commit, and push your submission to GitHub. Then fill-out the submission form to complete your submission.
Failure to complete the submission form will result in 0 credit; no submission form = no submission. No leniency. No exceptions.
Part I: Initialize a Document Database
Create a MongoDB Shell script to initialize a document database with sample event data.
Requirements & Credit
Credit: ~15 points
This part is graded for correctness. Meet the following requirements for full credit:
Database Initialization Script:
- Use only
mongoshto initialize your database and collection. - Initialize the database and collection in an
init.mongodb.jsfile at the root of the repository. - This file must successfully run using the ⏵ button in Codespaces. No credit is provided for running the initialization script any other way.
- Re-running the initialization script does not create duplicate documents or fail.
Sample Data:
- Initialize all data in an
appdatabase. - Create exactly one collection:
events. - Initialize the collection with at least 20 events.
- Each event should have at least the following data:
- name
- date and time (in
Dateformat) - location
- short description (or summary)
- full description
- number of "likes" or "interested" (or similar)
- multiple tags (e.g., "free", "family-friendly", "outdoors", etc.)
- You may add additional data to the events if you wish, like price.
- You may only store JSON data in the collection.
- Do not store any other data types.
- Do not store images or videos in the collection.
- Use the built-in
_idfield for the document ID; do not provide your own unique identifiers for the data.
Professionalism:
Professionalism means meeting the client's requirements. Not doing less and not do more. Your submission should meet the requirements specified for this part and no more.
You are required to implement your project using the methods taught in class prior to the release of this milestone.
If any functionality exists not covered in class up to this point, 0 credit is provided for this part.
Instructions
As a budding user experience designer and engineer, you will need to be able to apply what you have learned about single-page applications on your own independently. This project will provide some guidance, like your manager in industry might, but it will not provide you with step-by-step instructions. You will need to apply what you have learned in class to complete this project.
-
Identify the data you want to use in your events web application.
Your data need not be real. But it should be believable. You may use generative AI to produce the data if you wish. However, you may not use generative AI to write the database initialization script for you.
-
Initialize your event collections in
init.mongodb.js.Initialize your
eventscollection using the approach and best practices from class. No credit is provided for using any other method to initialize your database.Initialize all date and times in
Dateformat; usemongosh'sDate object.While you may use generative AI as a reference for this part, you should write the initialization script yourself.
You may not store any binary data, like images in the database. Do not store URLs or paths to images. You should only have conventional JSON data in your collection for now.
-
Thoroughly test your database initialization script.
Test your database initialization script using the ⏵ button in Codespaces. No credit is provided for running the initialization script any other way.
Submission
Stage, commit and push all changed files in your Git repository to the GitHub server. (All commits should reside on the main branch.)
Do not complete the submission form.
Part II: Plan Future Database Operations
In later milestones, you will need to implement database operations to create, read, update, and delete events in your database. Plan and test these operations in advance so that you're prepared for the next milestones.
Requirements & Credit
Credit: ~15 points
This part is graded for correctness. Meet the following requirements for full credit:
Database Operations Plan:
-
Provide an example MongoDB Shell command for each of the following operations in
design-plan/db-operations.md:- Create One
- Read One
- Read All
- Update One
- Replace One
- Delete One
-
Each command should be a valid MongoDB Shell command that successfully performs the specified operation on your database.
-
You may select the filter and update values for the sample commands you provide in your plan.
Professionalism:
Professionalism means meeting the client's requirements. Not doing less and not do more. Your submission should meet the requirements specified for this part and no more.
You are required to implement your project using the methods taught in class prior to the release of this milestone.
If any functionality exists not covered in class up to this point, 0 credit is provided for this part.
Instructions
-
Review the documentation for MongoDB Shell as necessary.
-
Write example MongoDB Shell commands for each of the specified database operations in
design-plan/db-operations.md.You may select the filter and update values for the sample commands you provide in your plan. The commands just need to be valid MongoDB Shell commands that successfully perform the specified operation on your database.
-
Test each of your example MongoDB Shell commands in
mongoshto ensure they work correctly.
Submission
Stage, commit and push all changed files in your Git repository to the GitHub server. (All commits should reside on the main branch.)
Complete the submission form for p2m1 to submit the assignment.
Note: The submission form asks you to check your submission. Checking your work will ensure you receive credit for this assignment. We ask you to check your submission because this is where some students lose points. It's easy to forget something and checking your work prevents the heartache of getting a 0 because your submission wasn't submitted in a way that we can access and grade it.
Contributors
Copyright © 2024 - 2026:
- Kyle Harms