Refer to our [RFC] Branching Strategy #66 for more information on how to work with branches in this project.
- Node.js >= v20.x
- Bun >= v1.1.x
- Docker and Docker Compose to spin up a local database
Clone the project
git clone <PROJECT_URL>
Install dependencies
bun install
Ensure you have the .env
file in the root directory. You can copy the
.env.example
file and rename it to .env
.
cp .env.example .env
Tip
For development, you can use the default values in the .env.example
file. However, you may need to update the DATABASE_URL
if you are using a
different database.
With automated code formatting, we sometimes expect large changes in pull
requests. We have a .git-blame-ignore-revs
file to
ignore formatting changes. To make this file used by git blame
, you need to
run the following command.
git config --local blame.ignoreRevsFile .git-blame-ignore-revs
To ensure a consistent development experience, we recommend installing the recommended settings and extensions for VSCode. You can find the settings in the .vscode folder.
Start the development server
bunx dev
Open http://localhost:3000 with your browser to see the result.
Start the database
docker-compose up
Tip
On first run, you will need to run the migrations to create the database schema
bunx prisma migrate dev
Only needs to be done once. This command will create the database schema and seed the database with some initial data.
Tip
The seed data are in the prisma/data
directory's json
files and populated using the prisma/seed.ts
via a command
defined in package.json
at the prisma.seed
section. You
can modify these file to update seed data.
To destroy the database and remove all data
docker-compose down -v
See the docker compose documentation for more information on how to use docker compose.
Start the Storybook server
bunx storybook
Open http://localhost:6006 with your browser to see the result.
See the Storybook documentation for more information on how to use Storybook.
Refer to the Project Architecture guide for more information.
We are using a library called Iconify.
On Figma, if the icon layer name is formatted like uil:chart-line
, then it's
likely using an icon from Iconify. Otherwise, see below for custom icon
implementation.
Please also refer to Iconify guide here
Refer to the README here
Our theming system uses the Tailwind Plugin function to generate 2 things
- CSS variables for each token in figma
- Tailwind classes for these tokens
VSCode should grab and expose the colours from the theming system with autocomplete support. You need the Tailwind CSS IntelliSense VSCode Extension.
Alternatively, you can refer to common/tools/tailwind/themes/appTheme.ts
for
the theming tailwind config and available classes.
Even though the theming system exposes classes like bg-light-primary-default
or bg-dark-primary-default
, use only bg-app-primary-default
. The additional
light/dark prefix colours are for granular theming possibilities, like when
certain components need a certain token.
Based on the parent's className light
or dark
, the tailwind classes will use
a different set of color variables.
E.g. We use 1 class for both light or dark colours, such as
bg-app-primary-default
. This class points to a CSS variable like so
primary-default: 'var(--app-primary-default)
. Based on whether the parent has
.dark
or .light
class, the class contains CSS variables that will override
and apply the correct colour.
It also works with opacity, so you could do bg-app-primary-default/50
if you'd
like.
Just add something like data-theme="dark"
to the HTML attributes, and it'll
use the variables from that theme. You can also use classNames like dark
or
light
.
All Tailwind theming files are configured in the monorepo's
common/tools/tailwind
folder.
If you're adding a new key or token, make sure to modify all the themes found in
/common/tools/tailwind/themes
so they have the same set of keys.
If you're updating a certain theme's color code, just find the theme in
/common/tools/tailwind/themes
and paste the HEX code there.