This project is a web application to have an easy access to It is a full-stack application containing an Express.js backend and a React.js frontend, dockerized using a single Dockerfile for easier deployment and containerization.
This application is composed of three parts:
- Backend: Built using Express, it provides API endpoints and handles server-side operations.
- Frontend: Developed in React, it offers a user interface to interact with the backend services.
- Backoffice: Developed in React, it offers a simple way to handle the application configuration
Each part is encapsulated within a Docker container using a single Dockerfile for streamlined deployment.
Make sure you have the following prerequisites installed:
- Docker: Install Docker
- Node.js 18, we highly recommend using nvm
Follow these steps to set up and run the application:
-
Clone the repository:
git clone https://github.com/Inist-CNRS/tdm-factory.git
-
Navigate to the project directory:
cd tdm-factory
Build the Docker image using the provided Dockerfile:
docker build . -t tdm:v1.0.0 --no-cache
To create a new version of IA Factory, create a new GitHub release with an associated tags. This will run the ci and push an image into Docker Hub.
To run the application in a Docker container:
docker run -p 3000:3000 tdm:v1.0.0
The frontend will be accessible at http://localhost:3000/
, the swagger configuration
at http://localhost:3000/swagger-config
and the back-office at http://localhost:3000/admin
.
You also need a ngrok host for the external host in tdm-be/config/development.json
,
to create a ngrok endpoints run ngrok http 3000
.
Warning
Don't copy the whole URL for hosts.internal.host
but only the part after
https://
(ex: b562-88-123-62-113.ngrok-free.app
).
After setting up this you can run make run-dev
You can run the whole application in dev mode using make run-dev
.
Warning
The tdm-be/dynamic-config.json
file is created for
tdm-be/src/model/defaultDynamicConfig.json
only if it does not already
exist.
Quitting the application in dev mode will not delete this file.
This can lead to weird behavior when this old file is not deleted.
When you start the dev mode, you will be able to access those links:
http://localhost:3000
- Backend parthttp://localhost:5173
- Frontend parthttp://localhost:5174
- Backoffice parthttp://localhost:1080
- Mail service (use to test the mail sending functionality)