A simple Next.js project to demonstrate the integration of the React Terminology Service Suite widgets.
For this demo, a Next.js app was set up with Node.js v18.18.0.
- Install
npm install- Run
npm run devto start the app in development mode.
This demo project uses widgets from the @ts4nfdi/terminology-service-suite package.
The package is already installed in this project. If you want to use the widgets in another React or Next.js project, install the package first:
npm install @ts4nfdi/terminology-service-suiteAfter installing the package, choose the widget you want to use, import it into your React component, and render it on your page with the required properties.
The easiest way to find the right widget and understand how to configure it is to use the Storybook documentation. Storybook shows the available widgets, their properties, example configurations, and live previews:
Open the Storybook documentation
In this demo project, you can see an example implementation in MainPage.tsx.
This guide explains how to use the provided Dockerfile to build and run the Next.js application in a Docker container.
To build the Docker image, run the following command in the project root directory:
docker build -t react-next-widgets-demo .This command will create a Docker image named react-next-widgets-demo.
Once the image is built, you can run a container with:
docker run -p 3000:3000 react-next-widgets-demoThis maps port 3000 inside the container to port 3000 on your local machine.
After running the container, open a web browser and go to:
http://localhost:3000
To stop the running container, press Ctrl+C if running in the foreground, or find the container ID with:
docker psThen stop it using:
docker stop <container_id>To run the container in the background (detached mode), use:
docker run -d -p 3000:3000 react-next-widgets-demoTo view logs from a detached container:
docker logs <container_id>To remove the container:
docker rm <container_id>To remove the image:
docker rmi react-next-widgets-demoIf you want to mount your local project folder inside the container for development, use:
docker run -p 3000:3000 -v $(pwd):/app react-next-widgets-demoThis ensures changes in your local project reflect inside the container.
This guide helps you build, run, and manage your Next.js application using Docker. Happy coding! 🚀