A RESTful API-based Product & Post Management System built with Laravel 11, implementing authentication, role-based access control, and optimized algorithms.
This project demonstrates backend development skills including:
- REST API design
- Authentication & authorization
- Role-based access control (RBAC)
- Clean code structure
- Algorithm problem-solving
- PHP 8.2+
- Laravel 11
- MySQL
- Composer
git clone https://github.com/hammadali2233/product-management-system.git
cd product-management-systemcomposer installcp .env.example .envphp artisan key:generateUpdate .env file:
DB_DATABASE=your_db_name
DB_USERNAME=root
DB_PASSWORD=php artisan migratephp artisan serveServer will run at:
http://127.0.0.1:8000
This project uses Laravel authentication for securing APIs.
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/products | Get all products |
| POST | /api/products | Create product |
| GET | /api/products/{id} | Get single product |
| PUT | /api/products/{id} | Update product |
| DELETE | /api/products/{id} | Delete product |
| Method | Endpoint | Access |
|---|---|---|
| GET | /api/posts | Admin: All posts / Author: Own posts |
| POST | /api/posts | Author only |
| DELETE | /api/posts/{id} | Admin only |
- Create posts
- View own posts only
- View all posts
- Delete any post
Located in:
app/Logic/Solutions.php
- Technique: Sliding Window + Hash Map
- Time Complexity: O(n)
- Example:
Input: "abcabcbb"
Output: 3
- Technique: Sorting + Hash Map
- Time Complexity: O(n * k log k)
- Example:
Input: ["eat","tea","tan","ate","nat","bat"]
Output: [["eat","tea","ate"],["tan","nat"],["bat"]]
app/Models→ Eloquent modelsapp/Http/Controllers→ API controllersapp/Logic→ Algorithm solutionsroutes/api.php→ API routes
- Clean RESTful API design
- Role-based authorization (Admin / Author)
- Secure endpoints
- Optimized algorithm implementations
- Scalable project structure
- API documentation with Postman/Swagger
- Unit & Feature Testing
- Pagination & filtering
- Docker support
Hammad Ali
- GitHub: https://github.com/hammadali2233