Skip to content

Commit c961664

Browse files
committed
first commit
0 parents  commit c961664

25 files changed

+1840
-0
lines changed

.env

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
2+
host = localhost
3+
port = 3306
4+
database = test
5+
username = root
6+
password = 1234
7+
8+
mail_host = mail.example.com
9+
mail_port = 465
10+
mail_username = info@example.com
11+
mail_password = password
12+
mail_is_smtp = true
13+
mail_smtp_tls = true
14+
mail_smtp_debug = false

.env.example

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
2+
host = localhost
3+
port = 3306
4+
database = test
5+
username = root
6+
password = 1234
7+
8+
mail_host = mail.example.com
9+
mail_port = 465
10+
mail_username = info@example.com
11+
mail_password = password
12+
mail_is_smtp = true
13+
mail_smtp_tls = true
14+
mail_smtp_debug = false

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/node_modules
2+
/vendor
3+
/storage/App
4+
/storage/Framework
5+
/storage/Logs

.htaccess

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<IfModule mod_rewrite.c>
2+
RewriteEngine on
3+
RewriteRule ^(.well-known) - [L]
4+
RewriteRule ^$ public/ [L]
5+
RewriteRule (.*) public/$1 [L]
6+
</IfModule>

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2023 Webrium
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
![](https://repository-images.githubusercontent.com/267562756/4fc935ef-900e-48c5-b08d-9cfd151a9782)
2+
3+
<div align="center">
4+
5+
[![Latest Stable Version](https://poser.pugx.org/webrium/webrium/v)](//packagist.org/packages/webrium/webrium) [![Total Downloads](https://poser.pugx.org/webrium/webrium/downloads)](//packagist.org/packages/webrium/webrium) [![License](https://poser.pugx.org/webrium/webrium/license)](//packagist.org/packages/webrium/webrium)
6+
7+
</div>
8+
9+
## About Webrium
10+
11+
Webrium is a web application framework that prioritizes quick development, simplicity, and lightness. It offers features like Routes for handling URL mappings,FoxDB for database operations, MVC architecture for organizing the code, and Blade for creating dynamic views
12+
13+
14+
✔ Fast and Lightweight <br>
15+
✔ MVC structure <br>
16+
✔ Tailwindcss is configured by default <br>
17+
18+
<br>
19+
20+
## Install
21+
```
22+
$ composer create-project webrium/webrium
23+
```
24+
25+
```
26+
$ cd webrium & npm install
27+
```
28+
29+
### Run Server
30+
```
31+
$ npm run dev
32+
```
33+
34+
Then run the following address in your browser
35+
36+
`http://localhost:8000`
37+
38+
<br>
39+
40+
### Core Documentation
41+
* [Blade Templates](https://github.com/webrium/webrium/wiki/Blade-Templates)
42+
* [View](https://github.com/webrium/webrium/wiki/View)
43+
* [Upload](https://github.com/webrium/webrium/wiki/Upload)
44+
* [Controllers](https://github.com/webrium/webrium/wiki/controllers)
45+
* [Route Documentation](https://github.com/webrium/core/wiki/Route-Class-Documentation)
46+
* [Session Documentation](https://github.com/webrium/core/wiki/Session-Class-Documentation)
47+
* [JWT (JSON Web Token) Documentation](https://github.com/webrium/core/wiki/JWT-Documentation)
48+
* [Hash And Password Documentation](https://github.com/webrium/core/wiki/Hash-Class-Documentation)
49+
* [HTTP Class Documentation](https://github.com/webrium/core/wiki/HTTP-Class-Documentation)
50+
* [Email Documentation](https://github.com/webrium/core/wiki/Email-Documentation)
51+
* [Console Documentation](https://github.com/webrium/console)
52+
* [Form Validation Documentation](https://github.com/webrium/core/wiki/FormValidation-Class-Documentation)
53+
54+
### Database Documentation
55+
- [Database and Query builder](https://github.com/webrium/foxdb)
56+
- [Select](https://github.com/webrium/foxdb#retrieving-all-rows-from-a-table)
57+
- [Insert](https://github.com/webrium/foxdb#insert-statements)
58+
- [Update](https://github.com/webrium/foxdb#update-statements)
59+
- [Schema](https://github.com/webrium/foxdb/wiki/Schema)
60+
- [Eloquent](https://github.com/webrium/foxdb/wiki/eloquent)
61+
62+
63+
64+
<br>
65+
66+
## Using docker image
67+
- [Show Docker image Docs](https://github.com/webrium/docker-image)

app/Config/Config.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?php
2+
use Webrium\Session;
3+
use Webrium\Directory;
4+
5+
// sessions save directory
6+
Session::set_path(Directory::path('sessions'));

app/Config/DB.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?php
2+
3+
use Foxdb\DB;
4+
use Foxdb\Config;
5+
use Webrium\App;
6+
7+
8+
DB::addConnection('main', [
9+
'host'=> env('host', 'localhost'),
10+
'port'=> env('port', 3306),
11+
12+
'database'=> env('database', 'test'),
13+
'username'=> env('username', 'root'),
14+
'password'=> env('password', '1234'),
15+
16+
'charset'=>Config::UTF8MB4,
17+
'collation'=>Config::UTF8MB4_UNICODE_CI,
18+
'fetch'=>Config::FETCH_CLASS
19+
]);

app/Config/Mail.php

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?php
2+
use PHPMailer\PHPMailer\PHPMailer;
3+
use PHPMailer\PHPMailer\SMTP;
4+
5+
use Webrium\Mail;
6+
7+
8+
$mail = new PHPMailer(true);
9+
10+
if(env('mail_is_smtp') == 'true'){
11+
$mail->isSMTP(); // Send using SMTP
12+
$mail->SMTPAuth = true; // Enable SMTP authentication
13+
}
14+
15+
if(env('mail_smtp_debug') == 'true'){
16+
$mail->SMTPDebug = SMTP::DEBUG_SERVER; // Enable verbose debug output
17+
}
18+
19+
if(env('mail_smtp_tls') == 'true'){
20+
$mail->SMTPSecure = PHPMailer::ENCRYPTION_SMTPS; // Enable TLS encryption; `PHPMailer::ENCRYPTION_SMTPS` encouraged
21+
}
22+
23+
$mail->Host = env('mail_host');
24+
$mail->Username = env('mail_username');
25+
$mail->Password = env('mail_password');
26+
$mail->Port = env('mail_port'); // TCP port to connect to, use 465 for `PHPMailer::ENCRYPTION_SMTPS` above
27+
$mail->CharSet = 'UTF-8';
28+
29+
Mail::addConfig('main', $mail );

app/Controllers/IndexController.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?php
2+
namespace App\Controllers;
3+
4+
class IndexController
5+
{
6+
7+
public function index()
8+
{
9+
return view('Welcome' , [ 'name' => 'Webrium Framework' ] );
10+
}
11+
12+
}

app/Models/User.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
namespace App\Models;
3+
4+
use Foxdb\Model;
5+
6+
class User extends Model{
7+
8+
/**
9+
* The table associated with the model.
10+
*
11+
* @var string
12+
*/
13+
protected $table = 'users';
14+
15+
16+
}

app/Routes/Web.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?php
2+
use Webrium\Route;
3+
4+
Route::get('','IndexController->index');
5+

app/Views/Welcome.php

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<!doctype html>
2+
<html class="h-full min-h-full">
3+
<head >
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<link href="/css/style.css" rel="stylesheet">
7+
</head>
8+
<body class="flex bg-gray-800 justify-center">
9+
10+
<div class="pt-10 mt-10 p-10 shadow-md shadow-green-400/50 rounded-xl bg-gray-700">
11+
12+
<div class="t">
13+
<div class="w-28 h-28 flex items-center justify-center mx-auto text-center text-gray-700 rounded-full bg-green-500">
14+
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-20 h-20">
15+
<path stroke-linecap="round" stroke-linejoin="round" d="M4.5 12.75l6 6 9-13.5" />
16+
</svg>
17+
</div>
18+
</div>
19+
20+
<div class="w-full flex justify-center mt-4">
21+
<h1 class="text-3xl font-bold text-white"> {{ $name }} </h1>
22+
</div>
23+
24+
<div class="mt-10 mx-auto flex justify-center">
25+
<a target="_blank" href="https://github.com/webrium/webrium" class="hover:bg-gray-800 duration-200 hover:shadow hover:shadow hover:shadow-white/50 text-white px-8 py-2 border-2 border-green-300/50 rounded-xl">Get Start</a>
26+
</div>
27+
28+
</div>
29+
30+
31+
</body>
32+
33+
</html>

composer.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"name": "webrium/webrium",
3+
"description": "PHP Framework",
4+
"type": "project",
5+
"require": {
6+
"php": ">=8.0.0",
7+
"botfire/botfire": "*@stable",
8+
"webrium/core": "^2.0.1",
9+
"phpmailer/phpmailer": "~6.1",
10+
"webrium/foxdb": "^3.0.0",
11+
"webrium/console": "^1.0.1"
12+
},
13+
"license": "MIT",
14+
"authors": [
15+
{
16+
"name": "benjamin-khalife",
17+
"email": "nvioir@gmail.com"
18+
}
19+
],
20+
"minimum-stability": "dev",
21+
"scripts": {
22+
"serve":"php -S 127.0.0.1:8080 -t public",
23+
"post-root-package-install": [
24+
"php -r \"file_exists('.env') || copy('.env.example', '.env');\""
25+
]
26+
}
27+
}

0 commit comments

Comments
 (0)