Repository containing the dashboard (UI), the Carp Portal.
The website is using React v18, Material-UI v5, Carp Client TS (1.0.0) and Carp.Core (1.2.1). The later two components are dependencies not available on npm. They can be found in the non_npm_dependencies folder.
-
Install node
v18.16.0
-
Install
pnpm
-
Run
pnpm i
in the root folder of the project. -
Create an
.env.
file in the root of the project:
VITE_BASE_URL= <`/proxy` for local development or base URL for the backend>
VITE_BASE_NAME=/
VITE_KEYCLOAK_URL= <Keycloak URL>
VITE_KEYCLOAK_REALM= <Name of the Keycloak realm>
VITE_KEYCLOAK_CLIENT_ID= <Keycloak clientID>
VITE_KEYCLOAK_REDIRECT_URI= <Valid Keycloak redirect URL to redirect after login>
- You can now start the portal with
pnpm start
and you can access the portal athttp://localhost:3000
.
Note Every time a developer uses the
pnpm add
,pnpm install
,pnpm rm
(or similar npm commands),pnpm
will remove thenon_npm_dependencies
fromnode_modules/
. There is a post-install script that links the dependencies again, but this only works on UNIX-based systems. On Windows, you must manually copy thenon_npm_dependencies
tonode_modules/
.
The src folder contains all the Typescript source code and static asset for the web interface. The web interface is using custom CARP fonts (MuseoSansRounded), and these custom font files can be found in the fonts folder. The carp logo and the image used on the landing page are located in the images folder. The components folder holds all the reusable components for the application and pages contains the full sites, which are usually build up using the reusable components.
The project uses GitHub Actions to build and push the CARP Portal as a docker image, that can be then deployed on a preferred hosting service. To deploy your own version of the Portal fork this project and setup the configuaration for GitHub Actions.
To change the docker repository where the docker image is pushed, the following lines needs to be changed in deployment.yaml:
- name: Docker build and push
run: |
docker build -t <REPOSITORY>/<CONTAINER-NAME>:${{ env.TAG }} .
docker push <REPOSITORY>/<CONTAINER-NAME>:${{ env.TAG }}
For GitHub Actions secrets the following secrets needs to be added:
DOCKERHUB_TOKEN
API token for DockerHubDOCKERHUB_USERNAME
Username for DockerHub
For variables, you need to create a special enviroment file content named DEV_ENV
, PLAYGROUND_ENV
, PROD_ENV
, TEST_ENV
.
Example:
VITE_APP_NAME=...
VITE_BASE_URL=...
VITE_BASE_NAME=...
VITE_KEYCLOAK_URL=...
VITE_KEYCLOAK_REALM=...
VITE_KEYCLOAK_CLIENT_ID=...
VITE_KEYCLOAK_REDIRECT_URI=...
VITE_PORT=...
TAG=..
The different enviroment files correspondes to the different branches in the project.
DEV_ENV
for the develop branchTEST_ENV
for the test branchPROD_ENV
for the main branchPLAYGROUND_ENV
for every other branch