Skip to content

Commit

Permalink
Merge pull request #176 from shopware/feat/update-readme
Browse files Browse the repository at this point in the history
feat: update readme
  • Loading branch information
lernhart authored Feb 26, 2025
2 parents f884ad1 + 9fd9942 commit 67dbdbb
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 134 deletions.
141 changes: 11 additions & 130 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
> - [ Replace hardcoded urls](#replace-hardcoded-urls)
> - [ Develop locally](#develop-locally)
> - [ Tests](#tests)
> - [ Repository Structure](#repository-structure)
> - [ Contributing](#contributing)
> - [ License](#license)
Expand Down Expand Up @@ -62,29 +61,34 @@ If you are a merchant and want to install the app to your shop, you can find it
```sh
git clone https://github.com/shopware/braintree-app
```
3. [Replace urls](#replace-hardcoded-urls)
4. Run
3. Install dependencies
```sh
devenv up
composer install
npm install
```
5. Run
4. Setup database, manifest and hardcoded urls
```sh
composer setup
```
5. Run
```sh
devenv up
```
6. Install and activate the app
7. Rebuild shopware's storefront js

### Replace hardcoded urls

#### Via command

Run `composer setup:manifest` to generate a manifest setup with the current `APP_URL`
Run `composer setup:url` to replace hardcoded urls with your `APP_URL`, e.g. `http://localhost:8080`.

#### Manually

There are several hardcoded urls that need to be replaced when developing locally:
- `manifest.xml`
- `assets/src/service/api.ts`
- ~~`manifest.xml`~~ (Replaced by manifest templating with `composer setup:manifest`)
- ~~`assets/src/service/api.ts`~~ (Replaced by origin url)
- `Resources/app/storefront/src/checkout/swag-braintree.hosted-fields.js`

Replace `https://braintree.shopware.com` with your `APP_URL`, e.g. `http://localhost:8080`
Expand Down Expand Up @@ -121,129 +125,6 @@ composer infection

---

## Repository Structure

<details>
<summary><b>Repository structure</b></summary>

```sh
└── braintree-app/
├── .env
├── .env.test
├── .envrc
├── .eslintrc.js
├── .github
│ ├── dependabot.yml
│ └── workflows
│ ├── js.yml
│ └── php.yml
├── .gitlab-ci.yml
├── .php-cs-fixer.dist.php
├── .platform
│ ├── routes.yaml
│ └── services.yaml
├── .platform.app.yaml
├── Resources
│ ├── app
│ │ └── storefront
│ ├── snippet
│ │ ├── braintree.de-DE.json
│ │ └── braintree.en-GB.json
│ └── views
│ └── storefront
├── bin
│ └── console
├── composer.json
├── config
│ ├── bundles.php
│ ├── packages
│ │ ├── cache.yaml
│ │ ├── debug.yaml
│ │ ├── dev
│ │ ├── doctrine.yaml
│ │ ├── doctrine_migrations.yaml
│ │ ├── framework.yaml
│ │ ├── http_discovery.yaml
│ │ ├── monolog.yaml
│ │ ├── nelmio_cors.yaml
│ │ ├── routing.yaml
│ │ ├── shopware_app.yaml
│ │ ├── twig.yaml
│ │ ├── uid.yaml
│ │ └── webpack_encore.yaml
│ ├── preload.php
│ ├── routes
│ │ ├── framework.yaml
│ │ ├── shopware_app.yaml
│ │ └── web_profiler.yaml
│ ├── routes.yaml
│ └── services.php
├── devenv.nix
├── devenv.yaml
├── ecs.php
├── infection.json5
├── migrations
│ ├── Version20230920084343AddShop.php
│ ├── Version20231002072740AddConfig.php
│ ├── Version20231002130113AddCurrencyMapping.php
│ └── Version20231024121459AddTransaction.php
├── package-lock.json
├── package.json
├── phpstan.neon
├── phpunit.xml.dist
├── public
│ └── index.php
├── src
│ ├── Braintree
│ │ ├── Dto
│ │ ├── Exception
│ │ ├── Gateway
│ │ ├── Payment
│ │ └── Util
│ ├── Command
│ │ └── SetupUrlCommand.php
│ ├── Controller
│ │ ├── AdminController.php
│ │ ├── BraintreeConfigurationController.php
│ │ ├── EntityController.php
│ │ ├── PaymentController.php
│ │ └── StorefrontController.php
│ ├── Doctrine
│ │ └── RespectfulUuidGenerator.php
│ ├── Entity
│ │ ├── ConfigEntity.php
│ │ ├── Contract
│ │ ├── CurrencyMappingEntity.php
│ │ ├── ShopEntity.php
│ │ └── TransactionEntity.php
│ ├── Framework
│ │ ├── ArgumentResolver
│ │ ├── Exception
│ │ ├── Request
│ │ ├── Response
│ │ └── Serializer
│ ├── Kernel.php
│ ├── Repository
│ │ ├── AbstractRepository.php
│ │ ├── ConfigRepository.php
│ │ ├── CurrencyMappingRepository.php
│ │ ├── ShopRepository.php
│ │ └── TransactionRepository.php
│ └── Tests
│ ├── Contract
│ ├── Entity.php
│ ├── IdsCollection.php
│ ├── Repository.php
│ └── Serializer
├── templates
│ └── admin-sdk.html.twig
├── tsconfig.json
└── webpack.config.js
```
</details>

---

## Contributing

Contributions are welcome! Here are several ways you can contribute:
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@
"setup": [
"bin/console doctrine:schema:drop --force --full-database",
"bin/console doctrine:migrations:migrate -n",
"@setup:url",
"@setup:manifest"
"@setup:manifest",
"@setup:url"
],
"setup:url": [
"bin/console setup:url",
Expand Down
2 changes: 0 additions & 2 deletions src/Command/SetupUrlCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ class SetupUrlCommand extends Command
{
// relative to %kernel.project_dir%
public const FILES = [
'manifest.xml',
'assets/src/service/api.ts',
'Resources/app/storefront/{src/checkout,dist/storefront/js/swag-braintree-app}/*',
];

Expand Down

0 comments on commit 67dbdbb

Please sign in to comment.