DormWiki is a website designed to inform prospective/incoming students about various dorms on campus. It will summarize all the information students need to know about the dorm, helping them find the one that most suits their needs. The website also will help current students stay updated about events happening at their dorms, fostering a sense of community and belonging.
- site: Contains all of the code for the front end and API
src/pages/api— contains the code for all API callssrc/pages/- contains the code for the pages
- database: MongoDB
Website is currently deployed at https://dorm-wiki.vercel.app/. It may misbehave (very scuffed) for some browsers (best to use Chrome with light mode)
- Home: search/navigate to dorm pages, lists top upcoming events
- Events: slideshow for the most popular events; shows upcoming events (sorted by the time); user can post events by entering event logistics (title, organizer, location, dorm, date/time)
- Individual event page: view more details about a particular upcoming event
- Wiki: shows the previews of the dorms; clicking the dorm types in the dropdown list filters the dorms Dorm page: shows pictures, reviews/ratings for the dorm; ability for users to submit a review
- About: understand the DormWiki’s purpose and goals, learn about the developers
- Login: sign in through Google to to post an event or a review; if signed in, user can view profile page
Building the project is fairly simple and can be achieved via npm run build.
- Contact team member for API keys, then add them to the environment variables of the project.
- Install the dependencies using
cd site && npm install - The server can be run in development mode via
npm run dev.- To build and run the production version, use
npm run buildto build andnpm startto start the server.
- To build and run the production version, use
- Follow the instructions to install cypress.
- Contact a team member to gain access to make requests to database.
- To run Cypress e2e tests:
- in root, run
npm run cypress:open - Select E2E testing
- Select a browser (Recommend Chrome) and click Start
- On the left side, select "Specs" and all the tests will be shown
- in root, run
- If you prefer, you can use the Cypress CLI.
The website requires Google login before making posts or liking events. Prior to e2e test, testing individual API/endpoint results in the correct data being passed in and stored in the database. However, after implementing the login functionality, we encountered a lot of difficulty automating Google login in our tests to test data flow and storage. We decided to test the posting review and event, like/unliking an event functionalies by asserting that after we press the submit button or the like button, we're redirected to the login page. To see component tests (without the login limitation) for all API calls, please refer to our alpha release Cypress tests.
- We tried to follow this Cypress documentation to programtically authenticate with Google without success: https://docs.cypress.io/guides/end-to-end-testing/google-authentication
- We found the following discussions about the issue and tried the strategies mentioned to debug:
Use this Bug Report template to inform us about the bug.
- No known bugs at the moment :)
If you want to contribute to our project, below are some details you may find useful. Contact a team member for API keys.
cypress: all the testing codesite: next.js root folderpublic: contains all public resources (mostly images)src: front-end codecomponents: react componentspages: all of the next.js code for the web pagesapi: the backend API calls
styles: all of the css for the pages
- Go to
cypress/e2e/testing. - Testing documentation can be found here.
- Create a test named by the component you want to test using camelCase notation and ending with Test.cy.js (e.g.
postSingleEventTest.cy.js). - Once you create the new test, refresh the Cypress test window. Click on the test you wrote to run it.