main home and css style, default main routes, controllers and api

* main api entry template
* main controllers for routers
* use bulma css for eye candy style
* proposed minimal menu html structure into index
* add those routes to modules ini
* dont ignore css files we will not use nodejs
This commit is contained in:
mckaygerhard 2024-04-09 17:53:01 -04:00
parent 33847e2759
commit 76a08633c1
10 changed files with 9948 additions and 8 deletions

1
.gitignore vendored
View File

@ -33,7 +33,6 @@ storage/
/guachi.ini
/cache/*
/public/js/guachi.js
*.css
/node_modules/*
/.sass-cache/*
/package-lock.json

View File

@ -0,0 +1,16 @@
<?php
/**!
* @package skindb-webdb
* @filename lists.php controller
* @route >api>v1>lists
* @version 1.0
*/
class api_v1_lists_controller extends controller {
public function execute($post = null) {
$this->model->show();
return;
}
}

16
controllers/lists.php Normal file
View File

@ -0,0 +1,16 @@
<?php
/**!
* @package skindb-webdb
* @filename lists.php controller
* @route >lists
* @version 1.0
*/
class lists_controller extends controller {
public function execute($post = null) {
$this->model->show();
return;
}
}

View File

@ -33,6 +33,18 @@ fully local and cannot depends of external things.
Our eyecandy framework is based on Bulma https://github.com/jgthms/bulma?tab=readme-ov-file
### routing structure and controllers
* INDEX for routing: `modules.ini`
* API calls `controllers/api/v1/<module>.php`
* `models/api/v1/lists.php`
* LIST view `controllers/lists.php`
* `models/lists.php`
* ASSETS files `public/assets/css/`
* `bulma.css`
* VIEWS to include `public/views`
* `index.php`
### Full API documentation
Please referes to [API.md](API.md) for all the skin api documentation, before

24
models/api/v1/lists.php Normal file
View File

@ -0,0 +1,24 @@
<?php
/**!
* @package Skindb-webdb
* @filename lists.php model
* @route >api>v1>lists
* @version 1.0
*/
class api_v1_lists_model extends model {
public function notFound() {
$this->borrow('notFound')->show();
}
public function show() {
header('Content-Type: application/json; charset=utf-8');
print( json_encode([
'ok' => 1,
'data' => 'data',
'pagination' => 'asdfa'
]));
}
}

19
models/lists.php Normal file
View File

@ -0,0 +1,19 @@
<?php
/**!
* @package Skindb-webdb
* @filename lists.php model
* @route >lists
* @version 1.0
*/
class lists_model extends model {
public function notFound() {
$this->borrow('notFound')->show();
}
public function show() {
include(DIR_VIEWS."index.php");
}
}

View File

@ -1,3 +1,5 @@
[public]
page[] = "index"
page[] = "lists"
page[] = "api/v1/lists"

9783
public/assets/css/bulma.css vendored Normal file

File diff suppressed because it is too large Load Diff

4
public/assets/css/bulma.min.css vendored Normal file

File diff suppressed because one or more lines are too long

View File

@ -1,14 +1,79 @@
<?php
$htmlrender = '
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>SkinsDB</title>
<link rel="icon" href="icon.png" type="image/x-icon">
<link rel="stylesheet" href="assets/css/bulma.min.css">
</head>
<body>
SkinDB API database!
<nav class="navbar" role="navigation" aria-label="main navigation">
<div class="navbar-brand">
<a class="navbar-item" href="https://bulma.io">
</a>
<a role="button" class="navbar-burger" aria-label="menu" aria-expanded="false" data-target="navbarBasicExample">
<span aria-hidden="true"></span>
<span aria-hidden="true"></span>
</a>
</div>
<div id="navbarBasicExample" class="navbar-menu">
<div class="navbar-start">
<div class="navbar-item has-dropdown is-hoverable">
<a href="lists" class="navbar-link">
Start
</a>
<div class="navbar-dropdown">
<a href="about" class="navbar-item">
About
</a>
<a href="api/use" class="navbar-item is-selected">
API
</a>
<a href="help" class="navbar-item">
Help
</a>
<hr class="navbar-divider">
<a href="about" class="navbar-item">
Report an issue
</a>
</div>
</div>
</div>
<div class="navbar-end">
<div class="navbar-item">
<a class="field is-grouped">
<p class="control is-expanded">
<input class="input" type="text" placeholder="type here to Search skin">
</p>
<p class="control">
<button class="button is-info is-selected">
Search
</button>
</p>
</a>
<a href="about" class="button is-primary">
About
</a>
</div>
</div>
</div>
</div>
</nav>
<br>
<main class="contain">
<h1 class="title">Skins</h1>
<hr>
<?php
echo 'Currently API database is on manteniance, please report any incident but first try to check if there any previous report at <a href="https://codeberg.org/minenux/minenux-skindb-webdb/issues">https://codeberg.org/minenux/minenux-skindb-webdb/issues</a> with code 412';
?>
</main>
<br>
<footer class="footer">
<div class="content has-text-centered">
<p><strong>SkinsDdatabase</strong> by MinenuX</p>
</div>
</footer>
</body>
</html>';
echo $htmlrender;
</html>