{"id":24772598,"url":"https://github.com/mgdsoft/symfony-profiler-spa","last_synced_at":"2025-10-11T21:30:21.836Z","repository":{"id":151636026,"uuid":"624554987","full_name":"MGDSoft/symfony-profiler-spa","owner":"MGDSoft","description":"For lovers of SPA and symfony profiler","archived":false,"fork":false,"pushed_at":"2025-06-26T16:09:54.000Z","size":321,"stargazers_count":9,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-09-03T09:57:03.845Z","etag":null,"topics":["ajax","development","profiler","spa","symfony"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MGDSoft.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-04-06T18:23:49.000Z","updated_at":"2025-06-26T16:09:58.000Z","dependencies_parsed_at":"2024-10-26T22:47:05.625Z","dependency_job_id":null,"html_url":"https://github.com/MGDSoft/symfony-profiler-spa","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/MGDSoft/symfony-profiler-spa","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MGDSoft%2Fsymfony-profiler-spa","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MGDSoft%2Fsymfony-profiler-spa/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MGDSoft%2Fsymfony-profiler-spa/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MGDSoft%2Fsymfony-profiler-spa/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MGDSoft","download_url":"https://codeload.github.com/MGDSoft/symfony-profiler-spa/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MGDSoft%2Fsymfony-profiler-spa/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279008860,"owners_count":26084518,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-11T02:00:06.511Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ajax","development","profiler","spa","symfony"],"created_at":"2025-01-29T04:23:33.168Z","updated_at":"2025-10-11T21:30:21.825Z","avatar_url":"https://github.com/MGDSoft.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Symfony profiler for your SPA (Single page application)\n\n![Symfony Sersion](https://img.shields.io/badge/Symfony-5/6/7-purple.svg?style=flat-square\u0026logo=symfony)\n![php Version](https://img.shields.io/badge/php-7/8-blueviolet)\n![Licence](https://img.shields.io/badge/Licence-MIT-brightgreen)\n\nThis bundle allows you to integrate the Symfony profiler bar into your preferred JavaScript framework.\n\n![example](https://github.com/MGDSoft/symfony-profiler-spa/blob/main/docs/example_profiler_spa.png?raw=true \"photo\")\n\n### Here's a quick installation guide\n\nInstall the bundle into your **API PROJECT**\n\n```shell\ncomposer req mgdsoft/symfony-profiler-spa --dev\n```\n\nAdd the new route to your **API PROJECT**:\n\n```yaml\n# config/routes/web_profiler.yaml\nwhen@dev:\n    mgd_profiler_spa:\n        resource: '@SymfonyProfilerSPABundle/Resources/config/routing/routing.yml'\n        prefix: /\n```\n\nCreate the asset or copy if you are not using asset component:\n\n```shell\nbin/console assets:install\n```\n\nThis execution will copy 'load_toolbar_spa.js' file to your public folder, you only have to include it in your html file\nto your **FRONTEND project**:\n\n```html\n\u003cscript src=\"//yourdomain.lol/bundles/symfonyprofilerspa/load_toolbar_spa.js\"\u003e\u003c/script\u003e\n```\n\nThat's all! The `load_toolbar_spa.js` is created in vanilla JavaScript, so it's available for use in all frameworks and\nlibraries. Interceptors available for XHR and fetch.\n\n### JS Config\n\nFor custom url toolbar you have to use this custom attribute `data-url-toolbar`\n\n```html\n\u003cscript src=\"//yourdomain.lol/bundles/symfonyprofilerspa/load_toolbar_spa.js\" defer data-url-toolbar=\"{ORIGIN}/internal/toolbar/{TOKEN}\"\u003e\u003c/script\u003e\n```\n\n## How it works\n\nIf you take a look inside `src/Resources/public/load_toolbar_spa.js`, you'll find a simple script that creates an HTTP\ninterceptor. The first `x-debug-token-link` header it detects will trigger a request to the API server to retrieve the\nprofiler.\n\n![example](https://github.com/MGDSoft/symfony-profiler-spa/blob/main/docs/example_profiler_spa_loading_profile.gif?raw=true \"loading profile\")\n\n## Repo demo\n\nHere is a repository installed and ready for testing:\nhttps://github.com/MGDSoft/symfony-profiler-spa-demo\n\n## Trouble with CORS\n\nDont forget your nginx configuration to avoid cors\n\n```nginx\nadd_header Access-Control-Allow-Origin \"http://yourdomain.lol\";\nadd_header Access-Control-Allow-Methods \"GET, POST, OPTIONS\";\nadd_header Access-Control-Allow-Headers \"Origin, X-Requested-With, Content-Type, Accept, Authorization, x-debug-token-link, X-Debug-Token\";\nadd_header Access-Control-Expose-Headers \"X-Debug-Token, X-Debug-Token-Link\";\n```\n\n## Cool things\n\nDon't forget to configure your IDE to open errors/controllers, and for more information, please visit https://symfony.com/doc/current/reference/configuration/framework.html#ide.\nIf you have trouble configuring PHPStorm, you can use this snippet for a quick solution.\n\n```yaml\nparameters:\n    env(SYMFONY_IDE): \"javascript: (function () { let file = '%%f'; file = file.replace('/var/www/your-project/', ''); let newUrl = 'http://localhost:63342/api/file?file='+file+'\u0026line=%%l'; fetch(newUrl); })()\"\n\nframework:\n    ide: '%env(SYMFONY_IDE)%'\n```\n\nReplace `/var/www/your-project/` with the current path of your project. It works using relative paths, so it will work in Docker. For more information, please visit https://www.develar.org/idea-rest-api/.\"\n\nEnjoy!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmgdsoft%2Fsymfony-profiler-spa","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmgdsoft%2Fsymfony-profiler-spa","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmgdsoft%2Fsymfony-profiler-spa/lists"}