{"id":15569384,"url":"https://github.com/dwolfhub/silex-starter","last_synced_at":"2025-05-12T19:11:21.640Z","repository":{"id":28232535,"uuid":"31737245","full_name":"dwolfhub/silex-starter","owner":"dwolfhub","description":"Silex starter project.","archived":false,"fork":false,"pushed_at":"2016-03-30T15:27:52.000Z","size":316,"stargazers_count":5,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-01T01:51:59.265Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"CSS","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/dwolfhub.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-03-05T21:22:46.000Z","updated_at":"2017-10-24T21:30:34.000Z","dependencies_parsed_at":"2022-09-04T17:00:56.355Z","dependency_job_id":null,"html_url":"https://github.com/dwolfhub/silex-starter","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dwolfhub%2Fsilex-starter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dwolfhub%2Fsilex-starter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dwolfhub%2Fsilex-starter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dwolfhub%2Fsilex-starter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dwolfhub","download_url":"https://codeload.github.com/dwolfhub/silex-starter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253805860,"owners_count":21967053,"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","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":[],"created_at":"2024-10-02T17:27:34.675Z","updated_at":"2025-05-12T19:11:21.618Z","avatar_url":"https://github.com/dwolfhub.png","language":"CSS","funding_links":[],"categories":[],"sub_categories":[],"readme":"# silex-starter\nSilex starter project.\n\n## Composer\n\nrun `./composer.phar install` in the app root folder to install dependencies\n\n## Configuration\n\nConfig files are located in `app/config`. Copy the `local-sample.yml` file and name it `local.yml` to override all other configuration files. If that does not exist, it will see if the environment variable `APPLICATION_ENV` is set and load a `\u003cAPPLICATION_ENV\u003e.yml` file. If that doesn't exist, the `default.yml` will be loaded as a baseline.\n\n## Frontend\n\n### npm\n[npm](https://www.npmjs.com/) is the package manager used for installing build tools as well as third-party dependencies. Configuration is located in `package.json`.\n\nRun `npm install` to download required tools and modules.\n\n### JavaScript\n\nJavaScript files are located in `frontend/js`. The main entry point for the app is `app.js`. The JavaScript is organized in AMD format.\n\n### Webpack\n[Webpack](https://webpack.github.io/) is a module loader and asset bundler. In this project it's used to bundle and uglify JavaScript. The configuration for Webpack is `webpack.config.js`. Third-party modules, such as [FastClick](https://github.com/ftlabs/fastclick) or [jQuery](https://github.com/jquery/jquery) can be added as `dependencies` in `package.json`, and added as a module via the `alias` configuration in `webpack.config.js`.\n\n[Webpack Documentation](http://webpack.github.io/docs/)\n\n### SASS\n\n[SASS](http://sass-lang.com/) is used for extending CSS with new features and compiles into CSS. The SASS files are located at `frontend/scss`, and the main SASS file is `style.scss`.\n\n### Task Runner\n\n`Gulp` is the task runner used to automate compilation tasks. `gulpfile.js` is the configuration file.\n\nRun `gulp` to perform the default task.\n\nUse `gulp watch` to watch for file changes and livereload the page in real time.\n\n```Text\nGulp tasks\nwatch      watches files in `frontend` and runs `sass or `build-js` tasks\nclean      removes old versions of JS and CSS files from `public_html\\assets`\nuglify-js  uglifies and disables debug mode for webpack\nbuild-js   compiles JavaScript AMD modules into app.js\nsass       compiles SASS files\ndefault    runs `clean`, `build-js`, and `sass` tasks\ndev        alias of `dev` task\ntest       alias of `prod` task\nstaging    alias of `prod` task\nuat        alias of `prod` task\nmaster     alias of `prod` task\nprod       runs `clean`, `uglify-js`m `build-js`, and `sass` tasks\n\n\n```\n\n\n\n\n## Database\n\n### Migrations\n\nMigrations are stored in the `src/Resource/Migration` folder. Run `./app/console` in the app root folder to view migration commands:\n\n```Text\nmigrations\n  migrations:diff      Generate a migration by comparing your current database to your mapping information.\n  migrations:execute   Execute a single migration version up or down manually.\n  migrations:generate  Generate a blank migration class.\n  migrations:migrate   Execute a migration to a specified version or the latest available version.\n  migrations:status    View the status of a set of migrations.\n  migrations:version   Manually add and delete migration versions from the version table.\n```\n\n### Query Repositories\n\nThe abstract query repository can be found in `src/QueryRepository/`. Extend it to create your own repositories. Then use them like so:\n\n```php\n$myRepo = new SilexStarter\\QueryRepository\\MyQueryRepo($app['db']);\n$results = $myRepo-\u003emyMethod();\n```\n\n## Routes and Controllers\n\nAdd your route definitions to `app/app.php`.\nThere is a home route there for your reference:\n\n```php\n$app-\u003eget('/', 'SilexStarter\\Controller\\HomeController::index')\n    -\u003ebind('home');\n```\n\nThis route will direct the uri `/` to the index method of the 'SilexStarter\\Controller\\HomeController' class. The bind command will allow you to reference this route in your templates like this: `{{ path('home') }}`.\n\nCheck out the [official docs](http://silex.sensiolabs.org/doc/usage.html#routing) for more info.\n\n### Caching\n\nIf you want to cache a response, simply add the `Cache-Control` header to something like `s-maxage=3600, public`. The standard setup will use the cache folder to store response and serve responses from there without having to bootstrap the app.\n\n## Views\n\n### Twig\n\n[Twig](http://twig.sensiolabs.org/) templates should be placed in `frontend/twig`. Render a template using `$app['twig']-\u003erender('filename.html.twig', ['mykey' =\u003e 'myvalue']);`.\n\n```Text\nGlobal Variables\ndebug         Boolean containing the application debug state\njs_filename   dynamically revisioned name of the compiled JavaScript modules\ncss_filename  dynamically revisioned name of the compiled SASS files\n\n```\n\n## Unit Tests\n\nPut your phpunit tests in the `tests/` folder. Extend the `\\SilexStarter\\Test\\AbstractTestCase` class in order to have access to things like the web crawler. Here's an example:\n\n```php\nuse \\SilexStarter\\Test\\AbstractTestCase;\n\nclass SomeTest extends AbstractTestCase\n{\n    public function testSomething()\n    {\n        $client = $this-\u003ecreateClient();\n        $crawler = $client-\u003erequest('GET', '/');\n    \n        $this-\u003eassertTrue($client-\u003egetResponse()-\u003eisOk());\n        $this-\u003eassertCount(1, $crawler-\u003efilter('h1:contains(\"Hello World\")'));\n    }\n}\n```\n\nCheck out the [official documentation](http://silex.sensiolabs.org/doc/testing.html) for more info.\n\n## Logging\n\nThe logging service is available by using $app['monolog']. The log files reside in `app/logs/`. Here are some examples:\n\n```php\n$app['monolog']-\u003einfo('script started');\n$app['monolog']-\u003eerror('Failed to call function', ['key', $value]);\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdwolfhub%2Fsilex-starter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdwolfhub%2Fsilex-starter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdwolfhub%2Fsilex-starter/lists"}