Skip to content

Migration from the old template to this #2994

Description

@ili101

I am using the old version of the template (with v3.3.6), and I wanted to try 2 things: create a new project, and then potentially "update" my existing project.
Following the direction verbatim didn't go well:
Image

So I opened VSCode, created a new PHP 8.5 devcontainer to bootstrap the installer and tried again in it, but I got Docker and Node missing errors, so I added them to the config:

{
	"name": "PHP",
	"image": "mcr.microsoft.com/devcontainers/php:3-8.5-trixie",
	"features": {
		"ghcr.io/devcontainers/features/node:2": {},
		"ghcr.io/postfinance/devcontainer-features/docker-out:1": {}
	}
}

Now downloading and running it again worked (gave some build error but completed):

vscode ➜ /workspaces/temp1 $ ./api-platform my-app --framework=symfony --with-docker --with-pwa --with-admin
...
[ERR_PNPM_IGNORED_BUILDS] Ignored build scripts: [email protected], [email protected]

Run "pnpm approve-builds" to pick which dependencies should be allowed to run scripts.

Aborting installation.
  pnpm install has failed.

Approving required pnpm build scripts
$ 'pnpm' 'install'
✓ Lockfile passes supply-chain policies (verified 655ms ago)
Lockfile is up to date, resolution step is skipped
Already up to date
node_modules/.pnpm/[email protected]/node_modules/unrs-resolver: Running postinstall script, done in 40ms
node_modules/.pnpm/[email protected]/node_modules/sharp: Running install script, done in 67ms
Done in 1.2s using pnpm v11.8.0
Installing API Platform frontend libraries
$ 'pnpm' 'add' '@api-platform/api-doc-parser' 'github:api-platform/zod' '@api-platform/ld' '@api-platform/mercure'
✓ Lockfile passes supply-chain policies (verified 1s ago)
[WARN] 1 deprecated subdependencies found: [email protected]
Packages: +28
++++++++++++++++++++++++++++
Progress: resolved 458, reused 359, downloaded 28, added 28, done

dependencies:
+ @api-platform/api-doc-parser 0.16.10
+ @api-platform/ld 1.0.0
+ @api-platform/mercure 1.0.0
+ @api-platform/zod 0.1.0

Done in 5.5s using pnpm v11.8.0
Setting up React-admin SPA
Creating React-admin SPA
Admin API entrypoint set to https://localhost. Edit admin/.env (VITE_ENTRYPOINT) if your API runs elsewhere.
Installing admin JavaScript dependencies
$ 'npm' 'install'
npm warn deprecated [email protected]: Use your platform's native DOMException instead

added 203 packages, and audited 204 packages in 42s

41 packages are looking for funding
  run `npm fund` for details

7 vulnerabilities (5 moderate, 2 high)

To address issues that do not require attention, run:
  npm audit fix

To address all issues (including breaking changes), run:
  npm audit fix --force

Run `npm audit` for details.
Writing AI agent instructions (AGENTS.md, CLAUDE.md)

                                                                                                                        
 [OK] Project created successfully at /workspaces/temp1/my-app                                                          
                                                                                                                        


Next steps:
  cd my-app/api
  docker compose up --wait
  open https://localhost

  cd ../pwa
  pnpm dev
  open http://localhost:3000

CORS is pre-configured to allow requests from localhost.

  cd ../admin
  npm run dev
  open http://localhost:5173

"my-app" was created
Image
Then from outside the bootstrap devcontainer (from WSL) docker compose up --wait, and API is up on https://localhost 🎉.

However, I see several things missing from the previous template to continue:

  1. compose.yaml doesn't include the "pwa" service config, and I don't see a Dockerfile in the pwa/admin folders.
  2. compose.yaml also doesn't include the "database" (postgres) service config.
  3. I see that symfony-docker added https://github.com/dunglas/symfony-docker/tree/main/.devcontainer, but the created api-platform project doesn't have the ".devcontainer" folder. It would be greatly appreciated if it were included.
  4. No Helm chart, although I can make one myself once compose.yaml has everything. I have a similarly structured Helm project to the old API-platform Helm that also used Bitnami. I added CloudNativePG support to it and an option to migrate from the Bitnami config to the CNPG config. I can share if there is an interest.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions