Skip to content

FilipWjk/fullstack-vue-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

49 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

E-commerce Management Platform

A modern, full-stack e-commerce management platform built with Vue.js, Node.js, Express, and MySQL. This application provides management tools for products, orders, users, categories, and analytics with role-based access control.

πŸ–ΌοΈ Want a quick preview? Check out the Screenshots section below to see the application in action without needing to clone or install anything!

πŸš€ Features

πŸ‘€ User Management

  • Role-based Access Control: Admin, Manager, and User roles
  • Authentication: JWT-based authentication system
  • User Registration & Login: Secure user authentication
  • Profile Management: Update user information and preferences
  • Dark Mode: Toggle between light and dark themes

πŸ“¦ Product Management

  • Product CRUD Operations: Create, read, update, and delete products
  • Category Management: Organize products into categories
  • Inventory Tracking: Real-time stock management
  • Product Status: Active, inactive, and out-of-stock states

πŸ“‹ Order Management

  • Order Processing: Complete order lifecycle management
  • Order Status Tracking: Pending, processing, shipped, delivered, cancelled
  • Order History: View all orders with detailed information
  • Customer Orders: Customers can view their order history

πŸ“Š Analytics Dashboard

  • Revenue Analytics: Track sales performance over time
  • Category Performance: Analyze product category sales
  • Order Statistics: Monitor order trends and patterns
  • Interactive Charts: Visual data representation using Chart.js

🎨 Modern UI/UX

  • Responsive Design: Mobile-first responsive interface
  • Tailwind CSS: Modern and clean design system
  • Sidebar Navigation: Intuitive navigation with role-based menu items
  • Toast Notifications: User-friendly feedback system
  • Form Validation: Client-side and server-side validation

πŸ›  Tech Stack

Frontend

  • Vue.js 3: Modern JavaScript framework with Composition API
  • TypeScript: Type-safe development
  • Vite: Fast build tool and development server
  • Vue Router: Client-side routing
  • Pinia: State management
  • Tailwind CSS: Utility-first CSS framework
  • Headless UI: Unstyled, accessible UI components
  • Chart.js: Data visualization library
  • Axios: HTTP client for API requests

Backend

  • Node.js: JavaScript runtime
  • Express.js: Web application framework
  • Prisma: Database ORM
  • MySQL: Relational database
  • JWT: JSON Web Tokens for authentication
  • bcrypt.js: Password hashing
  • Joi: Data validation
  • Helmet: Security middleware
  • CORS: Cross-origin resource sharing

Development Tools

  • ESLint: Code linting
  • Prettier: Code formatting
  • Cypress: End-to-end testing
  • Nodemon: Development server auto-restart

πŸ“‹ Prerequisites

Before running this application, make sure you have the following installed:

  • Node.js (version 18.0.0 or higher)
  • npm (version 9.0.0 or higher)
  • MySQL (version 5.7 or higher)
  • Git

πŸš€ Installation & Setup

1. Clone the Repository

git clone https://github.com/FilipWjk/fullstack-vue-app.git
cd fullstack-vue-app

2. Install Dependencies

# Install all dependencies (client + server)
npm run install:all

# Or install separately
npm run install:client
npm run install:server

3. Environment Configuration

Server Environment

Create a .env file in the server directory:

# Database
DATABASE_URL="mysql://username:password@localhost:3306/ecommerce_db"

# JWT
JWT_SECRET="your-super-secret-jwt-key"
JWT_EXPIRE="7d"

# Server
PORT=3001
NODE_ENV="development"

Client Environment

Create a .env file in the client directory:

VITE_API_URL="http://localhost:3001/api"

4. Database Setup

# Generate Prisma client
npm run db:setup

# Or run commands separately
cd server
npx prisma generate
npx prisma migrate dev
npx prisma db seed

5. Start the Application

# Start both client and server
npm run dev

# Or start separately
npm run dev:client  # Frontend (http://localhost:5173)
npm run dev:server  # Backend (http://localhost:3001)

🎯 Default Login Credentials

After seeding the database, you can use these credentials:

Admin User

  • Email: admin@example.com
  • Password: admin123

Manager User

  • Email: manager@example.com
  • Password: manager123

Regular User

  • Email: user@example.com
  • Password: user123

πŸ“ Available Scripts

Root Package Scripts

npm run install:all     # Install all dependencies
npm run dev            # Start both client and server in development
npm run build          # Build both client and server
npm run start          # Start both client and server in production
npm run test           # Run Cypress e2e tests
npm run lint           # Lint both client and server
npm run format         # Format both client and server
npm run db:setup       # Setup database with migrations and seed data
npm run clean          # Clean all node_modules and build files

Client Scripts

npm run dev            # Start development server
npm run build          # Build for production
npm run preview        # Preview production build
npm run test:e2e       # Run Cypress e2e tests
npm run test:e2e:dev   # Open Cypress in development mode
npm run lint           # Run ESLint
npm run format         # Format with Prettier

Server Scripts

npm run dev            # Start development server with nodemon
npm start              # Start production server
npm run db:migrate     # Run database migrations
npm run db:seed        # Seed database with sample data
npm run db:studio      # Open Prisma Studio
npm run lint           # Run ESLint
npm run format         # Format with Prettier

πŸ—‚ Project Structure

fullstack-vue-app/
β”œβ”€β”€ client/                 # Vue.js frontend application
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/     # Reusable Vue components
β”‚   β”‚   β”œβ”€β”€ views/          # Page components
β”‚   β”‚   β”œβ”€β”€ stores/         # Pinia stores for state management
β”‚   β”‚   β”œβ”€β”€ composables/    # Vue composables
β”‚   β”‚   β”œβ”€β”€ utils/          # Utility functions
β”‚   β”‚   β”œβ”€β”€ types/          # TypeScript type definitions
β”‚   β”‚   └── router/         # Vue Router configuration
β”‚   β”œβ”€β”€ cypress/            # E2E tests
β”‚   └── public/             # Static assets
β”œβ”€β”€ server/                 # Node.js backend application
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ controllers/    # Route controllers
β”‚   β”‚   β”œβ”€β”€ routes/         # API routes
β”‚   β”‚   β”œβ”€β”€ services/       # Business logic
β”‚   β”‚   β”œβ”€β”€ middleware/     # Express middleware
β”‚   β”‚   β”œβ”€β”€ utils/          # Utility functions
β”‚   β”‚   └── constants/      # Application constants
β”‚   └── prisma/             # Database schema and migrations
└── screenshots/            # Application screenshots

πŸ–Ό Screenshots

Authentication

πŸ” Login Page

Login Interface User authentication interface with email/password form

πŸ“ Registration Page

Registration Form New user registration with form validation

Dashboard & Analytics

πŸ“Š Main Dashboard

Dashboard Overview Primary dashboard view with key metrics and charts

Dashboard Secondary View Dashboard view showing additional statistics

πŸ“ˆ Analytics Dashboard

Main Analytics Main analytics overview with revenue charts

Secondary Analytics Analytics view with additional metrics

Sales Analytics Sales Analytics

Product Analytics Product performance and category breakdown

Customer Analytics Customer Analytics

Inventory Analytics Inventory levels and stock analytics

Management Pages

πŸ“¦ Products Management

Products List Main products listing page with search and filters

Second List Second view of products listing with different sorting/filtering

Product Edit Form 1 Product editing form

Product Edit Form 2 Product editing form

🏷️ Categories Management

Categories Overview Main categories listing page with all product categories

Category Edit Category editing/creation modal interface

πŸ“‹ Orders Management

Orders List Main orders listing page with all customer orders and status filters

Order Details Detailed view of a specific order with items, customer info, and status

πŸ‘₯ Users Management

Users List Main users listing page with all registered users and their roles

User Edit User editing modal for updating user information and permissions

User Features

πŸ‘€ Profile Management

Profile Settings Main profile page with user information and settings

Profile Details Different section of profile settings

Profile Dropdown User profile dropdown menu from the navigation header

πŸ›’ Customer Orders

My Orders List Customer orders listing page showing personal order history

Order Detail View 1 Detailed view of a specific order (overview section)

Order Detail View 2 Detailed view of a specific order (items section)

πŸ§ͺ Testing

This application uses Cypress for end-to-end testing to ensure all features work correctly across different user scenarios.

Running Tests

# Run tests in headless mode
npm run test:e2e

# Open Cypress Test Runner for development
npm run test:e2e:dev

Test Coverage

  • User authentication (login, logout, registration)
  • Product management (CRUD operations)
  • Order processing and management
  • User management and role-based access
  • Analytics dashboard functionality
  • UI component responsiveness

TestCoverage

πŸ”’ Security Features

  • JWT Authentication: Secure token-based authentication
  • Password Hashing: bcrypt.js for secure password storage
  • Rate Limiting: Prevent API abuse
  • CORS Configuration: Cross-origin request management
  • Input Validation: Server-side validation with Joi
  • SQL Injection Prevention: Prisma ORM protection
  • Security Headers: Helmet.js middleware

🌐 API Endpoints

Authentication

  • POST /api/auth/login - User login
  • POST /api/auth/register - User registration
  • POST /api/auth/logout - User logout

Products

  • GET /api/products - Get all products
  • POST /api/products - Create new product
  • PUT /api/products/:id - Update product
  • DELETE /api/products/:id - Delete product

Orders

  • GET /api/orders - Get all orders
  • POST /api/orders - Create new order
  • PUT /api/orders/:id - Update order status
  • GET /api/orders/user/:userId - Get user orders

Users

  • GET /api/users - Get all users (Admin only)
  • POST /api/users - Create new user
  • PUT /api/users/:id - Update user
  • DELETE /api/users/:id - Delete user

Analytics

  • GET /api/analytics/revenue - Revenue analytics
  • GET /api/analytics/categories - Category performance
  • GET /api/analytics/orders - Order statistics

Acknowledgement

Thank you for reading this far!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors