Skip to content

Commit 4595bde

Browse files
alexjustesengitbook-bot
authored andcommitted
GITBOOK-65: change request with no subject merged in GitBook
1 parent 14ae048 commit 4595bde

File tree

2 files changed

+64
-17
lines changed

2 files changed

+64
-17
lines changed

SUMMARY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343

4444
## 🤹 Contributing
4545

46-
* [Setup Your Environment](contributing/setup-your-environment.md)
46+
* [Development Environment](contributing/setup-your-environment.md)
4747

4848
## 🔗 More
4949

contributing/setup-your-environment.md

Lines changed: 63 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,21 @@ description: >-
44
contribute to Speedtest Tracker.
55
---
66

7-
# Setup Your Environment
7+
# Development Environment
88

9-
Speedtest Tracker is built on the [Laravel](https://laravel.com/) framework, this means we get to use some awesome 1st party packages like [Laravel Sail](https://laravel.com/docs/9.x/sail) to create a local containerized development environment.
9+
Speedtest Tracker is built on the [Laravel](https://laravel.com/) framework, this means we get to use some awesome 1st party packages like [Laravel Sail](https://laravel.com/docs/10.x/sail) to create a local containerized development environment.
1010

1111
These directions will walk you through the steps of setting up that environment.
1212

1313
{% hint style="info" %}
1414
These directions assume you have a working knowledge of the Laravel framework. If you have questions on how to use it the [Laravel Docs](https://laravel.com/docs/9.x) and [Laracasts series](https://laracasts.com/series/laravel-8-from-scratch) on "Laravel from Scratch" are a good place to start.
1515
{% endhint %}
1616

17-
### 1. Clone the repository
17+
***
18+
19+
### Setup and Start the Development Environment
20+
21+
#### 1. Clone the repository
1822

1923
First let's clone the [repository](https://github.com/alexjustesen/speedtest-tracker) to your machine, I prefer [GitHub's CLI](https://cli.github.com/) so that command is included below.
2024

@@ -23,54 +27,97 @@ gh repo clone alexjustesen/speedtest-tracker \
2327
&& cd speedtest-tracker
2428
```
2529

26-
### 2. Make a copy of \`.env.example\` and update DB variables
30+
#### 2. Make a copy of \`.env.example\` and update DB variables
2731

2832
Next we need to make a copy of `.env.example`, the environment file is what Laravel uses.
2933

3034
```bash
3135
cp .env.example .env
3236
```
3337

34-
You'll also want to fill in a few `DB_` variables here as well which will control which database Laravel will use. I've included PostgreSQL as the default database system.
38+
You'll also want to fill in a few `DB_` variables here as well which will control which database Laravel will use. I've included MySQL as the default database for the development environment.
3539

3640
```
37-
DB_CONNECTION=pgsql
38-
DB_HOST=pgsql
39-
DB_PORT=5432
41+
DB_CONNECTION=mysql
42+
DB_HOST=mysql
43+
DB_PORT=3306
4044
DB_DATABASE=speedtest_tracker
4145
DB_USERNAME=sail
4246
DB_PASSWORD=password
4347
```
4448

45-
### 3. Install Composer dependencies
49+
#### 3. Install Composer dependencies
4650

4751
We'll use a temporary container to install the Composer dependencies for the application.
4852

4953
```bash
5054
docker run --rm \
5155
-u "$(id -u):$(id -g)" \
52-
-v $(pwd):/var/www/html \
56+
-v "$(pwd):/var/www/html" \
5357
-w /var/www/html \
54-
laravelsail/php81-composer:latest \
58+
laravelsail/php82-composer:latest \
5559
composer install --ignore-platform-reqs
5660
```
5761

58-
### 4. Starting a development environment
62+
#### 4. Build Sail development container
5963

60-
To start up the environment we can now use the Sail binary that is included with the package to build our development image and spin up a network with a database container.
64+
We utilize [Laravel Sail](https://laravel.com/docs/10.x/sail) for a local development environment this way on your machine the only requirements are Git and Docker. To build the development environment run the commands below.
65+
66+
```bash
67+
./vendor/bin/sail build --no-cache
68+
69+
# or if you have a Sail alias setup...
70+
sail build --no-cache
71+
```
72+
73+
#### 5. Start the development environment
74+
75+
To start up the environment we can now use the Sail binary that is included with the package to start our development environment.
6176

6277
```bash
6378
./vendor/bin/sail up -d
6479

65-
# or if you have a Sail alias setup..
80+
# or if you have a Sail alias setup...
6681
sail up -d
6782
```
6883

69-
### 5. Stopping the development environment
84+
#### 6. Installing the application
85+
86+
Once the environment is setup you can install a fresh version of the application by running the following command. Keep in mind this WILL refresh the entire database.
87+
88+
```bash
89+
./vendor/bin/sail artisan app:install --force
90+
91+
# or if you have a Sail alias setup...
92+
sail artisan app:install --force
93+
```
94+
95+
{% hint style="info" %}
96+
You can reset your development environment at any time by running the `app:install` command.
97+
{% endhint %}
98+
99+
***
100+
101+
### Processing Jobs in the Queue using a Worker
102+
103+
Processes like running a speedtest and sending notifications are offloaded to be run by a worker process. If you're testing or developing anything requiring the queue jobs be processed run the command below.
104+
105+
```bash
106+
./vendor/bin/sail artisan queue:work
107+
108+
# or if you have a Sail alias setup...
109+
sail artisan queue:work
110+
```
111+
112+
***
113+
114+
### Stopping the development environment
115+
116+
When you're done in the environment you can stop the containers using the command below.
70117

71118
```bash
72119
./vendor/bin/sail down
73120

74-
# or if you have a Sail alias setup..
121+
# or if you have a Sail alias setup...
75122
sail down
76123
```

0 commit comments

Comments
 (0)