Skip to content

Commit ab40cc7

Browse files
authored
chore: update dev setup docs (#208)
* update dev setup docs * add doc
1 parent 6ba5c38 commit ab40cc7

2 files changed

Lines changed: 26 additions & 5 deletions

File tree

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,4 +91,6 @@ telepresence.log
9191

9292
.DS_Store
9393

94-
docker-magento/magento2
94+
docker-magento/magento2
95+
96+
tmp/

DEV.md

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
# Development using Mac Silicon
2+
23
**TLDR**
4+
35
- use Docker setup to easily dev
46

57
## 1. Machine Setup
8+
69
1. Use Mac with Silicon
710
2. Install `php@8.4`
811
1. Run `brew install php@8.4`
@@ -11,7 +14,9 @@
1114
1. Why? because `webdevops/php-apache-dev:8.4` doesn't work on ARM64 because of its apached ssl failing. [see this issue](https://github.com/webdevops/Dockerfile/issues/433). Weirdly, testing in orbstack works.
1215
2. Run `brew install orbstack`
1316
3. Run `Orbstack` in Application
17+
1418
## 2. Local Magento2.4 Setup w/ Xendit Module
19+
1520
1. Clone `magento2` in `./docker-magento/`
1621
1. Run `git clone https://github.com/magento/magento2.git`
1722
2. `git checkout 2.4.8`
@@ -48,7 +53,7 @@
4853
4. `php bin/magento cache:flush`
4954
5. `php bin/magento setup:static-content:deploy -f`
5055
4. **To check**
51-
1. Open `https://magento.local` in your browser
56+
1. Open `https://magento24.local` in your browser
5257
1. Important to use `https` as `http` might direct you to your Mac's local apache httpd
5358
7. Add Sample Data
5459
1. **Note**: this is so your store have products. useful for dev
@@ -62,7 +67,7 @@
6267
1. (optional) If you encounter `curl error 28 while downloading https://repo.packagist.org/packages.json: Failed to connect to repo.packagist.org port 443 after 10007 ms: Timeout was reached` when downloading from composer, you may need to run this command first before retrying `composer config -g repo.packagist composer https://packagist.org`
6368
4. Run `php bin/magento setup:upgrade`
6469
5. Run `rm -rf generated && php bin/magento setup:upgrade && php bin/magento cache:clean`
65-
6. Visit `https://magento.local` to see the products of sample data
70+
6. Visit `https://magento24.local` to see the products of sample data
6671
8. Check if Magento us running and Have xendit
6772
1. Open `https://magento24.local/admin/`
6873
2. Login username: `admin` password: `abcd1234`
@@ -71,6 +76,7 @@
7176
5. See [image](./docs/imgs/magento-admin-xendit.png)
7277

7378
## 3. Testing Paying Locally
79+
7480
1. Generate Xendit Public and Private Key
7581
1. Have a xendit test account
7682
2. Go to `Xendit Dashboard > Settings` create Private API Key
@@ -88,38 +94,46 @@
8894
5. In Magento Admin, go to `Stores > Configuration > Sales > Payment Methods > Xendit`
8995
6. Set the "Custom Callback URL" field to your ngrok URL (e.g., `https://abc123.ngrok.io`)
9096
7. Now xendit payment links webhooks will be sent to your local development environment
97+
3.5 (Optional) Change `Xendit Callback URL`
98+
8. If you plan to connect to xendit's staging environment, you have to change this. Ask Xendit Engineers on TPI Gateway Staging URL
9199
4. Do test payment
92-
1. Open `https://magento.local`
100+
1. Open `https://magento24.local`
93101
2. Buy anything. Add to Cart. Fill up shipping.
94102
3. Pick `mandiri va` and you will get redirect to Xendit Payment Link
95103
4. Click `Simulate Payment in the banner`
96104
5. After you will get redirected back, and should see a success.
97105

98106
## Tips
107+
99108
1. Run `./bin/sync-plugin.sh` to sync changes when developing
100109
2. When you have changes on config files (e.g. xml)
101110
1. Run `php bin/magento cache:flush && php bin/magento setup:upgrade` then refresh browser to see changes
102111

103112
## TroubleShoot
104113

105114
### Error during setup default website
115+
106116
```
107117
In WebsiteRepository.php line 159:
108118
109119
The default website isn't defined. Set the web
110120
site and try again.
111121
```
122+
112123
- this probably happens if u recreate the docker container
113124

114125
#### Fix
126+
115127
- delete all cache and env generated by previous setup
128+
116129
```
117130
docker exec web bash -c "cd app && rm -rf app/etc/env.php app/etc/config.php var/cache/* var/page_cache/* var/session/* var/di/* var/generation/* var/view_preprocessed/* pub/static/* generated/*"
118131
```
119132

120133
## Appendix
121134

122135
### Magento Installation Command
136+
123137
```
124138
php bin/magento setup:install \
125139
--cleanup-database \
@@ -149,6 +163,7 @@ php bin/magento setup:install \
149163
```
150164

151165
### Seeding Data with no Auth
166+
152167
### Alternative (Non auth)
153168

154169
You can also get the sample data by adding several package from composer, add this package into your `composer.json` installation
@@ -187,8 +202,8 @@ composer update
187202
Local Host setup
188203
`sudo -- sh -c "echo '127.0.0.1 magento23.local' >> /etc/hosts"`
189204

190-
191205
Installation Command
206+
192207
```
193208
php bin/magento setup:install \
194209
--admin-firstname=Admin \
@@ -214,12 +229,15 @@ php bin/magento setup:install \
214229
```
215230

216231
### Magento 2.3 Setup problems
232+
217233
If you encounter this problem when trying to install Magento inside docker
234+
218235
```
219236
Fatal error: Uncaught Error: Call to undefined function xdebug_disable()
220237
```
221238

222239
Go to this directory (after finished installing dependencies)
240+
223241
```
224242
vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/_bootstrap.php
225243
```
@@ -228,6 +246,7 @@ Replace this line
228246
`xdebug_disable();`
229247

230248
Into
249+
231250
```
232251
if (function_exists('xdebug_disable')) {
233252
xdebug_disable();

0 commit comments

Comments
 (0)