Skip to content

Commit

Permalink
docs: add additional information in Readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Gandhi11 committed Oct 13, 2023
1 parent 8cef00c commit 91ffbc3
Showing 1 changed file with 45 additions and 3 deletions.
48 changes: 45 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,47 @@

* Docker

## Environnement
## Environment provided by Docker

* PHP 8.2
* Mysql 8.x
* Redis
* Mailpit (http://localhost:8026/)

### Copy .env.example to .env
```
cp .env.example .env
```

### Install dependencies with Docker

```
docker run --rm \
-u "$(id -u):$(id -g)" \
-v $(pwd):/var/www/html \
-w /var/www/html \
composer install --ignore-platform-reqs
```

### Start dev server with Docker
```
./vendor/bin/sail up
```

### Possible errors
If you are getting a mysql error like this `Another process with pid <id> is using unix socket file` when starting sail. You can try this command and restart sail.
```
docker-compose down --volumes
./vendor/bin/sail up
```

## Project setup
```
./vendor/bin/sail php artisan key:generate
./vendor/bin/sail composer install
./vendor/bin/sail php artisan migrate
./vendor/bin/sail php artisan db:seed
./vendor/bin/sail yarn install
./vendor/bin/sail yarn install
```

### Compiles for development
Expand All @@ -35,6 +57,26 @@
./vendor/bin/sail yarn build
```

### Access the application
```
http://localhost:8084/
```

## Debugging (PHPStorm)
To make sure xdebug is working, you need to properly map your path.
In Settings > PHP > Servers, add a new server with the following settings:
```
Name: localhost
Host: 0.0.0.0
Port: 80
Debugger: Xdebug
Use path mapping: Yes
Project files
Your repository path: /path/to/your/sw_project (ex: /home/user/sw)
Absolute path on the server: /var/www/html
Make sure there is no other path mapped.
```

## Testing

To test the application:
Expand All @@ -49,7 +91,7 @@ To test the application:
- Everything is allowed, you can change the structure of the project, add packages, etc.
- You can use the internet or any other tools to search for solutions.
- You can ask questions if you have any.
- You can use any IDE you want (we suggest PHPSTORM).
- You can use any IDE you want (we suggest PHPStorm).
- Everything should work out of the box with the laravel Sail docker setup. (https://laravel.com/docs/10.x/sail)

### Context
Expand Down

0 comments on commit 91ffbc3

Please sign in to comment.