Skip to content

hammadali2233/product-management-system

Repository files navigation

🚀 Product Management System (Laravel 11)

A RESTful API-based Product & Post Management System built with Laravel 11, implementing authentication, role-based access control, and optimized algorithms.


📌 Project Overview

This project demonstrates backend development skills including:

  • REST API design
  • Authentication & authorization
  • Role-based access control (RBAC)
  • Clean code structure
  • Algorithm problem-solving

🛠 Tech Stack

  • PHP 8.2+
  • Laravel 11
  • MySQL
  • Composer

⚙️ Installation & Setup

1️⃣ Clone the Repository

git clone https://github.com/hammadali2233/product-management-system.git
cd product-management-system

2️⃣ Install Dependencies

composer install

3️⃣ Environment Setup

cp .env.example .env

4️⃣ Generate Application Key

php artisan key:generate

5️⃣ Configure Database

Update .env file:

DB_DATABASE=your_db_name
DB_USERNAME=root
DB_PASSWORD=

6️⃣ Run Migrations

php artisan migrate

7️⃣ Start Development Server

php artisan serve

Server will run at:

http://127.0.0.1:8000

🔐 Authentication

This project uses Laravel authentication for securing APIs.


📡 API Endpoints

🧾 Products (CRUD)

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

📝 Posts (Role-Based Access)

Method Endpoint Access
GET /api/posts Admin: All posts / Author: Own posts
POST /api/posts Author only
DELETE /api/posts/{id} Admin only

👥 User Roles

🔹 Author

  • Create posts
  • View own posts only

🔹 Admin

  • View all posts
  • Delete any post

🧠 Logic Implementations

Located in:

app/Logic/Solutions.php

🔸 Task 3: Longest Substring Without Repeating Characters

  • Technique: Sliding Window + Hash Map
  • Time Complexity: O(n)
  • Example:
Input: "abcabcbb"
Output: 3

🔸 Task 4: Group Anagrams

  • 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"]]

📂 Project Structure Highlights

  • app/Models → Eloquent models
  • app/Http/Controllers → API controllers
  • app/Logic → Algorithm solutions
  • routes/api.php → API routes

✨ Features

  • Clean RESTful API design
  • Role-based authorization (Admin / Author)
  • Secure endpoints
  • Optimized algorithm implementations
  • Scalable project structure

📌 Future Improvements

  • API documentation with Postman/Swagger
  • Unit & Feature Testing
  • Pagination & filtering
  • Docker support

👨‍💻 Author

Hammad Ali


About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages