Synthesis Image Noise Detection on Distributed Data : A web app to collect data on noise detection by humans on images. https://diran.univ-littoral.fr/doc
|
5 years ago | |
---|---|---|
public | 5 years ago | |
server | 5 years ago | |
src | 5 years ago | |
test | 5 years ago | |
.dockerignore | 5 years ago | |
.editorconfig | 5 years ago | |
.eslintrc.js | 5 years ago | |
.gitignore | 5 years ago | |
LICENSE | 5 years ago | |
README.md | 5 years ago | |
babel.config.js | 5 years ago | |
back.Dockerfile | 5 years ago | |
config.js | 5 years ago | |
docker-compose.frontapp_only.yml | 5 years ago | |
docker-compose.yml | 5 years ago | |
front.Dockerfile | 5 years ago | |
package.json | 5 years ago | |
webhook_deploy_gogs.js | 5 years ago | |
yarn.lock | 5 years ago |
A web app to collect data on noise detection by humans on images.
git clone https://gogs.univ-littoral.fr/Prise3D/Antoine_Internship.git
cd Antoine_Internship
Use the following environment variables to configure the application.
Option | Default value | Description | Server | Client |
---|---|---|---|---|
PORT |
5000 |
The port used by the started application | ✅ | ✅ |
SERVE_CLIENT |
true |
Should the server serve client (Fully local application) | ✅ | ⬜️ |
IMAGES_PATH |
./images |
The directory where the images are stored (absolute path if changed ⚠️) | ✅ | ⬜️ |
Configure more deeply the way the app works by modifying config.js.
Option | Default value | Description |
---|---|---|
apiPrefix |
/api |
The url prefix for the API |
imageServedUrl |
/api/images |
The url prefix from where the images are served |
serverPort |
5000 |
The port used by the server |
imagesPath |
./images |
The directory where the images are stored |
serveClient |
true |
Should the server serve client files from the /dist directory |
fileNameConvention |
/^(.*)?_([0-9]{2,})\.(.*)$/ |
File name convention for images |
sceneFileNameBlackList |
['config', 'seuilExpe', 'extracts'] |
Files to ignore in scenes |
extractsDirName |
extracts |
Name of the directory containing extracts |
Linux
PORT=8080 SERVE_CLIENT=true IMAGE_PATH=/var/images docker-compose up
Windows
SET PORT=8080
SET SERVE_CLIENT=true
SET IMAGE_PATH=C:\my\images
docker-compose up
Linux
SERVE_CLIENT=false docker-compose up
Windows
SET SERVE_CLIENT=false
docker-compose up
docker-compose -f docker-compose.frontapp_only.yml up
When using a new version of the project, you need to re-build the application with Docker.
# Server / Server + client versions
docker-compose build
# Client only version
docker-compose -f docker-compose.frontapp_only.yml build
When using Windows, it may happen that you can't properly run the containers because of Windows's path system being different. To circumvant this problem, you can do the following steps.
- On Command Line: "set COMPOSE_CONVERT_WINDOWS_PATHS=1";
- Restart Docker for Windows;
- Go to Docker for Windows settings > Shared Drives > Reset credentials > select drive > Apply;
- Reopen Command Line;
- Kill the Containers;
- Rerun the Containers.
Install project's dependencies.
yarn install
If this is a production build, set the NODE_ENV
environment variable to production
to enhance performance.
Linux
export NODE_ENV=production
Windows
SET NODE_ENV=production
yarn run server:start
yarn run server:dev
yarn run server:lint
Files will be built to the dist/
directory.
yarn run app:build
yarn run app:dev
yarn run app:lint
The app can be automatically deployed when a push event is sent to the master branch using Gogs. Open a port to the web and start webhook_deploy_gogs.js.
WEBHOOK_SECRET=your_webhook_secret WEBHOOK_PORT=5000 SERVE_CLIENT=true PORT=8080 node webhook_deploy_gogs.js
You can pass any parameters to the script, they will be passed to the Docker instance. The following are required.
Option | Description |
---|---|
WEBHOOK_SECRET |
The secret set on Gogs to verify the identity |
WEBHOOK_PORT |
The port the script is listening to |