Thanks to visit codestin.com
Credit goes to github.com

Skip to content

gmaxsoft/cms

Repository files navigation

Maxsoft MVC CMS

A modern, lightweight Content Management System (CMS) built with PHP and JavaScript, designed for flexibility and ease of use. This CMS leverages an MVC architecture, utilizing PHP libraries like Laravel's Eloquent ORM, Twig templating, and a simple router, combined with a robust front-end setup using Webpack, Bootstrap, and jQuery.

Features

  • MVC Architecture: Organized structure with Core and App namespaces for clean code separation.
  • Database Support: Uses Laravel's Eloquent ORM (illuminate/database) for database interactions.
  • Templating: Powered by Twig (twig/twig) for dynamic and secure template rendering.
  • Routing: Simple and fast routing with pecee/simple-router.
  • Front-End: Built with Bootstrap 5, jQuery, and Webpack for modern, responsive UI.
  • Additional Tools:
    • PDF generation with mpdf/mpdf.
    • Image processing with spatie/image.
    • JWT authentication with firebase/php-jwt.
    • Environment configuration with vlucas/phpdotenv.
  • Development Tools: Includes GrumPHP for code quality and Webpack for asset bundling.

Prerequisites

Before setting up the project, ensure you have the following installed:

  • PHP: 8.1 or higher
  • Composer: For PHP dependency management
  • Node.js: 16.x or higher
  • npm: For JavaScript dependency management
  • MySQL: For database storage
  • Git: For cloning the repository

Installation

Follow these steps to set up the CMS locally:

  1. Clone the Repository:

    git clone https://github.com/gmaxsoft/cms.git
    cd cms
  2. Install PHP Dependencies: Run the following command to install the required PHP packages:

    composer install
  3. Install JavaScript Dependencies: Install front-end dependencies using npm:

    npm install
  4. Set Up Environment: Copy the .env.example file (if available) to .env and configure your environment variables:

    cp .env.example .env

    Update the .env file with your database credentials and other settings. Example configuration:

    DEBUG=true
    DEFAULT_BLOCK_LANG=1
    DB_DRIVER=mysql
    DB_HOST=localhost
    DB_NAME=YOUR OWN DATABASE NAME
    DB_USER=root
    DB_PASS=
    FRONTEND_URL=http://localhost:3000
    SECRET_KEY=your-secure-secret-key
    DEFAULT_BLOCK_LANG = 1
    SLIDERFILESPATH = 'upload/sliderImg/'
  5. Set Up the Database: Create a MySQL database named YOUR OWN DATABASE NAME (or your preferred name, matching the DB_NAME in .env). To start the database installation process, enter http://localhost:3000/install.php. Follow the instructions.

    
    
  6. Build Front-End Assets: Compile and bundle the front-end assets using Webpack:

    npm run build
  7. Start the Development Server: Start the Webpack development server for front-end development:

    npm run dev

    Alternatively, serve the PHP application using a local server (e.g., PHP's built-in server):

    php -S localhost:8000 -t public
  8. Access the CMS: Open your browser and navigate to http://localhost:3000 for the front-end or http://localhost:8000 for the PHP server, depending on your setup.

Usage

  • Admin Panel: Access the CMS admin panel (if implemented) via the configured FRONTEND_URL.
  • Customizing Templates: Modify Twig templates in the app/views directory (assumed based on standard MVC structure).
  • Adding Routes: Define custom routes in the app directory using pecee/simple-router.
  • Asset Management: Update SCSS files in public/scss or JavaScript files in public/js and rebuild assets with npm run build.

Project Structure

cms/
├── app/                    # Application logic (Controllers, Models, etc.)
├── core/                   # Core CMS functionality
├── public/                 # Publicly accessible files
│   ├── js/                 # JavaScript source files
│   ├── scss/               # SCSS source files
├── dist/                   # Compiled front-end assets
├── vendor/                 # Composer dependencies
├── node_modules/           # npm dependencies
├── .env                    # Environment configuration
├── composer.json           # PHP dependencies
├── package.json            # JavaScript dependencies
├── webpack.config.js       # Webpack configuration
└── README.md               # Project documentation

Development

  • Code Quality: Use GrumPHP for automated code quality checks:
    composer run-script grumphp
  • Front-End Development: Run npm run dev for live reloading during development.
  • Production Build: Generate optimized assets for production:
    npm run build

Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the repository.
  2. Create a new branch (git checkout -b feature/your-feature).
  3. Make your changes and commit (git commit -m 'Add your feature').
  4. Push to the branch (git push origin feature/your-feature).
  5. Open a pull request on GitHub.

Report bugs or suggest features via the GitHub Issues page.

License

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

Contact

For questions or support, contact the author:

About

PHP MCV CMS - A modern, lightweight Content Management System (CMS)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published