You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This will be your "application" folder. All commands, instructions,... in this guide will be happening inside of this directory.
37
54
38
-
When using forumify cloud hosting, you will have to use sFTP to copy the files from the host to your local environment, make changes, and then upload them back onto the server.
39
-
After uploading these files, you'll have to clear cache so your changes get picked up by forumify.
55
+
If you are planning to develop plugins, this will be your sandbox during development for testing.
56
+
57
+
If you are building a custom forumify application, you can commit and push all the files that are created to your own git repository.
58
+
A standard .gitignore will ensure only required files are included.
59
+
Then later, on your production server, you can clone/pull your repository to update.
60
+
61
+
Reset git so you can link your own repository later:
62
+
```
63
+
$ rm -rf .git
64
+
$ git init
65
+
$ git add .
66
+
$ git commit -m "initial commit"
67
+
```
40
68
41
69
### Installing Dependencies
42
70
@@ -46,18 +74,18 @@ $ composer install
46
74
$ npm install --force
47
75
```
48
76
49
-
This will also use the Symfony Flex composer plugin to set up your project with some basic files that are needed to run the platform.
77
+
This will use the Symfony Flex composer plugin to set up your project with some basic files that are needed to run the platform.
50
78
These files are unique to your project, and you should commit them to version control.
51
79
52
-
### Docker Compose
80
+
####Docker Compose
53
81
54
82
You need 2 services for development, a MySQL server and an email server. You can also add more services like PHPMyAdmin if required.
55
83
56
84
Here's an example `docker-compose.yml` which you can place at your project's root directory.
57
-
```
85
+
```yaml
58
86
services:
59
87
mysql:
60
-
image: mysql:latest
88
+
image: mysql:8.4
61
89
container_name: mysql
62
90
ports:
63
91
- '3306:3306'
@@ -84,7 +112,12 @@ volumes:
84
112
You can go to `localhost:1080` to see all emails sent by your development environment.
85
113
</Alert>
86
114
87
-
### Environment variables
115
+
Start your dependencies:
116
+
```
117
+
docker compose up -d
118
+
```
119
+
120
+
#### Environment variables
88
121
89
122
Inside your project, you will find a `.env` file with some preset environment variables. We'll want to override some for local development.
Once all of your dependencies are ready, you can start your webserver. If you're using Symfony CLI and docker-compose, it'd look somewhat like this:
135
+
We can use the following commands to prepare our database:
103
136
```
104
-
$ docker compose up -d
105
-
$ symfony server:start -d
106
-
$ npm run watch
137
+
$ symfony console doctrine:database:create
138
+
$ symfony console doctrine:migrations:migrate
107
139
```
108
140
141
+
This will create the database specified in our `.env.local` file, and the migrations will add all tables and basic data required to run forumify.
142
+
109
143
<Alert severity="info">
110
-
If you are using Symfony CLI as web server, it's recommended to install a CA certificate to enable HTTPS for your development environment.
111
-
See [this guide](https://symfony.com/doc/current/setup/symfony_server.html#enabling-tls) for more info.
144
+
If you are not using Symfony CLI, replace "symfony console" in these command with "php bin/console".
112
145
</Alert>
113
146
114
-
When you launch for the first time, you will not have a database yet. You can run the install command to create the database and an initial admin user for you.
147
+
### Ready To Launch
148
+
149
+
Once all of your dependencies are ready, you can start your webserver and file watcher:
115
150
```
116
-
$ symfony console forumify:install
151
+
$ symfony server:start -d
152
+
$ npm run watch
117
153
```
118
154
119
155
<Alert severity="info">
120
-
The `symfony` command will only work when you have Symfony CLI installed.
121
-
You can run console commands without Symfony CLI by using `php bin/console forumify:install` instead.
156
+
If you are using Symfony CLI as web server, it's recommended to install a CA certificate to enable HTTPS for your development environment.
157
+
See [this guide](https://symfony.com/doc/current/setup/symfony_server.html#enabling-tls) for more info.
122
158
</Alert>
123
159
124
160
## Finished!
@@ -137,6 +173,19 @@ $ symfony server:start -d
137
173
$ npm run watch
138
174
```
139
175
176
+
<Alert severity="info">
177
+
With Symfony Server you can also create a `.symfony.local.yaml` file that starts the file watcher and message consumers so you don't have to run them manually each time.
178
+
</Alert>
179
+
180
+
```yaml
181
+
# Symfony HTTP Server config for local development
0 commit comments