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

Jérôme BUISINE a2fb9bd2be Merge branch 'release/v0.2.6' il y a 5 ans
DOCUMENTATION cbd8431eb6 Added documentation and experiment templating enhancements il y a 5 ans
public b8a3856e84 Added Vuetify + theme. Routing + animation system il y a 5 ans
server 944b4e8566 Added extracts remover service il y a 5 ans
src cd9ed1abb0 Linted latest experiment il y a 5 ans
test 23aed153fc Added dataCollect route tests il y a 5 ans
.dockerignore 88b91170a2 Added apiDoc documentation il y a 5 ans
.editorconfig 6c62d244ef init il y a 5 ans
.eslintrc.js 94610236d9 Collect more data, added DataCollect route doc il y a 5 ans
.gitignore 2991ca6cf9 Better config system with automatic loading. Refactored file structure il y a 5 ans
LICENSE 90a7f736ab Added readme and mit license il y a 5 ans
README.md 944b4e8566 Added extracts remover service il y a 5 ans
babel.config.js 6c62d244ef init il y a 5 ans
back.Dockerfile bf359966c4 Fixed docker config copy fail il y a 5 ans
cleanExtracts.js 3dc13239fa Added experiment "AreSameImagesReferenceOneExtract" il y a 5 ans
config.js 944b4e8566 Added extracts remover service il y a 5 ans
config.messagesId.js 616823b3fe Merge branch 'feature/api-ping-data-collect' into develop il y a 5 ans
docker-compose.frontapp_only.yml 72cd80e1e6 Release hotfix il y a 5 ans
docker-compose.yml 23eced6d79 Update docker for mongo il y a 5 ans
experimentConfig.default.js 9cd5f86a30 Update of default experiment configuration il y a 5 ans
front.Dockerfile 72cd80e1e6 Release hotfix il y a 5 ans
index.js 3dc13239fa Added experiment "AreSameImagesReferenceOneExtract" il y a 5 ans
jsconfig.json 2991ca6cf9 Better config system with automatic loading. Refactored file structure il y a 5 ans
package.json 498c1ebd11 Version bump il y a 5 ans
webhook_deploy_gogs.js 69e8a47a76 Fixed webhook script and docker port il y a 5 ans
yarn.lock 944b4e8566 Added extracts remover service il y a 5 ans

README.md

Antoine_Internship

A web app to collect data on noise detection by humans on images.

Download project

git clone https://gogs.univ-littoral.fr/Prise3D/Antoine_Internship.git
cd Antoine_Internship

Run as a Docker instance

Configure application

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 ⚠️) ⬜️
MONGO_URI mongodb://localhost/webexpe MongoDB database connection URI ⬜️

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
mongoDatabaseURI mongodb://localhost/webexpe MongoDB database connection URI
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
extractsDirName extracts Name of the directory containing extracts
sceneFileNameBlackList ['config', 'seuilExpe', 'extracts'] Files to ignore in scenes
deleteExtractsCronTime 0 3 * * * (every day at 03:00 AM) Cron time for extracts deletion
logger Logs : logs/server.combined.log Errors : logs/server.error.log Default application logger
wsLogger Logs : logs/ws.log Errors : logs/ws.error.log WebSocket logger configuration
dbLogger Logs : logs/db.log Errors : logs/db.error.log Database logger configuration

Configure experiments

If you want to use the default experiments configurations, you can skip this part, the Dockerfile does it for you.

You can modify the configuration for each mixins, experiments or scene. To do so, you first need to initialize experiment configurations first.

cp -r experimentConfig.default experimentConfig

You can modify the configuration for each mixins, experiments or scene by modifying files in the newly created ./experimentConfig directory. You configuration will be copied in the Docker instance.

Run server + client

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

Run server only

Linux

SERVE_CLIENT=false docker-compose up

Windows

SET SERVE_CLIENT=false
docker-compose up

Run client only

docker-compose -f docker-compose.frontapp_only.yml up

Notice

New version Docker build

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

Docker instance on a Windows host

As of now, Windows hosts are not supported due to MongoDB volumes not being mappable to this system.

Run on the file system

Project setup

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

API

Run the server

yarn run server:start

If you specifically want to not start the extracts remover service (extracts are automatically deleted everyday), use the following.

server:start:no-delete-extracts

Automatically fix the API code syntax with ESLint

yarn run server:lint

Client

To use the client, you need to initialize experiment configurations first.

cp -r experimentConfig.default experimentConfig

You can modify the configuration for each mixins, experiments or scene by modifying files in the newly created ./experimentConfig directory.

Compile and minify for production

Files will be built to the dist/ directory.

yarn run app:build

Run a hot-reload server for client development

yarn run app:dev

Automatically fix the client code syntax with ESLint

yarn run app:lint

Automated deployment

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

Running tests

The docker-compose script will automatically run tests. Use the following command to run them by hand.

yarn test

Documentation

The docker-compose script will automatically build the documentation. Use the following command to build it by hand.

yarn doc

The documentation is generated to the doc/ directory. If you started the server, the documentation is served at /doc/.

License

The MIT license