The eCommerce Single Admin WebApp is a powerful platform tailored for small businesses, allowing administrators to manage products, categories, and orders with ease. This application simplifies the complexities of online store management, providing essential features for product handling and order processing.
- User Authentication: Secure login and logout functionalities.
- Product Management: Add, delete, edit, and update products effortlessly.
- Category Management: Organize and manage product categories and subcategories.
- Sales Overview: View total sales figures and current inventory levels.
- Stock Alerts: Notifications for products with low stock (below 5).
- Order Management: Users can place orders, while admins can complete or cancel them.
- Frontend: HTML, CSS, JavaScript, jQuery, Bootstrap, Toastr
- Backend: Laravel 11
- Database: MySQL
- Authentication: Breez
- Roles and Permissions: Laratrust
- PHP >= 8.2.12
- Composer
- Node.js and npm
- MySQL
-
Clone the repository:
git clone https://github.com/Abu-Salah-Musha-Lemon/ecommerce-single-admin-webapp.git cd ecommerce-single-admin-webapp
-
Install Composer dependencies:
composer install
-
Create a new MySQL database:
CREATE DATABASE ecommerce_db;
-
Configure your
.env
file:Update the database connection settings in your
.env
file:DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=ecommerce_db DB_USERNAME=your_username DB_PASSWORD=your_password
-
Generate application key:
php artisan key:generate
-
Cache the configuration:
php artisan config:cache
-
Install npm packages:
npm install
-
Run Laravel migrations:
php artisan migrate
-
Run the development server:
php artisan serve
Ensure the following extension is enabled in your php.ini
file:
extension=zip
To enable the pagination system, modify the AppServiceProvider
:
namespace App\Providers;
use Illuminate\Pagination\Paginator;
use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider
{
public function boot(): void
{
Paginator::useBootstrap();
}
}
Ensure your User
model is configured for Laratrust:
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
use Laratrust\Traits\HasRolesAndPermissions;
use Laratrust\Contracts\LaratrustUser;
class User extends Authenticatable implements LaratrustUser
{
use HasFactory, Notifiable, HasRolesAndPermissions;
protected $fillable = [
'name',
'email',
'password',
];
protected $hidden = [
'password',
'remember_token',
];
protected function casts(): array
{
return [
'email_verified_at' => 'datetime',
'password' => 'hashed',
];
}
}
Access the application in your browser at http://localhost:8000
(or the URL provided by the php artisan serve
command).
- User Login: Users can log in using their credentials.
- User Logout: Users can log out to secure their accounts.
- Order Products: Users can browse products and place orders.
- Admin Actions: Admins can manage products, categories, view sales, and process or cancel orders.
This project is licensed under the MIT License.
- Laravel: For backend development.
- Bootstrap and jQuery: For frontend design.
- Laratrust: For role and permission management.