TokoKita is a modern e-commerce platform built with a decoupled architecture featuring a separate API backend and a client-side frontend. It provides a complete online shopping experience for users and a powerful management panel for administrators to manage products and orders.
- Backend: Laravel
- Frontend: React (Vite)
- Database: MySQL
- Styling: Tailwind CSS
TokoKita/
├── backend/ # Laravel Project (API)
│ ├── app/
│ │ ├── Http/
│ │ │ ├── Controllers/ # Logic for handling API requests
│ │ │ └── Middleware/ # Filters for HTTP requests (e.g., IsAdmin)
│ │ ├── Models/ # Database table representations (Eloquent)
│ │ └── Notifications/ # Classes for notifications (e.g., new order)
│ ├── config/ # Project configuration files
│ ├── database/
│ │ ├── migrations/ # Database schema definitions
│ │ └── seeders/ # Database seeders for initial data
│ └── routes/
│ └── api.php # API endpoint definitions
├── frontend/ # React Project (Client)
│ ├── public/ # Public assets not processed by Vite
│ └── src/
│ ├── api/ # Axios client configuration for API communication
│ ├── components/ # Reusable UI components
│ ├── contexts/ # Global state management (Auth, Cart, etc.)
│ ├── layouts/ # Page layout components (Main, Admin, Auth)
│ ├── pages/ # Components for each application page
│ └── App.jsx # Main application component and routing
└── README.md # This documentation file
Note: For a more detailed breakdown of the
backendandfrontenddirectories, please refer to theREADME.mdfiles located within each respective folder.
Ensure the following software is installed on your machine:
- PHP (v8.2+ recommended)
- Composer
- Node.js & NPM
- A MySQL Server (XAMPP, Laragon, or other solutions are recommended)
- Clone this repository:
git clone https://github.com/mohamadsolkhannawawi/Project-PBP-Mini-Commerce.git
- Navigate into the project directory:
cd Project-PBP-Mini-Commerce
-
Navigate to the backend directory:
cd backend -
Install PHP dependencies:
composer install
-
Create the environment file by copying the example:
cp .env.example .env or copy .env.example .env
-
Generate the application key:
php artisan key:generate
-
Open the
.envfile and configure your database connection:DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=tokokita_db // Choose a name for your database DB_USERNAME=root // Your database username DB_PASSWORD= // Your database password
-
Database Setup:
- Start your MySQL server.
- Create a new database with the name you specified in the
.envfile (e.g.,db_umkm_minicommerce). - Run the database migrations and seeders to create the tables and populate them with initial data:
php artisan migrate --seed
- Create a symbolic link to make uploaded images publicly accessible:
php artisan storage:link
- Run the backend development server:
The API will be available at
php artisan serve
http://127.0.0.1:8000.
- Open a new terminal and navigate to the frontend directory:
cd frontend - Install JavaScript dependencies:
npm install
- Run the frontend development server:
npm run dev
- Open your browser and navigate to the URL provided by Vite (usually
http://localhost:5173).