🏁Quick Start

Good to know: SCAN works entirely with Docker! No need to worry about different software versions, Docker handles everything.

Install SCAN in only few steps :

Clone the github project

You may clone the github project. The required files are located in the src directory.

git clone https://github.com/TC-netw4ppl/website.git

Install Docker

The best way to install our software is with Docker:

You can use https://www.portainer.io to manage your different docker containers easily.

Docker compose

Here is an example of a docker-compose used :

version: '3.7'

services:
 sql:
  image: mysql:5.7
  container_name : sql
  restart : unless-stopped
  environment:
   MYSQL_DATABASE: ${DATABASE_NAME}
   MYSQL_ROOT_PASSWORD: ${DATABASE_PASSWORD}
   MYSQL_PASSWORD: ${DATABASE_PASSWORD}
   MYSQL_USER: ${DATABASE_USERNAME}
  volumes:
   - ${LOCAL_DB_STORAGE_PATH}:/var/lib/mysql
  ports:
   - '3306:3306'

 app:
  image: netw4ppl/website:latest
  container_name: app
  restart: unless-stopped
  volumes :
   - ${LOCAL_WEBSITE_PATH}:/var/www/html/
   - ${LOCAL_SSL_PATH}:/var/imported/ssl/
   - ${LOCAL_APACHE_CONFIGURATION_FILE}/etc/apache2/sites-available/000-default.conf
  ports:
   - '2080:80'
   - '2443:443'
Variable
Value
DATABASE_NAME

The name of the database

DATABASE_PASSWORD

The master password of the database

DATABASE_USERNAME

The username used to connect to the database

LOCAL_DB_STORAGE_PATH

A folder in which the contents of your database will be stored

LOCAL_WEBSITE_PATH

The path where the website code is stored. ⚠️ If you clone the project from github, make sure the path points to src

LOCAL_SSL_PATH

The path to your SSL certificate. Can be ignored if you don't want to use https.

Recommended to secure access to the API.

LOCAL_APACHE_CONFIGURATION_FILE

The path to an apache configuration file, an example of which is given here.

Required configuration

Apache Configuration file

You can delete the lines concerning the ssl certificate if you do not use https

# conf/vhost.conf
<VirtualHost *:80>
  DocumentRoot /var/www/html/public

  <Directory "/var/www/html">
      AllowOverride all
      Require all granted
  </Directory>

  ErrorLog ${APACHE_LOG_DIR}/error.log
  CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

# Delete the lines below if you don't use ssl 
<IfModule mod_ssl.c>
<VirtualHost *:443>
  DocumentRoot /var/www/html/public

  <Directory "/var/www/html">
      AllowOverride all
      Require all granted
  </Directory>

  SSLCertificateFile /var/imported/ssl/fullchain.pem
  SSLCertificateKeyFile /var/imported/ssl/privkey.pem
  SSLEngine on
</VirtualHost>
</IfModule>

A Deepl Account

SCAN automatically translates the created fields and lists. To use the automatic translation feature, you need to create an account on DeepL and fill in your Token API. The free version offers 500,000 characters per month, which is more than enough for the application's needs.

You can find the information needed to create an account here: https://www.deepl.com/en/pro-api?cta=header-pro-api/

.env file

This .env file MUST be completed and placed at the root of src

APP_NAME=SCAN
APP_ENV=local
APP_KEY=
APP_DEBUG=false
APP_URL=localhost

LOG_CHANNEL=stack
LOG_LEVEL=debug

DB_CONNECTION=mysql
DB_HOST=sql_container_name
DB_PORT=3306
DB_DATABASE='database_name'
DB_USERNAME=USER
DB_PASSWORD='PASSWORD'

BROADCAST_DRIVER=log
CACHE_DRIVER=file
QUEUE_CONNECTION=sync
SESSION_DRIVER=database
SESSION_LIFETIME=120

MEMCACHED_HOST=127.0.0.1

MAIL_MAILER=smtp
MAIL_HOST=mailhog
MAIL_PORT=1025
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
MAIL_FROM_ADDRESS=null
MAIL_FROM_NAME="${APP_NAME}"

DEFAULT_EMAIL="default user email"
DEFAULT_PASSWORD="default user password"
DEFAULT_TEAM="default user team"

TRANSLATION_API_URL="https://api-free.deepl.com/v2/translate"
TRANSLATION_API_TOKEN="YOUR API TOKEN"
Variable
Value
APP_KEY

Must be leaft blank

APP_DEBUG

Set false in case of production

DB_HOST

You must put the docker sql container name. If you used the docker configuration above, put sql

DB_DATABASE

You must put the same name as the one used during the docker configuration.

DB_USERNAME

You must put the same username as the one used during the docker configuration.

DB_PASSWORD

You must put the same password as the one used during the docker configuration.

DEFAULT_EMAIL

Set the default user's email. This information will be used to create the first account on the application.

DEFAULT_PASSWORD

Set the default user's password. This information will be used to create the first account on the application.

DEFAULT_TEAM

Set the default team name. This information will be used to create the first team. You can putDEFAULT ICRC TEAM for example.

TRANSLATION_API_URL

The translation API URL. If you use the free version of deepL, the preset URL is the right one.

TRANSLATION_API_TOKEN

Your DeepL API Token

Finalize the installation

Only a few seconds left and you'll be there. Run these commands in your docker to finish!

To execute in your docker container run :

If you used the docker configuration example above, the <APPLICATION_CONTAINER_NAME> should be app

docker exec -it <APPLICATION_CONTAINER_NAME> /bin/bash
npm update
cd /var/www/html
composer update
php artisan cache:clear
composer dump-autoload
chmod -R 777 storage/
chmod 777 app/Models
chmod 777 -R database/migrations
chmod -R 777 bootstrap
php artisan key:generate
php artisan migrate:refresh --seed

Real last step

Visit http://localhost:<PORT> and you're in!

<PORT> must be the one filled in for the docker's app container (2080 by default)

Congratulations, it's all over, you've earned a little beer.

Take a break

Last updated