This project is an Admin Panel built with PHP for managing blogs, portfolios, templates, and user comments. It includes CRUD operations and authentication features.
[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
- 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
- Install XAMPP or a PHP-supported environment.
- Place the project in
htdocsdirectory. - Start Apache and MySQL from XAMPP.
- Access the project via
http://localhost/admin-panel/.
POST /backend/login.php
Body (JSON):
{
"username": "admin",
"password": "password"
}
Response:
{
"token": "your_generated_token"
}
POST /backend/add-post.php
Body (JSON):
{
"title": "My Blog Title",
"description": "Content of the blog post",
"author": "Admin"
}
Response:
{
"message": "Post added successfully"
}
GET /backend/list-blog.php
Response:
{
"posts": [ { "id": 1, "title": "Blog Title", "author": "Admin" } ]
}
PATCH /backend/edit-post.php?id=1
Body (JSON):
{
"title": "Updated Title",
"description": "Updated content"
}
Response:
{
"message": "Post updated successfully"
}
DELETE /backend/delete-post.php?id=1
Response:
{
"message": "Post deleted successfully"
}
- The system requires a valid token for making requests.
- Implement JWT or session-based authentication for better security.
- Implement database storage instead of JSON files.
- Use a framework like Laravel for improved security and maintainability.
- Add user roles and permissions.
This project is for educational purposes only and is not intended for production use.
Farham Aghdasi