The goal of this assignment is to implement all the client-side functionality. An example implementation is in the image below.
Please note that the styles are not provided for this assignment, and your application can look different. But the nicer and more usable it is, the better the mark.
Please watch the presentation to understand about the roles you will play. As explained, you will work on two repos. In one repository you will develop your code, in another one, you will review and approve pull requests from another developer. Therefore the process is following:
First, make sure that "pnpm" and "turbo" is installed in your computer. If not, please follow installation instructions for pnpm. If turbo is not installed, please install it using pnpm with the following command:
Then, run the following command to install turborepo.
pnpm add -g turbo
Once the pnpm is installed, in the root of the project install the packages
pnpm i
To run end to end tests you need to install headless browsers. Please run the following command in the tests/playwright-web
directory
pnpx playwright install
In the apps/admin
and packages/db
project, duplicate the .env.example
file and rename the duplicate to .env
. In the .env
file set the correct values, for example in the apps/admin
these woulde be the values that you set:
PASSWORD=123
JWT_SECRET=super-secret-password
In the packages/db
you need to set path to your SQLite database:
DATABASE_URL="file:./dev.db"
Please remember to modify both projects! If you fail to set the variables, the next step will result in errors.
To run the project, run the following command in the root directory of your project:
turbo dev
This will run:
To run the tests please run, you have two options.
If you only wish to visualise the test results in console, please run the following command in the root of your project:
turbo test-1
This launches the turbo console UI similar to below, where you can swap between different projects:
⚠️ Make sure that ALL tests pass!
If you want to run the tests for second part (i.e. Assignment 2.2) or third part (i.e. Assignment 2.3), run these commands:
turbo test-2 // or
turbo test-3
If you want to run all tests, please run
turbo all:test
The packaged tests framework also have the possibility of visually represent your tests for nicer view of test results. To see the UIs, run this command instead of turbo test-1
turbo dev:test-1
This will launch the End to End testing framework Playwright's test UI similar to below, please use the Play buttons to run individual tests:
It also launches the unit and integration test framework Vitest's UI, similar to below. Here, you can also use the play buttons to execute individual tests!
The project is monorepo with the following packages split into three categories:
Applications
Contains the following web applications:
Packages
Contains the following packages with shared code and configurations:
Tests
Contains the following test applications:
The client application comes with pre-defined router (only one route is missing for your learning). The client application also comes with pre defined structure of components and utilities for you to complete. The admin application is much more bare with most functionality AND structure needed to be completed by you.
If you use the Visual Studio Code for your development, we stringly recommend installing the following packages:
If you install these plugins, you can find all your tests in the Test Explorer (see image below), allowing you to execute and debug your tests.
Good Luck!