NTU SCSE's main public facing website, built with Next.js.
- Yarn v1
- Completed development environment setup by following the SCDS official docs.
First copy the contents of .env.example
file to a new file named .env.local
in the same directory.
Populate the variables in this file - ask your team lead or the IT Executive for these variables.
At the root directory of web
, download all the required node packages:
yarn
- Run the local development server:
yarn dev
- Open http://localhost:3001 with your browser to see the result.
Learn how to contribute to this project here.
Storybook is a frontend workshop for building UI components and pages in isolation. It can be used for UI development, testing, and documentation.
The basics of Storybook can be learned from https://storybook.js.org/docs/react/writing-stories/introduction
Stories are usually written for testing components in isolation from the main web page.
Thus, you should write stories when developing a component in the packages/ui/components
directory.
Navigate to the website/packages/ui
directory, and run:
yarn storybook
- In the main branch, run
git pull
to get the latest changes. - Create a new branch by running
git checkout -b web/[task-type]/SCSE-[task_number]
. Work on your task/feature in this branch. - After you are done with all your changes,
git add .
andgit commit -m "commit message"
to commit your changes locally. - Next, run
git pull origin main --rebase
to fetch new changes in the main branch (if any). Fix merge conflicts if any. - Push your branch to GitHub by running
git push
orgit push --set-upstream origin [branch-name]
(if this branch does not exist on GitHub) - Go to this GitHub repo and make a pull request from your branch to
main
branch. Name the PR starting with[SCSE-branch_number]
(e.g.: [SCSE-125] Add web docs). - Ensure that all automated checks passes. Fix any errors that occurs.
- Request 1 person to review your pull request, and you are done!
Naming [task-type] for new branches
- feat: A new feature
- fix: A bug fix
- docs: Documentation only changes
- style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc.)
- refactor: A code change that neither fixes a bug nor adds a feature
- perf: A code change that improves performance
- test: Adding missing or correcting existing tests
- chore: Changes to the build process or auxiliary tools and libraries such as documnetation generation
- revert: A revert to a previous commit
1. Jest Unit Tests
All Jest unit tests are written in the _tests_
directory with test.tsx
and snapshot.tsx
extension.
To run jest unit tests, run:
yarn test
Note: Snapshots need to be updated after changes have been made to the pages. This can be achieved by running:
yarn test -u
2. Cypress E2E Tests
All Cypress tests are written in the cypress/e2e
directory with the extension .cy.ts
.
To begin cypress e2e test, run the following command to open the UI:
yarn cypress