https://github.com/softon/slano
A simple PHP MVC Framework using external libraries.
https://github.com/softon/slano
Last synced: 3 months ago
JSON representation
A simple PHP MVC Framework using external libraries.
- Host: GitHub
- URL: https://github.com/softon/slano
- Owner: softon
- Created: 2021-03-08T19:10:57.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-03-09T09:07:55.000Z (over 5 years ago)
- Last Synced: 2025-01-24T09:11:13.416Z (over 1 year ago)
- Language: Twig
- Size: 251 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.MD
Awesome Lists containing this project
README
# Slano Framework

A simple PHP Framework for quick app development.
## Installation
1. Install Composer and PHP 5.4+
2. use `composer create-project softon/slano --prefer-dist` to create a new slano project.
3. copy the `.env.sample` to `.env` and update the environment variables.
4. (optional) run the below query which will create a basic authetication related tables.
5. setup a virtual host and access the website.
6. Done.
## Libraries used in Slano Framework
Below libraries are used for building this framework. Link to the documentation to respective packages are provided.
1. **Twig** (Template Engine): [https://twig.symfony.com](https://twig.symfony.com/)
2. **Bramus/router** (Routing Library) : [https://github.com/bramus/router](https://github.com/bramus/router)
3. **Rakit/validation** (Validation Library) : [https://github.com/rakit/validation](https://github.com/rakit/validation)
4. **Vlucas/phpdotenv** (Reading Environment Variables) : [https://github.com/vlucas/phpdotenv](https://github.com/vlucas/phpdotenv)
5. **Lodev09/php-models** (Database Models) : [https://github.com/lodev09/php-models](https://github.com/lodev09/php-models)
6. **Delight-im/auth** (Authentication Library) : [https://github.com/delight-im/PHP-Auth](https://github.com/delight-im/PHP-Auth)
# SQL Database Query for Users (Optional)
```sql
CREATE TABLE `users` (
`id` int(10) UNSIGNED NOT NULL,
`email` varchar(249) COLLATE utf8mb4_unicode_ci NOT NULL,
`password` varchar(255) CHARACTER SET latin1 COLLATE latin1_general_cs NOT NULL,
`username` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`status` tinyint(2) UNSIGNED NOT NULL DEFAULT '0',
`verified` tinyint(1) UNSIGNED NOT NULL DEFAULT '0',
`resettable` tinyint(1) UNSIGNED NOT NULL DEFAULT '1',
`roles_mask` int(10) UNSIGNED NOT NULL DEFAULT '0',
`registered` int(10) UNSIGNED NOT NULL,
`last_login` int(10) UNSIGNED DEFAULT NULL,
`force_logout` mediumint(7) UNSIGNED NOT NULL DEFAULT '0'
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE `users_confirmations` (
`id` int(10) UNSIGNED NOT NULL,
`user_id` int(10) UNSIGNED NOT NULL,
`email` varchar(249) COLLATE utf8mb4_unicode_ci NOT NULL,
`selector` varchar(16) CHARACTER SET latin1 COLLATE latin1_general_cs NOT NULL,
`token` varchar(255) CHARACTER SET latin1 COLLATE latin1_general_cs NOT NULL,
`expires` int(10) UNSIGNED NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE `users_remembered` (
`id` bigint(20) UNSIGNED NOT NULL,
`user` int(10) UNSIGNED NOT NULL,
`selector` varchar(24) CHARACTER SET latin1 COLLATE latin1_general_cs NOT NULL,
`token` varchar(255) CHARACTER SET latin1 COLLATE latin1_general_cs NOT NULL,
`expires` int(10) UNSIGNED NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE `users_resets` (
`id` bigint(20) UNSIGNED NOT NULL,
`user` int(10) UNSIGNED NOT NULL,
`selector` varchar(20) CHARACTER SET latin1 COLLATE latin1_general_cs NOT NULL,
`token` varchar(255) CHARACTER SET latin1 COLLATE latin1_general_cs NOT NULL,
`expires` int(10) UNSIGNED NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE `users_throttling` (
`bucket` varchar(44) CHARACTER SET latin1 COLLATE latin1_general_cs NOT NULL,
`tokens` float UNSIGNED NOT NULL,
`replenished_at` int(10) UNSIGNED NOT NULL,
`expires_at` int(10) UNSIGNED NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Indexes for table `users`
--
ALTER TABLE `users`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `email` (`email`);
--
-- Indexes for table `users_confirmations`
--
ALTER TABLE `users_confirmations`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `selector` (`selector`),
ADD KEY `email_expires` (`email`,`expires`),
ADD KEY `user_id` (`user_id`);
--
-- Indexes for table `users_remembered`
--
ALTER TABLE `users_remembered`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `selector` (`selector`),
ADD KEY `user` (`user`);
--
-- Indexes for table `users_resets`
--
ALTER TABLE `users_resets`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `selector` (`selector`),
ADD KEY `user_expires` (`user`,`expires`);
--
-- Indexes for table `users_throttling`
--
ALTER TABLE `users_throttling`
ADD PRIMARY KEY (`bucket`),
ADD KEY `expires_at` (`expires_at`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `users`
--
ALTER TABLE `users`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `users_confirmations`
--
ALTER TABLE `users_confirmations`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `users_remembered`
--
ALTER TABLE `users_remembered`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `users_resets`
--
ALTER TABLE `users_resets`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;
```