Skip to content

corbanrwi/Stock-Management

Repository files navigation

📦 Stock Management System

A simple and user-friendly Stock Management Web Application built with Laravel 9. It allows each registered user to manage their own products, track incoming stock (stock-in), outgoing stock (stock-out), and view daily reports — all through a clean web interface.


🚀 Features

  • 🔐 User Authentication — Register and login with username & password
  • 📦 Product Management — Create, edit, and delete your own products
  • 📥 Stock In — Record incoming stock with quantity and unit price
  • 📤 Stock Out — Record outgoing stock; automatically deducts from available quantity
  • 📊 Daily Reports — Filter and view stock-in and stock-out activity by date
  • 🧑‍💼 Per-User Data — Each user sees and manages only their own data

🛠️ Tech Stack

Layer Technology
Language PHP 8.0
Framework Laravel 9.x
Database MySQL (via XAMPP)
Auth Laravel built-in Auth
Frontend Blade Templates
Server Apache (XAMPP)

📁 Project Structure

stock/
├── app/
│   ├── Http/Controllers/
│   │   ├── AuthController.php        # Login, Register, Logout
│   │   ├── DashboardController.php   # Dashboard summary counts
│   │   ├── ProductController.php     # CRUD for products
│   │   ├── StockController.php       # CRUD for stock-in
│   │   ├── StockOutController.php    # CRUD for stock-out
│   │   └── ReportController.php      # Daily report view
│   └── Models/
│       ├── User.php
│       ├── Product.php
│       ├── Stock.php
│       └── StockOut.php
├── database/
│   └── migrations/                   # All table definitions
├── resources/views/                  # Blade template files
├── routes/
│   └── web.php                       # All application routes
└── .env                              # Environment configuration

🗄️ Database Tables

Table Description
users Registered user accounts
products Products created by each user
stocks Stock-in records (quantity + unit price)
stock_outs Stock-out records (deducts from stock)
migrations Laravel internal migration tracker
failed_jobs Laravel queue system (internal)
personal_access_tokens Sanctum API tokens (internal)
password_resets Password reset tokens (internal)

🌐 Application Routes

Method URL Controller Action Auth Required
GET / Welcome page
GET /register Show register form
POST /register Submit registration
GET /login Show login form
POST /login Submit login
POST /logout Logout user
GET /dashboard Dashboard with counts
GET /products List all products
GET /products/create Show product creation form
POST /products Store new product
GET /products/{id}/edit Edit a product
PUT /products/{id} Update product
DELETE /products/{id} Delete product
GET /stockin List all stock-in entries
GET /stockin/create Show stock-in form
POST /stockin Record new stock-in
GET /stockin/{id}/edit Edit stock-in entry
PUT /stockin/{id} Update stock-in
DELETE /stockin/{id} Delete stock-in
GET /stockout List all stock-out entries
GET /stockout/create Show stock-out form
POST /stockout Record new stock-out
DELETE /stockout/{id} Delete stock-out (restores qty)
GET /daily-report View daily stock report

⚙️ Installation & Setup

Prerequisites

Steps

1. Clone or download the project

cd C:\Users\user\Downloads\stock

2. Install PHP dependencies

composer install

3. Create your environment file

copy .env.example .env

4. Configure the database in .env

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=stock_db        # ← your database name
DB_USERNAME=root
DB_PASSWORD=                # ← leave blank if no password

5. Generate application key

php artisan key:generate

6. Run database migrations (creates all tables)

php artisan migrate

7. Start the development server

php artisan serve

8. Open in browser

http://127.0.0.1:8000

💡 How to Use

  1. Register a new account at /register
  2. Login with your credentials at /login
  3. Add Products — Go to Products → Create and add your product names
  4. Record Stock In — Go to Stock In → Add to record received quantities
  5. Record Stock Out — Go to Stock Out → Add to record dispatched quantities
  6. View Reports — Go to Daily Report and pick a date to see activity

🔒 Security Notes

  • All product, stock-in, and stock-out data is user-scoped (users cannot see each other's data)
  • Passwords are hashed using Laravel's Hash::make() (bcrypt)
  • All protected routes are guarded by the auth middleware
  • CSRF protection is applied on all forms via Laravel's @csrf token

📝 License

This project is for educational/personal use.
Built with ❤️ using Laravel 9 and XAMPP.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors