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.
-
Authenticate Copy your GitHub PAT into the
.npmrcfile. Click here for detailed instructions of the authentication process. -
Install The widgets are developed with React 17. If the consumer app uses React > 17, the
--legacy-peer-depsflag must be set during installation. We are in the process of testing the widgets with React versions > 17, but there may still be unwanted behavior.
npm install --legacy-peer-deps- Run
npm run devto start the app in development mode.
Click here for detailed instructions on how to implement the package.
A sample integration is shown 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! 🚀