Skip to content

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

1 watching

Forks

Repository files navigation

Here's the README.md with code blocks and comments integrated into the structure as requested


MVCStructure

Project Overview (not finished yet)

MVCStructure is organized using the MVC (Model-View-Controller) design pattern, promoting separation of concerns by dividing application functionality into Models, Views, and Controllers. This layout enhances the project's maintainability, scalability, and readability. The project structure also includes routing, configuration, validation, and asset management for building a full-featured web application.


Table of Contents


Directory Structure

Below is the directory structure of MVCStructure:

.
├── App/                       # Main application directory
│   ├── controller/            # Contains controller files for handling application logic
│   └── models/                # Contains model files for interacting with the database
├── Config/                    # Contains configuration files for the application
├── database/                  # Contains database files like (sqlite, etc)
├── Public/                    # Publicly accessible files
│   ├── index.php              # The entry point for the application
│   └── assets/                # Directory for static assets
│       ├── css/               # Stores cascading style sheets
│       ├── js/                # Stores JavaScript files
│       ├── lang/              # Stores language files
│       └── images/            # Stores image assets
├── routes/                    # Contains route definitions for the application
├── src/                       # Source code directory
│   ├── HTTP/                  # Contains HTTP-related functionality
│   ├── support/               # Support classes for the application
│   ├── view/                  # Contains view-related classes
│   ├── Validation/            # Contains validation logic
│   │   ├── Rules/             # Contains validation rules
│   │       ├── Contract/      # Defines contracts for validation rules
│   ├── Database/              # Database-related classes and functionality
│   │   ├── Concerns/          # Database concerns
│   │   ├── Grammars/          # Database grammars
│   │   ├── Managers/          # Database managers
│   │       ├── Contract/      # Database contracts
│   └── Application.php        # Main application logic
├── views/                     # Contains view templates
│   ├── auth/                  # Templates for authentication
│   ├── errors/                # Contains error view templates
│   ├── layout/                # Contains layout templates
│   ├── partials/              # Contains partial templates for reuse
│   └── index.php              # The main application file
└── README.md                  # Documentation for the project

Installation

To set up MVCStructure on your local environment, follow these steps:

  1. Clone the Repository

    Clone the repository to your local environment:

    git clone https://github.com/AbdelrhmanEssam74/MVCStructure.git
    cd MVCStructure
  2. Install PHP Dependencies

    Ensure Composer is installed, then run:

    composer install
  3. Install Node.js Dependencies

    Install Node.js dependencies for static assets (e.g., CSS, JavaScript):

    npm install
  4. Run the Application

    Navigate to the Public directory and start the PHP server:

    cd Public
    php -S localhost:800

    The application should now be accessible at http://localhost:800.


Usage

The MVCStructure project follows the MVC pattern to structure the application, with each major component serving a distinct purpose:

  • Models (App/models/): Handles data logic and communication with the database.
  • Controllers (App/controller/): Manages application logic, processes incoming requests, and determines which views to render.
  • Views (views/): Renders user interface templates, organized with layout and partial templates for reusability.
  • Routes (routes/): Defines application routes and maps them to specific controllers and actions.

For instance, adding a new route might look like:

// routes/web.php

Route::get('/', [HomeController::class, 'index']);

This route definition would map a GET request to /home to the index method in the HomeController.


Contributing

Contributions are welcome! Here’s how to get started:

  1. Fork the Repository on GitHub.
  2. Create a Feature Branch locally:
    git checkout -b feature/new-feature
  3. Commit Your Changes with clear and concise messages:
    git commit -m "Add new feature"
  4. Push to Your Branch:
    git push origin feature/new-feature
  5. Open a Pull Request on GitHub.

Please ensure that your code follows best practices and includes documentation for maintainability.


License

This project is licensed under the MIT License. See the LICENSE file for details.


Thank you for using MVCStructure!

The rest of the documentation will be written soon

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages