Test live version here
Make sure to go in to PictogramAPI and change the CORS origin in Program.cs before Building. This is how:
- Go in to the projects root folder (
Pictogram_3_Semester). - Go in to the
PictogramAPIfolder. - Edit the file using your Texteditor of choice (fx.
vim). - Find the line:
policy.WithOrigins("http://localhost:49732") // React dev server(should be line 64) - Change the line to
policy.WithOrigins("http://your-server:<your-custom-port"<) - Save the file.
Now you should be able to build the code without any issues.
Download the repository from the branch Deploy.
Alternatively you can Clone it by typing:
git clone -b Deploy https://github.com/hund555/Pictogram_3_Semester.git .
This option is for a full and quick deploy on a single server.
To start the build:
- Go in to the projects root folder (
Pictogram_3_Semester). - Change the permissions for the build-script:
chmod -x build.shorchmod 775 build.sh. - Run
./build.sh. Now it should be compiling and building the container.
In the end, it should show you the container.
Use cmd:
- go in to the folder.
- run:
docker compose up --build -d.
This option is for a partialy dockerized environment where API and MongoDB get dockerized seperate from React (fx if you want the React Frontend to run on a different server).
- Go in to the root folder (
Pictogram_3_Semester) - Now go in to
PictogramAPI. - Run
docker compose up --build -d.
This part is, when you want React to run dockerized (fx. on a different server)
- Go in to the root folder (
Pictogram_3_Semester). - Go in to
React_WebApplication. - Run
docker compose up --build -d.
Alternatively, if you don't want React dockerized
- Go in to the projects root folder (
Pictogram_3_Semester). - Go in to
React_WebApplication. - Run
npm install - Run
npm run build
Make sure to go in to the backend_Address.json and set ipaddress: "apiserver" to ipaddress: "<your-api-server-ip>"
This option is for, when you only want the API and the Database dockerized but the React running in dev localy.
To accomplish that you download the Version from the master branch.
Alternatively use the command git clone -b Deploy https://github.com/hund555/Pictogram_3_Semester.git.
Go in to the projects root folder (Pictogram_3_Semester).
- go in to the
PictogramAPIfolder. - run
docker compose up --build -d
Afterwards you can go in to the React_Webapplication folder and do npm install and run npm run dev
In the Compose script for the fully Dockerized Deploy the communication between the API and MongoDB is fully isolated, to ensure a secure communication and higher security