{"id":14965502,"url":"https://github.com/nette-examples/quickstart","last_synced_at":"2025-04-05T23:10:01.834Z","repository":{"id":55528561,"uuid":"9747370","full_name":"nette-examples/quickstart","owner":"nette-examples","description":"🎓 Tutorial Quick Start: official intro to Nette Framework by creating blog.","archived":false,"fork":false,"pushed_at":"2025-01-26T16:45:39.000Z","size":388,"stargazers_count":77,"open_issues_count":2,"forks_count":49,"subscribers_count":21,"default_branch":"v4.0","last_synced_at":"2025-03-29T22:08:03.395Z","etag":null,"topics":["nette","tutorial"],"latest_commit_sha":null,"homepage":"https://doc.nette.org/quickstart","language":"PHP","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nette-examples.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":"2013-04-29T12:14:06.000Z","updated_at":"2025-01-26T16:45:42.000Z","dependencies_parsed_at":"2024-02-18T02:23:15.264Z","dependency_job_id":"a4ebe638-7d5c-4359-8042-33259390e425","html_url":"https://github.com/nette-examples/quickstart","commit_stats":{"total_commits":7,"total_committers":2,"mean_commits":3.5,"dds":0.1428571428571429,"last_synced_commit":"3bb02ebd3566382bb2768dc75874a8cb6bdd1132"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nette-examples%2Fquickstart","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nette-examples%2Fquickstart/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nette-examples%2Fquickstart/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nette-examples%2Fquickstart/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nette-examples","download_url":"https://codeload.github.com/nette-examples/quickstart/tar.gz/refs/heads/v4.0","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247411235,"owners_count":20934653,"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":["nette","tutorial"],"created_at":"2024-09-24T13:34:50.389Z","updated_at":"2025-04-05T23:10:01.807Z","avatar_url":"https://github.com/nette-examples.png","language":"PHP","readme":"Create Your First Application!\n==============================\n\nGet to know [Nette Framework](https://nette.org) while creating a simple blog with comments. Let's begin!\n\nAfter the first two chapters, you will have your own working blog and you'll be ready to publish your awesome posts, although the features will be pretty much limited after completing these two chapters. To make things nicer for your users, you should also read the following chapters and keep improving your application.\n\nYou can find the [complete tutorial on Nette website](https://doc.nette.org/en/quickstart/getting-started).\n\nPlease install [full-featured IDE and all necessary plugins](https://doc.nette.org/en/best-practices/editors-and-tools), it will make you extremely efficient.\n\nThis QuickStart was written for Nette Framework 3.2 and PHP 8.1 or newer.\n\nYou can download the Nette Framework manually, but the recommended way of starting a new project is using [Composer](https://doc.nette.org/en/best-practices/composer). If you don't know the Composer, you should definitely start with that. It's a really simple and useful tool, check out [their documentation](https://getcomposer.org/doc/).\n\nWith Composer, you can download and install the application skeleton known as Web Project including Nette Framework very easily. To do so, find your webroot directory (e.g. `/var/www` or `C:\\InetPub`) in your command line and execute the following command:\n\n```shell\ncomposer create-project nette/web-project nette-blog\n```\n\nWeb Project will be downloaded into `nette-blog` directory.\n\nIf you couldn't use Composer, [download](https://github.com/nette/web-project/archive/preloaded.zip) and extract the archive and copy it to the root directory of the webserver and rename to `nette-blog`. The entire framework is located in the `vendor` folder.\n\nIf you're developing on macOS or Linux (or any other Unix based system), you need to [configure write privileges](https://doc.nette.org/en/troubleshooting#toc-setting-directory-permissions) to the webserver.\n\n\nThe Welcome Page\n----------------\n\nAt this moment, the welcome page of the Web Project should be running. Try it by opening your browser and going to the following URL:\n\n```\nhttp://localhost/nette-blog/www/\n```\n\nand you should see the Nette Framework welcome page:\n\n![](https://files.nette.org/git/doc/qs-welcome.webp)\n\nThe application works and you can now start making changes to it.\n\n\nWeb Project’s Content\n---------------------\n\nWeb Project has the following structure:\n\n```pre\n\u003cb\u003enette-blog/\u003c/b\u003e\n├── \u003cb\u003eapp/\u003c/b\u003e              ← application directory\n│   ├── \u003cb\u003eCore/\u003c/b\u003e         ← core classes, like router etc.\n│   ├── \u003cb\u003ePresentation/\u003c/b\u003e ← presenter classes \u0026 templates\n│   └── \u003cb\u003eBootstrap.php\u003c/b\u003e ← booting class Bootstrap\n├── \u003cb\u003ebin/\u003c/b\u003e              ← scripts for the command line\n├── \u003cb\u003econfig/\u003c/b\u003e           ← configuration files\n├── \u003cb\u003elog/\u003c/b\u003e              ← error logs\n├── \u003cb\u003etemp/\u003c/b\u003e             ← temporary files, cache, …\n├── \u003cb\u003evendor/\u003c/b\u003e           ← libraries installed by Composer\n│   └── \u003cb\u003eautoload.php\u003c/b\u003e  ← autoloading of libraries installed by Composer\n└── \u003cb\u003ewww/\u003c/b\u003e              ← public folder - the only place accessible from browser\n    └── \u003cb\u003eindex.php\u003c/b\u003e     ← initial file that launches the application\n```\n\nDirectory `www` is supposed to store images, JavaScript, CSS, and other publicly available files. This is the only directory directly accessible from the browser, so you can point the root directory of your web server here (you can configure it in Apache, but let’s do it later as it’s not important right now).\n\nThe most important directory for you is `app/`. You can find `Bootstrap.php` file there, inside which is a class that loads the framework and configures the application. It activates [autoloading](https://doc.nette.org/en/robot-loader) and sets up the [debugger](https://tracy.nette.org/) and [routes](https://doc.nette.org/en/application/routing).\n\n\nCleanup\n-------\n\nThe Web Project contains a welcome page, which we can remove - feel free to delete the `app/Presentation/Home/default.latte` file and replace it with the text \"Hello world!\".\n\n\n![](https://files.nette.org/git/doc/qs-hello.webp)\n\n\nTracy (Debugger)\n----------------\n\nAn extremely important tool for development is [a debugger called Tracy](https://tracy.nette.org/). Try to make some errors in your `app/Presentation/Home/HomePresenter.php` file (e.g. remove a curly bracket from the definition of class HomePresenter) and see what happens. A red-screen page will pop up with an understandable error description.\n\n![](https://files.nette.org/git/doc/qs-tracy.webp)\n\nTracy will significantly help you while hunting down errors. Also note the floating Tracy Bar in the bottom right corner, which informs you about important runtime data.\n\n![](https://files.nette.org/git/doc/qs-tracybar.webp)\n\nIn the production mode, Tracy is, of course, disabled and does not reveal any sensitive information. All errors are saved into `log/` directory instead. Just try it out. In `app/Bootstrap.php`, find the following piece of code, uncomment the line and change the method call parameter to `false`, so it looks like this:\n\n```php .{file:app/Bootstrap.php}\n...\n$configurator-\u003esetDebugMode(false);\n$configurator-\u003eenableTracy(__DIR__ . '/../log');\n...\n```\n\nAfter refreshing the web page, the red-screen page will be replaced with the user-friendly message:\n\n![](https://files.nette.org/git/doc/qs-fatal.webp)\n\nNow, look into the `log/` directory. You can find the error log there (in exception.log file) and also the page with the error message (saved in an HTML file with a name starting with `exception`).\n\nComment line `// $configurator-\u003esetDebugMode(false);` again. Tracy automatically enables development mode on `localhost` environment and disables it elsewhere.\n\nNow, we can fix the bug and continue designing our application.\n\n\nRead more\n---------\n\n[The tutorial continue on the Nette website](https://doc.nette.org/en/quickstart/home-page).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnette-examples%2Fquickstart","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnette-examples%2Fquickstart","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnette-examples%2Fquickstart/lists"}