{"id":22729473,"url":"https://github.com/bartzalewski/simple-cms","last_synced_at":"2026-05-19T06:02:13.369Z","repository":{"id":265710203,"uuid":"806739510","full_name":"bartzalewski/simple-cms","owner":"bartzalewski","description":"This project is a PHP-based Content Management System (CMS) with user roles and permissions.","archived":false,"fork":false,"pushed_at":"2024-05-27T19:54:29.000Z","size":7,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-23T20:02:38.630Z","etag":null,"topics":["cms","php"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bartzalewski.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-05-27T19:54:00.000Z","updated_at":"2024-05-27T19:54:43.000Z","dependencies_parsed_at":"2024-12-02T07:15:48.857Z","dependency_job_id":null,"html_url":"https://github.com/bartzalewski/simple-cms","commit_stats":null,"previous_names":["bartzalewski/simple-cms"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bartzalewski/simple-cms","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bartzalewski%2Fsimple-cms","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bartzalewski%2Fsimple-cms/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bartzalewski%2Fsimple-cms/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bartzalewski%2Fsimple-cms/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bartzalewski","download_url":"https://codeload.github.com/bartzalewski/simple-cms/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bartzalewski%2Fsimple-cms/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266738657,"owners_count":23976439,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-23T02:00:09.312Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cms","php"],"created_at":"2024-12-10T18:10:04.999Z","updated_at":"2026-05-19T06:02:08.289Z","avatar_url":"https://github.com/bartzalewski.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Simple CMS\n\nWelcome to the Simple CMS! This project is a PHP-based Content Management System (CMS) with user roles and permissions. It allows users to register, log in, create, edit, and delete posts. Administrators have additional permissions to manage the content.\n\n## Features\n\n- User Registration and Authentication\n- User Roles: Admin, Editor, and User\n- Create, Edit, and Delete Posts\n- Dashboard for Managing Content\n- Secure Password Hashing\n- Simple and Clean UI\n\n## Project Structure\n\n```\ncms/\n├── config/\n│ └── database.php\n├── public/\n│ ├── index.php\n│ ├── login.php\n│ ├── logout.php\n│ ├── register.php\n│ ├── dashboard.php\n│ ├── create_post.php\n│ ├── edit_post.php\n│ └── delete_post.php\n├── src/\n│ ├── User.php\n│ ├── Post.php\n│ └── Auth.php\n├── templates/\n│ ├── header.php\n│ ├── footer.php\n│ ├── login_form.php\n│ ├── register_form.php\n│ ├── dashboard.php\n│ └── post_form.php\n└── .htaccess\n```\n\n## Getting Started\n\n### Prerequisites\n\nMake sure you have the following software installed on your machine:\n\n- PHP\n- MySQL\n- A web server (e.g., Apache, Nginx)\n- Visual Studio Code (VSCode) or any other code editor\n\n### Installation\n\n1. **Clone the repository:**\n\n   ```sh\n   git clone https://github.com/bartzalewski/simple-cms.git\n   cd simple-cms\n   ```\n\n2. **Set up the database:**\n\n   - Start your MySQL server.\n   - Create a new database named `cms` and run the following SQL commands to set up the tables:\n\n     ```sql\n     CREATE DATABASE cms;\n\n     USE cms;\n\n     CREATE TABLE users (\n         id INT AUTO_INCREMENT PRIMARY KEY,\n         username VARCHAR(50) NOT NULL,\n         password VARCHAR(255) NOT NULL,\n         role ENUM('admin', 'editor', 'user') NOT NULL DEFAULT 'user'\n     );\n\n     CREATE TABLE posts (\n         id INT AUTO_INCREMENT PRIMARY KEY,\n         title VARCHAR(255) NOT NULL,\n         content TEXT NOT NULL,\n         author_id INT NOT NULL,\n         created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,\n         updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,\n         FOREIGN KEY (author_id) REFERENCES users(id)\n     );\n     ```\n\n3. **Configure the database connection:**\n\n   - Open `config/database.php` and update the database connection details:\n\n     ```php\n     \u003c?php\n     // config/database.php\n     $host = 'localhost';\n     $dbname = 'cms';\n     $username = 'root';\n     $password = '';\n\n     try {\n         $pdo = new PDO(\"mysql:host=$host;dbname=$dbname\", $username, $password);\n         $pdo-\u003esetAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n     } catch (PDOException $e) {\n         die(\"Could not connect to the database $dbname :\" . $e-\u003egetMessage());\n     }\n     ?\u003e\n     ```\n\n### Running the Application\n\n1. **Start the PHP server:**\n\n   - Open the `public` folder in your project.\n   - Use the following command to start the PHP built-in server:\n\n     ```sh\n     php -S localhost:8000\n     ```\n\n   - Alternatively, you can use the PHP Server extension in VSCode:\n     - Install the `PHP Server` extension.\n     - Right-click on `index.php` in the `public` folder and select `PHP Server: Serve Project`.\n\n2. **Navigate to the Application:**\n\n   - Open your browser and go to `http://localhost:8000`.\n   - Register a new user by navigating to `http://localhost:8000/register.php`.\n   - Log in with your new user by navigating to `http://localhost:8000/login.php`.\n\n### File Descriptions\n\n- **config/database.php:** Database connection configuration.\n- **public/index.php:** Home page of the CMS.\n- **public/login.php:** User login page.\n- **public/logout.php:** User logout page.\n- **public/register.php:** User registration page.\n- **public/dashboard.php:** User dashboard for managing posts.\n- **public/create_post.php:** Page to create a new post.\n- **public/edit_post.php:** Page to edit an existing post.\n- **public/delete_post.php:** Page to delete a post.\n- **src/User.php:** User-related operations.\n- **src/Post.php:** Post-related operations.\n- **src/Auth.php:** User authentication operations.\n- **templates/header.php:** HTML header and navigation.\n- **templates/footer.php:** HTML footer.\n- **templates/login_form.php:** HTML login form.\n- **templates/register_form.php:** HTML registration form.\n- **templates/dashboard.php:** HTML dashboard to display posts.\n- **templates/post_form.php:** HTML form to create/edit posts.\n- **.htaccess:** Apache configuration for URL rewriting.\n\n### License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n### Acknowledgments\n\n- Thanks to the open-source community for providing excellent resources and tutorials.\n- Special thanks to all contributors to this project.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbartzalewski%2Fsimple-cms","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbartzalewski%2Fsimple-cms","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbartzalewski%2Fsimple-cms/lists"}