Skip to content

Mati822456/Custom-MVC-PHP-Mods

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Custom-MVC-PHP-Mods

Basic custom MVC web application that supports mods, including plugins and themes. main

Table of Contents

General Info

This project is a simple website that supports mods, including plugins and themes. It is built using a custom MVC architecture, and offers basic support for database queries using only the AND operator. Custom routes can be created with support for HTTP methods such as GET, POST, PUT, PATCH, and DELETE. Plugins and themes can be obtained from repositories, currently four plugins and three themes are available. The website is designed with security in mind, and includes measures to prevent SQL injection attacks. Additionally, the website is fully responsive, ensuring that it works well on a wide range of devices and screen sizes.

plugins themes settings show

Some modifications enabled:

example_main example_theme example_theme_2

Technologies

  • PHP 8.1.5
  • MySQL 8.0.29
  • HTML5
  • CSS3
  • JavaScript
  • JQuery
  • FontAwesome 6.4.0

Setup

To run this project you will need PHP, MySQL on your local machine. (Or Apache like XAMPP).

Installation using only PHP

# Clone this repository
> git clone https://github.com/Mati822456/Custom-MVC-PHP-Mods.git

# Go into the directory
> cd Custom-MVC-PHP-Mods

# Install dependencies from lock file
> composer install

# Start MySQL Shell
> mysqlsh

# Connect to MySQL server
> \connect host@username

# Type password

# Switch to SQL mode
> \sql

# Create database
> CREATE DATABASE DB_NAME

# Set default schema
> use DB_NAME

# Import tables from database.sql
> \source LOCATION\Custom-MVC-PHP-Mods\database.sql

# In file Config\config.php change
> DB_HOST
> DB_USER
> DB_PASS
> DB_NAME

# Optimize autoload
> composer dump-autoload -o

# Start project
> php -S localhost:8000

# Access using
http://localhost:8000
# Easiest
Installation for XAMPP

# Clone this repository
> git clone https://github.com/Mati822456/Custom-MVC-PHP-Mods.git

# Go into the directory
> cd Custom-MVC-PHP-Mods

# Go to the XAMPP directory

# Delete all files from htdocs

# Copy files from downloaded repository and paste them to htdocs

# Install dependencies from lock file
> composer install

# Optimize autoload
> composer dump-autoload -o

# Run XAMPP

# Turn on MySQL Service

# Create Database

# Import database.sql to created database

# In file Config\config.php change
> DB_HOST
> DB_USER
> DB_PASS
> DB_NAME

# Turn on Apache Service

# Access using
http://localhost

Structure

Most important:

  • app
    • Controllers - controllers receive data from the user and respond to their actions, managing the update of the model and refreshing the views
      • Manager.php - the most important main module responsible for loading/unloading/uninstalling mods
      • Controller.php - can be inherited
    • Models - contains model classes
    • Repository - repositories for plugins and themes to easily manage records in database
    • Database.php - database connection and operations
    • router.php - routing
    • web.php - contain routes
  • config
    • config.php - database connection credentials and app version
  • mods - directory where mods are stored
    • plugins
    • themes
  • public
    • css
    • images
    • js
    • mods
      • plugins
      • themes
  • vendor
    • contains only autoload
  • views
    • layouts
      • header.php
    • index.php
    • plugins.php
    • response.php
    • themes.php

Acknowledgements

Thanks https://www.reshot.com/ for icons

Contact

Feel free to contact me via email mateusz.zaborski1@gmail.com. Or linkedin https://www.linkedin.com/in/mateusz-zaborski-326426248/

About

No description or website provided.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published