Skip to content

mu7ammad-3li/SwiftDashboard

Repository files navigation

πŸ“Š SwiftDashboard

Admin Dashboard for SwiftCart E-Commerce Platform

A powerful, real-time admin dashboard for managing your e-commerce operations. Monitor sales, track inventory, manage orders, and analyze customer dataβ€”all in one beautiful interface.

License: MIT React TypeScript Vite

Live Demo Β· Report Bug Β· Request Feature


πŸ“‘ Table of Contents


✨ Features

🎯 Core Features

  • Real-time Analytics: Live sales and revenue tracking
  • Order Management: Process and track all customer orders
  • Inventory Control: Manage products and stock levels
  • Customer Insights: User behavior and purchase analytics
  • Sales Reports: Detailed revenue and performance metrics
  • Product Management: Add, edit, and remove products

πŸ”’ Admin Features

  • Role-Based Access: Secure admin authentication
  • Data Visualization: Beautiful charts and graphs
  • Responsive Design: Works perfectly on all devices
  • Real-time Updates: Live data synchronization
  • Export Reports: Download data as CSV/PDF
  • Dark Mode: Eye-friendly interface option

πŸ›  Tech Stack

Frontend

React TypeScript Vite TailwindCSS

UI Components

shadcn/ui Radix UI


πŸš€ Getting Started

Prerequisites

Before you begin, ensure you have the following installed:

  • Node.js 18+ (Download)
  • npm or yarn
  • SwiftCart Backend (API endpoints required)

Installation

  1. Clone the repository
git clone https://github.com/mu7ammad-3li/SwiftDashboard.git
cd SwiftDashboard
  1. Install dependencies
npm install
  1. Create environment file (optional)

Create a .env file in the root directory:

# API Configuration
VITE_API_URL=http://localhost:3000/api
VITE_WS_URL=ws://localhost:3000

# App Configuration
VITE_APP_NAME=SwiftDashboard
VITE_APP_VERSION=1.0.0
  1. Run the development server
npm run dev

The dashboard will be running at: http://localhost:5173

  1. Build for production
npm run build

πŸ“ Project Structure

SwiftDashboard/
β”œβ”€β”€ πŸ“‚ src/                          # Source code
β”‚   β”œβ”€β”€ πŸ“‚ components/               # React components
β”‚   β”‚   β”œβ”€β”€ πŸ“‚ ui/                  # shadcn/ui components
β”‚   β”‚   β”‚   β”œβ”€β”€ button.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ card.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ chart.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ table.tsx
β”‚   β”‚   β”‚   └── ...
β”‚   β”‚   β”œβ”€β”€ πŸ“‚ dashboard/           # Dashboard components
β”‚   β”‚   β”‚   β”œβ”€β”€ Overview.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ SalesChart.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ RecentOrders.tsx
β”‚   β”‚   β”‚   └── Analytics.tsx
β”‚   β”‚   β”œβ”€β”€ πŸ“‚ layout/              # Layout components
β”‚   β”‚   β”‚   β”œβ”€β”€ Sidebar.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ Header.tsx
β”‚   β”‚   β”‚   └── MainLayout.tsx
β”‚   β”‚   β”œβ”€β”€ πŸ“‚ orders/              # Order management
β”‚   β”‚   β”‚   β”œβ”€β”€ OrderList.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ OrderDetails.tsx
β”‚   β”‚   β”‚   └── OrderStatus.tsx
β”‚   β”‚   β”œβ”€β”€ πŸ“‚ products/            # Product management
β”‚   β”‚   β”‚   β”œβ”€β”€ ProductList.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ ProductForm.tsx
β”‚   β”‚   β”‚   └── ProductTable.tsx
β”‚   β”‚   └── πŸ“‚ customers/           # Customer management
β”‚   β”‚       β”œβ”€β”€ CustomerList.tsx
β”‚   β”‚       └── CustomerDetails.tsx
β”‚   β”œβ”€β”€ πŸ“‚ pages/                   # Page components
β”‚   β”‚   β”œβ”€β”€ Dashboard.tsx
β”‚   β”‚   β”œβ”€β”€ Orders.tsx
β”‚   β”‚   β”œβ”€β”€ Products.tsx
β”‚   β”‚   β”œβ”€β”€ Customers.tsx
β”‚   β”‚   β”œβ”€β”€ Analytics.tsx
β”‚   β”‚   └── Settings.tsx
β”‚   β”œβ”€β”€ πŸ“‚ lib/                     # Utilities and configurations
β”‚   β”‚   β”œβ”€β”€ api.ts                  # API client
β”‚   β”‚   β”œβ”€β”€ utils.ts                # Helper functions
β”‚   β”‚   └── constants.ts            # Constants
β”‚   β”œβ”€β”€ πŸ“‚ hooks/                   # Custom React hooks
β”‚   β”‚   β”œβ”€β”€ useOrders.ts
β”‚   β”‚   β”œβ”€β”€ useProducts.ts
β”‚   β”‚   └── useAnalytics.ts
β”‚   β”œβ”€β”€ πŸ“‚ types/                   # TypeScript type definitions
β”‚   β”‚   β”œβ”€β”€ order.ts
β”‚   β”‚   β”œβ”€β”€ product.ts
β”‚   β”‚   └── analytics.ts
β”‚   β”œβ”€β”€ App.tsx                     # Main application component
β”‚   β”œβ”€β”€ main.tsx                    # Application entry point
β”‚   └── index.css                   # Global styles
β”œβ”€β”€ πŸ“‚ public/                      # Static assets
β”œβ”€β”€ .env                            # Environment variables (create this)
β”œβ”€β”€ .env.example                    # Environment template
β”œβ”€β”€ .gitignore                      # Git ignore rules
β”œβ”€β”€ package.json                    # Dependencies and scripts
β”œβ”€β”€ vite.config.ts                  # Vite configuration
β”œβ”€β”€ tailwind.config.ts              # Tailwind CSS configuration
β”œβ”€β”€ tsconfig.json                   # TypeScript configuration
└── README.md                       # This file

πŸ“œ Available Scripts

# Start development server with hot reload
npm run dev

# Build for production
npm run build

# Preview production build locally
npm run preview

# Lint code with ESLint
npm run lint

πŸ“Š Dashboard Features

Overview Page

  • Revenue Metrics: Total sales, revenue, and growth percentages
  • Order Statistics: Pending, processing, and completed orders
  • Customer Analytics: New customers, retention rates
  • Quick Actions: Fast access to common tasks

Order Management

  • Order List: View all orders with filtering and sorting
  • Order Details: Complete order information and timeline
  • Status Updates: Change order status with notifications
  • Order Search: Find orders by ID, customer, or date

Product Management

  • Product Catalog: View all products with images and details
  • Add/Edit Products: Comprehensive product form
  • Inventory Tracking: Stock levels and low-stock alerts
  • Bulk Actions: Edit multiple products at once

Analytics & Reports

  • Sales Charts: Daily, weekly, monthly revenue trends
  • Top Products: Best-selling items and categories
  • Customer Insights: Purchase patterns and demographics
  • Export Data: Download reports as CSV or PDF

Settings

  • Profile Management: Update admin profile
  • Notification Preferences: Configure alerts
  • Theme Settings: Light/dark mode toggle
  • API Configuration: Manage API endpoints

🌐 Deployment

Deploy to Vercel

npm install -g vercel
vercel

Deploy to Netlify

npm install -g netlify-cli
netlify deploy --prod

Deploy to Custom Server

npm run build
# Upload the 'dist' folder to your server

πŸ”— Integration with SwiftCart

SwiftDashboard is designed to work seamlessly with the SwiftCart e-commerce platform. Ensure that:

  1. SwiftCart API is running and accessible
  2. CORS is configured to allow dashboard origin
  3. Authentication tokens are properly configured
  4. WebSocket connections are enabled for real-time updates

🀝 Contributing

Contributions are what make the open-source community amazing! Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

πŸ“ License

Distributed under the MIT License. See LICENSE for more information.


πŸ“§ Contact

Muhammad Ali

Project Link: https://github.com/mu7ammad-3li/SwiftDashboard


πŸ™ Acknowledgments


Built with ❀️ by Muhammad Ali

Part of the SwiftCart Ecosystem

⬆ Back to Top

About

Dashboard for SwiftCart (React + TypeScript + Vite)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages