{"id":28464946,"url":"https://github.com/wildcodeschool/simple-mvc-old-caprover","last_synced_at":"2025-06-30T19:32:09.236Z","repository":{"id":31139222,"uuid":"124209503","full_name":"WildCodeSchool/simple-mvc-old-caprover","owner":"WildCodeSchool","description":null,"archived":false,"fork":false,"pushed_at":"2022-11-17T08:47:40.000Z","size":848,"stargazers_count":44,"open_issues_count":0,"forks_count":60,"subscribers_count":9,"default_branch":"main","last_synced_at":"2025-06-07T05:11:25.788Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"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/WildCodeSchool.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}},"created_at":"2018-03-07T09:08:45.000Z","updated_at":"2024-07-27T14:04:49.000Z","dependencies_parsed_at":"2022-08-09T01:30:15.418Z","dependency_job_id":null,"html_url":"https://github.com/WildCodeSchool/simple-mvc-old-caprover","commit_stats":null,"previous_names":[],"tags_count":1,"template":true,"template_full_name":null,"purl":"pkg:github/WildCodeSchool/simple-mvc-old-caprover","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WildCodeSchool%2Fsimple-mvc-old-caprover","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WildCodeSchool%2Fsimple-mvc-old-caprover/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WildCodeSchool%2Fsimple-mvc-old-caprover/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WildCodeSchool%2Fsimple-mvc-old-caprover/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/WildCodeSchool","download_url":"https://codeload.github.com/WildCodeSchool/simple-mvc-old-caprover/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WildCodeSchool%2Fsimple-mvc-old-caprover/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262838233,"owners_count":23372490,"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":"2025-06-07T05:10:41.975Z","updated_at":"2025-06-30T19:32:09.226Z","avatar_url":"https://github.com/WildCodeSchool.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Simple MVC\n\n## Description\n\nThis repository is a simple PHP MVC structure from scratch.\n\nIt uses some cool vendors/libraries such as Twig and Grumphp.\nFor this one, just a simple example where users can choose one of their databases and see tables in it.\n\n## Steps\n\n1. Clone the repo from Github.\n2. Run `composer install`.\n3. Create _config/db.php_ from _config/db.php.dist_ file and add your DB parameters. Don't delete the _.dist_ file, it must be kept.\n\n```php\ndefine('APP_DB_HOST', 'your_db_host');\ndefine('APP_DB_NAME', 'your_db_name');\ndefine('APP_DB_USER', 'your_db_user_wich_is_not_root');\ndefine('APP_DB_PASSWORD', 'your_db_password');\n```\n\n4. Import _database.sql_ in your SQL server, you can do it manually or use the _migration.php_ script which will import a _database.sql_ file.\n5. Run the internal PHP webserver with `php -S localhost:8000 -t public/`. The option `-t` with `public` as parameter means your localhost will target the `/public` folder.\n6. Go to `localhost:8000` with your favorite browser.\n7. From this starter kit, create your own web application.\n\n### Windows Users\n\nIf you develop on Windows, you should edit you git configuration to change your end of line rules with this command :\n\n`git config --global core.autocrlf true`\n\n## Example\n\nAn example (a basic list of items) is provided (you can load the _simple-mvc.sql_ file in a test database). The accessible URLs are :\n\n-   Home page at [localhost:8000/](localhost:8000/)\n-   Items list at [localhost:8000/items](localhost:8000/items)\n-   Item details [localhost:8000/items/show?id=:id](localhost:8000/item/show?id=2)\n-   Item edit [localhost:8000/items/edit?id=:id](localhost:8000/items/edit?id=2)\n-   Item add [localhost:8000/items/add](localhost:8000/items/add)\n-   Item deletion [localhost:8000/items/delete?id=:id](localhost:8000/items/delete?id=2)\n\nYou can find all these routes declared in the file `src/routes.php`. This is the very same file where you'll add your own new routes to the application.\n\n## How does URL routing work ?\n\n![simple_MVC.png](.tours/simple_MVC.png)\n\n## Ask for a tour !\n\n\u003cimg src=\"./.tours/photo-1632178151697-fd971baa906f.jpg\" alt=\"Guided tour\" width=\"150\"/\u003e\n\nWe prepare a little guided tour to start with the simple-MVC.\n\nTo take it, you need to install the `Code Tour` extension for Visual Studio Code : [Code Tour](https://marketplace.visualstudio.com/items?itemName=vsls-contrib.codetour)\n\nIt will give access to a new menu on your IDE where you'll find the different tours about the simple-MVC. Click on play to start one :\n\n![menu](.tours/code_tour_menu.png)\n\n## Run it on docker\n\nIf you don't know what is docker, skip this chapter. ;)\n\nOtherwise, you probably see, this project is ready to use with docker.\n\nTo build the image, go into the project directory and in your CLI type:\n\n```\ndocker build -t simple-mvc-container .\n```\n\nthen, run it to open it on your localhot :\n\n```\ndocker run -i -t --name simple-mvc  -p 80:80 simple-mvc-container\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwildcodeschool%2Fsimple-mvc-old-caprover","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwildcodeschool%2Fsimple-mvc-old-caprover","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwildcodeschool%2Fsimple-mvc-old-caprover/lists"}