Welcome to the Notes App, a simple and user-friendy application for managing notes. The application is powered by Wasp, a fullstack React, NodeJS, and Prisma framework.
- π Authentication: Securely register for and access your account
- βοΈ Create notes: Easily compose and save your thoughts
- β Mark completed: Indicate task completion with a simple checkbox
- ποΈ Delete notes: Seamlessly remove unwanted notes
- πΎ Auto-save notes: Enjoy peace of mind as notes are saved automatically
- Install Wasp
- Clone the repository: https://github.com/xsarahyu/notes-app.git
- Navigate to the app directory:
cd app
- Run the server:
wasp start db
- Run the client (in a new terminal):
cd app
β‘οΈwasp start
- The app is now live at http://localhost:3000!
The Wasp template provides many features that are irrelevant to the notes app, like Stripe payments, Google Analytics, and more. The following are the components and pages we utilized:
app/src
βββ client
β βββ admin
β β βββ common
β β β βββ Loader
β β β | βββ index.tsx
β β βββ components
β β β βββ DarkModeSwitcher.tsx
| | | βββ Header.tsx
| | | βββ Sidebar.tsx
| | | βββ SidebarLinkGroup.tsx
β β βββ layout
β β β βββ DefaultLayout.tsx
β βββ app
β β βββ AccountPage.tsx
β β βββ DemoAppPage.tsx
β βββ auth
β β βββ authWrapper.tsx
β β βββ LoginPage.tsx
β β βββ SignupPage.tsx
β βββ components
β β βββ AppNavBar.tsx
β β βββ DropdownUser.tsx
β β βββ UserMenuItems.tsx
β βββ hooks
β β βββ useColorMode.tsx
β β βββ useLocalStorage.tsx
β βββ landing-page
β β βββ contentSections.tsx
β β βββ LandingPage.tsx
β βββ App.tsx
β βββ Main.css
βββ server
β βββ auth
β β βββ setUsername.tsx
β βββ actions.ts
βββ shared
β βββ constants.ts
To run Vitest tests locally:
- Navigate to the app directory:
cd app
- Install dependencies:
npm install
- Run the tests:
npm run test-ui
(this is a script that we made, it runs all tests and generates test coverage) - You should now see test coverage in your terminal, and a browser window should open with the Vitest UI, which includes the coverage as well!
Test #1: The DarkModeSwitcher component is a UI switcher element designed to toggle between light and dark color modes. The test ensures that the switching functionality works as expected.
Test #1: Ensures that users can create a new note by entering text into the input field and clicking the "Add Note" button.
notes-app/app/src/client/app/DemoAppPage.test.tsx
Lines 13 to 54 in aba16d6
notes-app/app/src/client/app/DemoAppPage.test.tsx
Lines 58 to 93 in aba16d6
notes-app/app/src/client/app/DemoAppPage.test.tsx
Lines 97 to 134 in aba16d6
notes-app/app/src/client/app/DemoAppPage.test.tsx
Lines 137 to 148 in aba16d6
notes-app/app/src/client/components/AppNavBar.test.jsx
Lines 7 to 15 in aba16d6
notes-app/app/src/client/landing-page/LandingPage.test.tsx
Lines 16 to 24 in 3639c4e
notes-app/app/src/client/landing-page/LandingPage.test.tsx
Lines 26 to 36 in 3639c4e
notes-app/app/src/client/landing-page/LandingPage.test.tsx
Lines 38 to 50 in 3639c4e
notes-app/app/src/client/landing-page/LandingPage.test.tsx
Lines 54 to 68 in 3639c4e
To run Cypress tests locally:
- Navigate to the app directory:
cd app
- Install Linux dependencies:
sudo apt-get install libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libnss3 libxss1 libasound2 libxtst6 xauth xvfb
- Install other dependencies:
npm install
- Run the server:
wasp start db
- Run the client (in a new terminal):
cd app
β‘οΈwasp start
- Open the Cypress test runner (in a new terminal):
cd app
β‘οΈnpx cypress open
The following steps occur in the Cypress test runner:
- In the test runner, select "E2E Testing."
- You'll be prompted to choose a browser to run the tests in. Select "Start E2E Testing in Electron."
- Cypress will open a new window containing a list of all the end-to-end tests.
- Click on a test file to run it.
- The selected test will begin execution. You'll see each step being performed in real-time within the Cypress GUI.
- If the test passes, the screen will turn green. If it fails, the screen will turn red, indicating which step failed.
- To run other test files, navigate back to the main page by selecting the "Specs" label in the sidebar.
- From the main page, you can select and run other test files one by one.
notes-app/app/cypress/e2e/account_settings.cy.ts
Lines 1 to 19 in aba16d6
notes-app/app/cypress/e2e/documentation_page.cy.ts
Lines 1 to 22 in aba16d6
notes-app/app/cypress/e2e/login_page.cy.ts
Lines 1 to 23 in aba16d6
notes-app/app/cypress/e2e/notes.cy.ts
Lines 1 to 45 in 91976d1
notes-app/app/cypress/e2e/logout.cy.ts
Lines 1 to 20 in aba16d6
notes-app/app/cypress/e2e/signup_page.cy.ts
Lines 1 to 14 in aba16d6