- Joined
- Jan 28, 2013
- Messages
- 157
- Reaction score
- 104
HabboAPI : Housekeeping - OOP | PDO | RESTFUL | MOBILE
Although I have gone under a few different names, the last project I released on here was many many years ago called Habblux Housekeeping. It had tons of unique features no other system provided and people really seemed to like it. Although I have worked on many things since that release, I haven't done anything that I was releasing to the public. I'm back with a backend system called HabboAPI which I really think will be a fantastic release.
[UPDATE] I have added the option to view a demo, checkout the details below!
MOBILE FRIENDLY
I'm putting a lot of focus into what I haven't really seen yet, mobile optimization. For the frontend I'm using Material Design by Google along with jQuery. So far I have all pages rendering perfectly depending on the screen size or the mobile device your using. Materials toast system makes alerting perfect on a mobile sized screen. The left navigation bar pulls out just by swiping or with a press of the menu button.
RESTFUL / ROUTING
I decided to build this system using the REST protocols. It supports GET, POST, PUT, DELETE, OPTIONS, PATCH, & HEAD. I got the router code from "bramus/router" on GitHub, which I did recode a bit to have it be built into the API. The router is placed into the index page, all REST calls are routed through it. If we want to move forward in this community I think we need to take advantage of all different kinds of technologies available. If we wanted to build an iOS or Android app for example, a REST API would be useful to remotely grab that data.
PAGES / TEMPLATING
I have built a simple system to set each page which allows you to define custom functions and routes. Here is an example of the login page:
COMPLETED FEATURES
TODO
DEMO
SCREENSHOTS
HabboAPI
housekeeping
OOP | PDO | RESTFUL | MOBILE
Hey there!housekeeping
OOP | PDO | RESTFUL | MOBILE
Although I have gone under a few different names, the last project I released on here was many many years ago called Habblux Housekeeping. It had tons of unique features no other system provided and people really seemed to like it. Although I have worked on many things since that release, I haven't done anything that I was releasing to the public. I'm back with a backend system called HabboAPI which I really think will be a fantastic release.
[UPDATE] I have added the option to view a demo, checkout the details below!
MOBILE FRIENDLY
I'm putting a lot of focus into what I haven't really seen yet, mobile optimization. For the frontend I'm using Material Design by Google along with jQuery. So far I have all pages rendering perfectly depending on the screen size or the mobile device your using. Materials toast system makes alerting perfect on a mobile sized screen. The left navigation bar pulls out just by swiping or with a press of the menu button.
RESTFUL / ROUTING
I decided to build this system using the REST protocols. It supports GET, POST, PUT, DELETE, OPTIONS, PATCH, & HEAD. I got the router code from "bramus/router" on GitHub, which I did recode a bit to have it be built into the API. The router is placed into the index page, all REST calls are routed through it. If we want to move forward in this community I think we need to take advantage of all different kinds of technologies available. If we wanted to build an iOS or Android app for example, a REST API would be useful to remotely grab that data.
PAGES / TEMPLATING
I have built a simple system to set each page which allows you to define custom functions and routes. Here is an example of the login page:
PHP:
class Login_page extends Page
{
public $page_initialized = false,
$page_name = "login",
$page_vars = [],
$page_disabled = false;
public function __construct()
{
if($this->page_initialized == false)
{
parent::__construct($this->page_name);
if($this->page_exists() == true)
{
$this->register_routes();
$this->page_initialized = true;
}
return true;
}
return false;
}
public function register_routes()
{
Router::mount("/content/page/" . $this->page_name, function()
{
Router::match("POST", "/view", function()
{
die($this->display_page());
});
Router::match("POST", "/authenticate", function()
{
die($this->login());
});
});
}
public function login()
{
$user_name = (isset($_POST["user_name"]) && HabboAPI::is_null($_POST["user_name"]) == false) ? $_POST["user_name"] : null;
$user_pass = (isset($_POST["user_pass"]) && HabboAPI::is_null($_POST["user_pass"]) == false) ? $_POST["user_pass"] : null;
$user_pin = (isset($_POST["user_pin"]) && HabboAPI::is_null($_POST["user_pin"]) == false) ? $_POST["user_pin"] : null;
if($user_name != null)
{
if($user_pass != null)
{
if($user_pin != null)
{
return (Authenticator::login($user_name, $user_pass, $user_pin) == true) ? "valid_login" : "invalid_login";
}
else
{
return "empty_pin";
}
}
else
{
return "empty_password";
}
}
else
{
return "empty_username";
}
return "invalid_login";
}
}
COMPLETED FEATURES
- REST / Routing system
- Page / Template system
- Login system
- Permission system
- Various other things that I can't think of right now lol
TODO
- Alot
DEMO
- Link: demo currently down
- Username: demo
- Password: demo
- Pin: 1234
- You may see errors at anytime as I am constantly updating it...
- ALSO, a user can only be logged in from one device at a time, so if someone else uses the login you may be kicked off!
- Link:
You must be registered to see links
SCREENSHOTS
- Login:
You must be registered to see links
- Login (Mobile):
You must be registered to see links
- Main / Dashboard: http://d.pr/i/1lRQN
- Main / Dashboard (Mobile): http://d.pr/i/18mdQ
Last edited: