https://github.com/sheitak/bookstory
Interactive History - The Book of which you are the Hero. Project carried out in PHP with MVC architecture model.
https://github.com/sheitak/bookstory
Last synced: about 2 months ago
JSON representation
Interactive History - The Book of which you are the Hero. Project carried out in PHP with MVC architecture model.
- Host: GitHub
- URL: https://github.com/sheitak/bookstory
- Owner: Sheitak
- License: gpl-3.0
- Created: 2019-11-22T15:56:40.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-07-04T09:56:54.000Z (almost 3 years ago)
- Last Synced: 2025-01-21T06:26:33.380Z (over 1 year ago)
- Language: PHP
- Homepage:
- Size: 407 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Simple MVC
## Description
This repository is a simple PHP MVC structure from scratch.
It uses some cool vendors/libraries such as Twig and Grumphp.
For this one, just a simple example where users can choose one of their databases and see tables in it.
## Steps
1. Clone the repo from Github.
2. Run `composer install`.
3. 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.
```php
define('APP_DB_HOST', 'your_db_host');
define('APP_DB_NAME', 'your_db_name');
define('APP_DB_USER', 'your_db_user_wich_is_not_root');
define('APP_DB_PWD', 'your_db_password');
```
4. Import `simple-mvc.sql` in your SQL server,
5. 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.
6. Go to `localhost:8000` with your favorite browser.
7. From this starter kit, create your own web application.
### Windows Users
If you develop on Windows, you should edit you git configuration to change your end of line rules with this command :
`git config --global core.autocrlf true`
## URLs availables
- Home page at [localhost:8000/](localhost:8000/)
- Items list at [localhost:8000/item/index](localhost:8000/item/index)
- Item details [localhost:8000/item/index/show/:id](localhost:8000/item/show/2)
- Item edit [localhost:8000/item/index/edit/:id](localhost:8000/item/edit/2)
- Item add [localhost:8000/item/index/add](localhost:8000/item/add)
- Item deletion [localhost:8000/item/index/delete/:id](localhost:8000/item/delete/2)
## How does URL routing work ?
