Skip to content

Commit

Permalink
Merge pull request #472 from org-SCAN/doc/issue-470-_DOC_More_detaill…
Browse files Browse the repository at this point in the history
…ed_installation_doc

docs: 📝 [DOC] More detailled installation doc
  • Loading branch information
lduf authored Feb 23, 2024
2 parents dc48582 + ad0a1e7 commit 2c6c357
Showing 1 changed file with 54 additions and 3 deletions.
57 changes: 54 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,53 @@
# website
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=TC-netw4ppl_website&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=TC-netw4ppl_website)

Site web du projet :)

This repo contains the code of the website !

# Start the project

## Using SAIL (recommended)

To run the project, you must have :
### Prerequisites
To run the project, you must :

#### 1.Install the following :
- [Docker](https://docs.docker.com/engine/install/)
- [Composer](https://getcomposer.org/doc/00-intro.md)
- [PHP](https://www.php.net/manual/fr/install.php)

#### 2. Create the .env file :

You need to create a `.env` file in the `src` directory based on the `.env.example` file.
> 💡 When you code you should switch the `APP_DEBUG` to `true` to see the errors.
```bash
cp .env.example src/.env
```
#### 3. Docker and sail :

You can now start Docker and follow the [laravel sail documentation](https://laravel.com/docs/10.x/sail#installing-sail-into-existing-applications)
more specifically the installation part.

> 🐬 During the installation, you will be asked to choose the database you want to use. You must choose `mysql` for the database.
Once the installation is done you can run the following command to start the project :

### Install SCAN :
> 📁Move to the `src` directory
Run this command to start the docker of the project
```bash
./vendor/bin/sail up -d #-d to detach the process, you can create an alias for sail later
```

Once the docker is running, access the docker container with the following command (replace `<container_name>` with the name of the container (not the db container, the one with the website code).

```bash
docker exec -it <container_name> /bin/bash
```
Once you are in the container, you can run the following commands to finish the installation ::

```bash
#Run these in the docker container
npm update
cd /var/www/html
Expand All @@ -31,10 +57,35 @@ composer dump-autoload
php artisan key:generate
chmod -R 777 storage/
php artisan migrate:refresh --seed
php artisan queue:work
```

You can now access the website at [localhost:80](http://localhost:80).

### Troubleshooting :

You may encounter some issues while installing the project. Here are some common issues and their solutions :

<hr>

- On command composer require laravel/sail --dev during sail installation: error message saying

```
maatwebsite/excel[3.1.0, ..., 3.1.25] require php ^7.0 -> your php version (8.1.2) does not satisfy that requirement.
```

- **Fix:** ignore the system requirements with `composer require laravel/sail --dev --ignore-platform-reqs` instead of the original command
<hr>

- After launch, the tabs "Network graph", "Field management > Fields" and "User profile" aren't working and return an exception:
```
The /var/www/html/bootstrap/cache directory must be present and writable.
```
- **Fix**: change the permissions on the cache directory: `chmod -R 770 bootstrap/cache/`

<hr>

If you encounter any other issues, please raise an issue on the repository with the error message and the steps you followed.

## Using docker

Expand Down

0 comments on commit 2c6c357

Please sign in to comment.