Skip to content

Admin Panel built with PHP for managing blogs, portfolios, templates, and user comments. It includes CRUD operations and authentication features.

Notifications You must be signed in to change notification settings

FarhamAghdasi/php-cms

Repository files navigation

Admin Panel Project

This project is an Admin Panel built with PHP for managing blogs, portfolios, templates, and user comments. It includes CRUD operations and authentication features.

📂 Folder Structure

[FILE] .htaccess
[DIR] backend
    ├── add-comment.php
    ├── add-portfolio.php
    ├── add-post.php
    ├── add-stats.php
    ├── add-template.php
    ├── add-view.php
    ├── delete-portfolio.php
    ├── delete-post.php
    ├── delete-template.php
    ├── edit-portfolio.php
    ├── edit-post.php
    ├── edit-template.php
    ├── login.php
[DIR] components
    ├── check-login.php
    ├── data (JSON files for storage)
    ├── getdata.php
    ├── header.php
    ├── logout.php
    ├── sidebar.php
[FILE] create-blog.php
[FILE] create-portfolio.php
[FILE] create-template.php
[FILE] edit-portfolio.php
[FILE] edit-post.php
[FILE] edit-template.php
[FILE] index.php
[FILE] list-blog.php
[FILE] list-comment.php
[FILE] list-portfolio.php
[FILE] list-template.php
[FILE] sign-in.php
[FILE] sitemap.php
[FILE] sitemap.xml
[DIR] source
    ├── check.php

✨ Features

  • User authentication (Login system)
  • CRUD operations for Blogs, Portfolios, and Templates
  • JSON-based data storage
  • Admin dashboard for easy management
  • Blog and portfolio listing
  • Sitemap generation

🚀 Installation

  1. Install XAMPP or a PHP-supported environment.
  2. Place the project in htdocs directory.
  3. Start Apache and MySQL from XAMPP.
  4. Access the project via http://localhost/admin-panel/.

🛠 Usage

Login

POST /backend/login.php
Body (JSON):
{
    "username": "admin",
    "password": "password"
}
Response:
{
    "token": "your_generated_token"
}

Add a New Blog Post

POST /backend/add-post.php
Body (JSON):
{
    "title": "My Blog Title",
    "description": "Content of the blog post",
    "author": "Admin"
}
Response:
{
    "message": "Post added successfully"
}

List Blog Posts

GET /backend/list-blog.php
Response:
{
    "posts": [ { "id": 1, "title": "Blog Title", "author": "Admin" } ]
}

Edit a Blog Post

PATCH /backend/edit-post.php?id=1
Body (JSON):
{
    "title": "Updated Title",
    "description": "Updated content"
}
Response:
{
    "message": "Post updated successfully"
}

Delete a Blog Post

DELETE /backend/delete-post.php?id=1
Response:
{
    "message": "Post deleted successfully"
}

🔒 Authentication

  • The system requires a valid token for making requests.
  • Implement JWT or session-based authentication for better security.

🌟 Future Improvements

  • Implement database storage instead of JSON files.
  • Use a framework like Laravel for improved security and maintainability.
  • Add user roles and permissions.

📜 License

This project is for educational purposes only and is not intended for production use.

👨‍💻 Author

Farham Aghdasi

About

Admin Panel built with PHP for managing blogs, portfolios, templates, and user comments. It includes CRUD operations and authentication features.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published