Skip to content

Georiviere/Georiviere-public

Repository files navigation

Georiviere

Georiviere is the public web application displaying the interface you can use to value your waterways and where users can contribute.

  1. Installation for production
  2. Customize your application

Installation for production

With docker (recommended)

Installation

Follow those instructions in order to install the application on your server :

  1. Download the latest zip archive
unzip install.zip
cd georiviere-public
  1. Modify .env as needed and change your customization (take care it may be hidden by your file browser.)

  2. Build your image

docker compose build

Note : Whenever you need to change your translation. You have to rebuild the image.

  1. Launch the service :
docker compose up -d

You can now access the application by visiting http://localhost:8080/ ! 🎉

Maintenance

Whenever you change the settings you need to relaunch and rebuild the service :

docker compose down
docker compose build
docker compose up -d

Without docker (not recommended)

Prerequisite

  • You need to use node. You can use nvm to get required version.
  • Use nvm and then:
nvm use

Install yarn

npm install -g yarn

Install dependencies

yarn

Environnements variables

cp .env.dist .env

Open the .env file and modify its contents with your own API url and portal number.

Start the application

Once your dependencies are installed and the .env file and your customization are defined, start your server :

In production mode
yarn build
yarn start
Or in development mode by running:
yarn dev

Process manager

In order to have a more robust solution to serve your node server, if you don't want to use Docker which is the main method, our advice is to use pm2.

Here is a quick guide on how to use pm2 with an Ubuntu distribution (Make sure you've installed NodeJS and built the project following the previous step)

sudo npm install -g pm2
PORT=3000 pm2 start yarn --name georiviere-public -- start

Here we specify that the port we want to run our server on is the 3000, that the starting command is yarn start and the name of our process should be georiviere-public.

You can see all your processes and their status by running:

pm2 status

To stop your process:

pm2 stop georiviere-public

To start your process:

pm2 start georiviere-public

You will also be able to see the application logs by running:

pm2 logs georiviere-public

Server configuration

You might need to configure your server to make sure it works properly.

Below you can find a nginx configuration example:

location / {
    proxy_set_header   X-Forwarded-Host     $host;
    proxy_set_header   X-Forwarded-Server   $host;
    proxy_set_header   X-Forwarded-Proto    $http_x_forwarded_proto;
    proxy_set_header   X-Forwarded-For      $proxy_add_x_forwarded_for;
    proxy_set_header   X-Real-IP            $remote_addr;
    proxy_set_header   Host                 $http_host;
    proxy_redirect     off;
    keepalive_timeout 0;
    #proxy_pass         http://node;
    proxy_pass http://localhost:8080;
}
gzip on;
gzip_static on;
gzip_comp_level 5;
gzip_min_length 256;
gzip_proxied any;
gzip_types text/text text/plain text/xml text/css application/x-javascript application/javascript application/json;

Customization

Edit the following files to customize your application:

  • CSS settings: You can modify /src/styles/global.css. The project uses Tailwind CSS. You can also modify colors variables (defined in HSL; See the Tailwind CSS documentation for more information).
  • Locale messages for the application /transation/fr.json. For the moment there is only the french version available.
  • Global customization settings (header/footer/homepage) defined in /src/customization/settings.json.
  • If you need to store images (or others medias), you can drop it in /public/medias. To define your favicons, you need to override favicon-16x16.png, favicon.png, and apple-touch-icon.png in the same folder.