tdp-ui is a graphical interface for tdp-server.
We assume that are available:
- An instance of
tdp-server, with the appropriatecorsconfiguration (BACKEND_CORS_ORIGINS=[...,"http://tdp-ui-domain.local"]). - An identity provider, provisioned and configured to work with
tdp-server.tdp-uidomain has to be registered as a redirect URI.
Note:tdp_serverprovides a Docker environment containing an IDP for development purposes.
The following are required to build and develop tdp-ui. They aren't needed when exporting the project. tdp-ui can be used with any web server (such as NGINX):
-
Use the sample
config.example.jsonfile to providetdp-uithe required environment variables:cp config.example.json config.json
A
skipAuthoption is available to skip the authentication process. It is useful for development purposes. -
Generate the RTK Query OpenAPI client:
npm run generate
The RTK Query OpenAPI client is generated in the
./src/features/api/tdpApi.tsfile using./scripts/openapi-config.tsand a schema in the./schemas/folder. -
Install dependencies and start the app in development mode:
npm install npm run dev
By default, the client is available at http://localhost:3000.
A Docker environment is provided with the required dependencies for development. It contains both tdp-server and Keycloak as the identity provider:
docker compose -f env/dev/compose.yml up -dAn user is provisioned in Keycloak to access the app. The credentials are:
- username:
user@tdp.com - password:
secret
By default, Next.js uses a Node.js server to serve the app. tdp-ui doesn't need a Node.js server and is exported to work without it:
npm install # Install dependencies
npm run export # Build and export the projectThe project is exported in the ./out folder to be used with any web server (such as NGINX).
A Docker environment is provided with NGINX to test the exported project:
docker compose -f env/export/compose.yml up -dGit hooks are defined using Husky to enforce good coding practices. For each commit, Husky automatically:
- Lint your staged files (see ESLint)
- Format your staged files (see Prettier)
- Lint your commit messages according to the Conventional Commit specification (see commitlint)
Further instructions are available in the docs folder.