Skip to content

Commit 68c4c13

Browse files
author
elightsys
committed
Initial commit: PHP MVC Framework with DataTables SSP
- Add MVC framework structure with controllers, models, and views - Implement DataTables server-side processing (SSP) - Add user authentication and role-based access control - Include Bootstrap 4 responsive UI - Add comprehensive documentation (README, CONTRIBUTING, LICENSE) - Configure HTTPS detection for proxy/load balancer environments - Add database schema and example configuration file
0 parents  commit 68c4c13

35 files changed

+3378
-0
lines changed

.gitignore

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# Sensitive configuration files
2+
app/config/config.php
3+
4+
# Old/backup directories
5+
**/_old/
6+
**/_old*/
7+
**/backup/
8+
**/backups/
9+
10+
# IDE and Editor files
11+
.vscode/
12+
.idea/
13+
*.sublime-project
14+
*.sublime-workspace
15+
.DS_Store
16+
Thumbs.db
17+
18+
# Logs and databases
19+
*.log
20+
# *.sql - Commented out to include mysql.sql schema file
21+
*.sqlite
22+
storage/logs/*
23+
!storage/logs/.gitkeep
24+
25+
# Cache and temporary files
26+
storage/cache/*
27+
!storage/cache/.gitkeep
28+
storage/framework/cache/*
29+
!storage/framework/cache/.gitkeep
30+
storage/framework/sessions/*
31+
!storage/framework/sessions/.gitkeep
32+
storage/framework/views/*
33+
!storage/framework/views/.gitkeep
34+
35+
# Composer dependencies
36+
vendor/
37+
composer.lock
38+
39+
# NPM dependencies
40+
node_modules/
41+
package-lock.json
42+
npm-debug.log
43+
yarn-error.log
44+
45+
# Build files
46+
public/build/
47+
public/hot
48+
public/storage
49+
50+
# Environment files
51+
.env
52+
.env.backup
53+
.env.production
54+
55+
# OS generated files
56+
.DS_Store
57+
.DS_Store?
58+
._*
59+
.Spotlight-V100
60+
.Trashes
61+
ehthumbs.db
62+
Desktop.ini
63+
64+
# PHP
65+
*.cache
66+
.phpunit.result.cache
67+
68+
# User uploaded files (optional - uncomment if needed)
69+
# public/uploads/*
70+
# !public/uploads/.gitkeep

.htaccess

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<IfModule mod_rewrite.c>
2+
3+
RewriteEngine On
4+
5+
# SSL
6+
#RewriteCond %{HTTPS} off
7+
#RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
8+
9+
# NO WWW
10+
#RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
11+
#RewriteRule ^ https://%1%{REQUEST_URI} [R=301,L]
12+
13+
# REDIRECTION PATH
14+
Options -Multiviews
15+
RewriteRule ^$ public/ [L]
16+
RewriteRule (.*) public/$1 [L]
17+
</IfModule>

CONTRIBUTING.md

Lines changed: 154 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,154 @@
1+
# Contributing to PHP MVC Framework
2+
3+
First off, thank you for considering contributing to this project! It's people like you that make this project such a great tool.
4+
5+
## Code of Conduct
6+
7+
This project and everyone participating in it is governed by respect and professionalism. By participating, you are expected to uphold this code.
8+
9+
## How Can I Contribute?
10+
11+
### Reporting Bugs
12+
13+
Before creating bug reports, please check the existing issues as you might find out that you don't need to create one. When you are creating a bug report, please include as many details as possible:
14+
15+
* **Use a clear and descriptive title** for the issue
16+
* **Describe the exact steps to reproduce the problem**
17+
* **Provide specific examples** to demonstrate the steps
18+
* **Describe the behavior you observed** and what behavior you expected to see
19+
* **Include screenshots** if relevant
20+
* **Include your environment details** (PHP version, database version, web server)
21+
22+
### Suggesting Enhancements
23+
24+
Enhancement suggestions are tracked as GitHub issues. When creating an enhancement suggestion, please include:
25+
26+
* **Use a clear and descriptive title**
27+
* **Provide a step-by-step description** of the suggested enhancement
28+
* **Provide specific examples** to demonstrate the steps
29+
* **Describe the current behavior** and **explain the behavior you would like to see**
30+
* **Explain why this enhancement would be useful**
31+
32+
### Pull Requests
33+
34+
* Fill in the required template
35+
* Follow the PHP coding standards (PSR-12)
36+
* Include thoughtful comments in your code
37+
* End all files with a newline
38+
* Write meaningful commit messages
39+
40+
## Development Process
41+
42+
1. **Fork the repository** and create your branch from `main`
43+
2. **Make your changes** following the coding standards
44+
3. **Test your changes** thoroughly
45+
4. **Update documentation** if needed
46+
5. **Commit your changes** with clear commit messages
47+
6. **Push to your fork** and submit a pull request
48+
49+
### Setting Up Your Development Environment
50+
51+
```bash
52+
# Clone your fork
53+
git clone https://github.com/YOUR-USERNAME/PHP-MVC-03.git
54+
cd PHP-MVC-03
55+
56+
# Create a new branch
57+
git checkout -b feature/your-feature-name
58+
59+
# Make your changes
60+
# ...
61+
62+
# Commit your changes
63+
git add .
64+
git commit -m "Add your meaningful commit message"
65+
66+
# Push to your fork
67+
git push origin feature/your-feature-name
68+
```
69+
70+
## Coding Standards
71+
72+
### PHP Code Style
73+
74+
* Follow [PSR-12](https://www.php-fig.org/psr/psr-12/) coding standards
75+
* Use meaningful variable and function names
76+
* Add comments for complex logic
77+
* Keep functions small and focused
78+
* Use type hints where possible (PHP 7.4+)
79+
80+
### Example:
81+
82+
```php
83+
<?php
84+
85+
/**
86+
* Get user by email address
87+
*
88+
* @param string $email User's email address
89+
* @return array|false User data or false if not found
90+
*/
91+
public function getUserByEmail(string $email)
92+
{
93+
$this->db->query('SELECT * FROM users WHERE email = :email');
94+
$this->db->bind(':email', $email);
95+
96+
return $this->db->single();
97+
}
98+
```
99+
100+
### JavaScript Code Style
101+
102+
* Use modern ES6+ syntax where appropriate
103+
* Use meaningful variable names
104+
* Add comments for complex logic
105+
* Use semicolons consistently
106+
107+
### SQL
108+
109+
* Use UPPERCASE for SQL keywords
110+
* Use prepared statements to prevent SQL injection
111+
* Use meaningful table and column names
112+
113+
## Git Commit Messages
114+
115+
* Use the present tense ("Add feature" not "Added feature")
116+
* Use the imperative mood ("Move cursor to..." not "Moves cursor to...")
117+
* Limit the first line to 72 characters or less
118+
* Reference issues and pull requests liberally after the first line
119+
120+
### Examples:
121+
122+
```
123+
Add user authentication feature
124+
125+
- Implement login/logout functionality
126+
- Add session management
127+
- Create user registration form
128+
129+
Fixes #123
130+
```
131+
132+
## Testing
133+
134+
* Test your changes thoroughly before submitting
135+
* Include test cases if applicable
136+
* Verify that existing functionality still works
137+
138+
## Documentation
139+
140+
* Update the README.md if you change functionality
141+
* Comment your code where necessary
142+
* Update inline documentation for functions and classes
143+
144+
## Questions?
145+
146+
Feel free to open an issue with your question or contact the maintainers directly.
147+
148+
## Recognition
149+
150+
Contributors will be recognized in the project's README.md file.
151+
152+
---
153+
154+
Thank you for contributing! 🎉

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) 2025 elightsys
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.

0 commit comments

Comments
 (0)