A modern Component Library used by the Asynchrous Learning Management Portal and other EMSE applications that are used by the Async project.
- EMSE UI -
- Storybook
- React
- TypeScript
- TailwindCSS
- Cypress
- Prettier
- Node.js
- You need to have installed NodeJS version
16.17.0
or higher and18.1.0
or lower to run this project. You can check your version by runningnode -v
in your terminal.
- You need to have installed NodeJS version
- Yarn
- Git
- Docker
- Make
To run the source code in development on your local environment, you first need to ensure that you have installed the pre-requisite pieces of software. If you do not wish to install them, you can utilize Docker
to run the application.
yarn start
If you do not wish to install the pre-requisite pieces of software, you can utilize Docker
to run the application. You will need to have Docker
installed on your machine.
This commands builds the image for all 3 services that are used by the application.
make build
There are multiple options to running the Docker services. You can run them all at once, or you can run them individually. The following commands will run all 3 services at once.
make up
The following commands will run each service individually.
-
Running the Component Library in a storybook instance:
make up-ui
-
Running prettier for code formatting:
make up-prettier
-
Compiling Tailwind CSS for styling:
make up-tailwind
You can also run the services with flags. The following commands will run the services with flags.
-
Running all services in detached mode:
make up-detached
-
Running a clean build of all services:
make up-clean
The following commands will stop all 3 services.
make down
The following commands will restart all 3 services.
make restart
The following commands will restart each service individually.
-
Restarting the storybook instance:
make restart-ui
-
Restarting prettier:
make restart-prettier
-
Restarting Tailwind CSS compilation:
make restart-tailwind
The following command will show the logs for all 3 services in one terminal session.
Note that running this command is only successful if the application is running, as the logs window will attempt to attach to the docker instance.
make logs
The following command lists all your currently running containers.
make ps
The following command will enter the storybook container and spin up a terminal session using bash
. You can use this to run commands inside the container.
Note that you cannot enter all containers at once, you will have to do it individually. Due to this limitation, the default service container to enter is the storybook instance.
make shell
The following commands will enter a specific service container. You can use this to run commands inside the container.
-
Entering the prettier instance:
make shell-prettier
-
Entering the Tailwind CSS instance:
make shell-tailwind
To run the tests for the application, you can run the following command. This will run all the test cases using the Cypress
framework, in the terminal window.
yarn test
If you would like to run the test cases using the Cypress
GUI, you can run the following command. This will open the Cypress
GUI in your browser, where you can run the test cases.
yarn test:open
To bundle the components into a library that can be used externally, you can run the following command. This will create a production bundle of the components in the dist
folder.
yarn build
After running the above command, you can also pack
the bundle into a .tgz
file. This will create a .tgz
file in the root folder. This is useful to troubleshoot build systems that are set up. If the command completes successfully, you can use the .tgz
file to see what is included in your production bundle.
yarn pack
This command build the storybook application using your local installation of Node.js.
yarn build-storybook