This is the frontend of SINDIT (Work in progress!)
The SINDIT 2.0 documentation is hosted on GitLab Pages: sct.pages.sintef.no/sd/monorepo/sindit
There are environment variables you need for the frontend to run -- the URL to the backend API and the base URI of the backend. The simplest way is to create a .env file in the present directory.
$ cat .env
PUBLIC_SINDIT_BACKEND_API=http://192.168.1.222:9017
PUBLIC_SINDIT_BACKEND_API_BASE_URI=http://Where 192.168.1.222 is the IP address of the machine running the backend. If the backend runs on the same machine as the frontend, that's fine. If the backend runs in a Docker container, you must specificy the IP address of the host. You cannot use 0.0.0.0 or 127.0.0.1!
Install dependencies with npm install, and start a development server:
npm install
npm run devRun tests:
npm run testThis configuration can be applied to launch the application:
"configurations": [
{
"command": "npm run dev",
"name": "Run npm dev",
"request": "launch",
"type": "node-terminal",
"env": {
"NODE_ENV": "development",
"PUBLIC_SINDIT_BACKEND_API": "http://0.0.0.0:9017",
"PUBLIC_SINDIT_BACKEND_API_BASE_URI": "http://"
}
}
]In development mode, the frontend is available at http://localhost:5173.
Build and run the sindit frontend:
docker build -t sindit-frontend .
docker run --env-file .env -d -p 5173:3000 --name sindit-frontend sindit-frontendIn this mode, the frontend is also available at http://localhost:5173.
- Create a Private Access Token with
read_registryscope.- Docker login username: your gitlab username (email address)
$DOCKER_USERNAME - Docker login password: your Personal Access Token
$CONTAINER_REGITRY_READ
- Docker login username: your gitlab username (email address)
- Login to gitlab container registry
docker login gitlab.sintef.no:5050 -u $DOCKER_USERNAME -p $CONTAINER_REGISTRY_READ
docker run -p 5173:3000 --name sindit-frontend gitlab.sintef.no:5050/sct/sd/monorepo/sindit-frontend:latestDetails about how to run the SINDIT backend is found in the project directory monorepo/projects/sindit
Or in the documentation: sct.pages.sintef.no/sd/monorepo/sindit/sindit-backend
The URL and the URI-prefix of the backend are defined as environment variables (PUBLIC_SINDIT_BACKEND_API and PUBLIC_SINDIT_BACKEND_API_BASE_URI), see also the subsection Environment above.