Ohtuilmo
Registration, administration and review tool for University of Helsinki's software engineering project course.
Project links
- Definition of Done
- Work schedule
- Team practices
- Product backlog
- Worked hours
- Developer workflow instructions
Development
How to start development
-
Make sure you have docker, docker-compose and nvm installed.
-
Clone this repository to your computer.
-
Run
nvm use && npm iin both in backend and frontend folders.- If you get error "Version x is not yet installed", you can install required node version by simply giving command
nvm installand then try again.
- If you get error "Version x is not yet installed", you can install required node version by simply giving command
-
Run
docker compose upto start development contaires.- This command works in any folder inside cloned repository
- It will start 4 containers:
Container Port db 5432 backend 3001 frontend 3000 adminer 8083
-
When you are done, close containers from the active console with shortcut
CTRL+Cor from other console with commanddocker compose down.
When there is change in dependencies
If frontend or backend dependencies change, ie. there is change in frontend or backend package.json file, you need to install dependencies again locally and rebuild containers:
-
Remove dev containers with command
docker compose down -
Run
nvm use && npm iin frontend or backend folder or in both if both has had changes for dependencies. -
Rebuild dev containers with
docker compose up --build
How to restore database to its initial state
-
Remove containers and volumes related with command
docker compose down --volumes -
Restart dev setup with
docker compose up
How to change user roles in dev environment
In development environment, login is faked in backend using fakeshibbo middleware. You can run software in different user roles by modifying faceshibbo in ./backend/middleware.js file.
Modify line const test_user = test_users.student to correspond user role desired (student, instructor, or admin). Changes take effect immediately when you save your changes and reload the page.
How to run Cypress tests
-
Switch to frontend folder.
-
Start test setup with command
npm run test-setup. This will create 3 containers inside project ohtuilmo-local-test:Container Port db - backend - frontend 3002 -
Run tests with graphic interface with command
npm run testor in headless mode with commandnpm run test:headless. -
If you want to restore test setup and the database to their initial stage, just run
npm run test-setupagain. -
When you are done, you can remove containers and all related resources with command
npm run test-setup:down
How to manually inspect database
Development setup includes database management tool called Adminer. With Adminer, you can easily inspect and modify database using your browser. When development containers are running, navigate to http://localhost:8083/ and sign in with following info:
- System: PostgreSQL
- Server: db
- Username: postgres
- Password: postgres
- Database: postgres