Skip to content

Repository files navigation

ASHMARK - Premium T-Shirt E-Commerce Platform

A modern, full-featured e-commerce platform built with Next.js for selling premium t-shirts. ASHMARK provides a seamless shopping experience with comprehensive features for both customers and administrators.

🌐 Live Demo: https://ashmark.vercel.app/

πŸ’‘ Test Admin Access: Email: testadmin@gmail.com | Password: testadmin1234

Next.js TypeScript Prisma MySQL

✨ Features

Customer Features

  • πŸ›οΈ Product Catalog - Browse products with filtering, search, and category navigation
  • πŸ›’ Shopping Cart - Add items with size and color selection
  • ❀️ Wishlist - Save favorite products for later
  • πŸ’³ Secure Payments - Integrated Razorpay payment gateway
  • πŸ“¦ Order Management - Track orders with real-time status updates
  • ⭐ Product Reviews - Rate and review products
  • 🎟️ Promo Codes - Apply discount codes at checkout
  • πŸ“ Address Management - Save multiple shipping addresses
  • πŸ‘€ User Profile - Manage account settings and preferences
  • πŸ“± Responsive Design - Optimized for all devices

Admin Features

  • πŸ“Š Dashboard - View sales statistics and analytics
  • πŸ“¦ Product Management - Add, edit, and manage products with images
  • πŸ“‹ Order Management - Process and track customer orders
  • πŸ‘₯ User Management - Manage user roles and permissions
  • πŸ“ˆ Sales Reports - Export order data and view statistics

πŸš€ Tech Stack

πŸ“‹ Prerequisites

Before you begin, ensure you have the following installed:

πŸ› οΈ Installation

  1. Clone the repository

    git clone https://github.com/harshsrivastava05/ashmark.git
    cd ashmark
  2. Install dependencies

    npm install
  3. Set up environment variables

    Create a .env file in the root directory and add the following variables:

    # Database (MySQL)
    DATABASE_URL="mysql://user:password@host:port/database"
    
    # NextAuth
    NEXTAUTH_URL="http://localhost:3000"
    NEXTAUTH_SECRET="your-nextauth-secret-key"
    
    # Google OAuth
    GOOGLE_CLIENT_ID="your-google-client-id"
    GOOGLE_CLIENT_SECRET="your-google-client-secret"
    
    # Razorpay
    RAZORPAY_KEY_ID="your-razorpay-key-id"
    RAZORPAY_KEY_SECRET="your-razorpay-key-secret"
    
    # UploadThing
    UPLOADTHING_SECRET="your-uploadthing-secret"
    UPLOADTHING_APP_ID="your-uploadthing-app-id"
  4. Set up the database

    # Generate Prisma Client
    npm run prisma:generate
    
    # Push schema to database
    npm run prisma:push
  5. Seed the database (optional)

    # Seed categories
    node scripts/seed-categories.js
    
    # Seed sample products
    node scripts/seed-sample-products.js
  6. Run the development server

    npm run dev
  7. Open your browser

    Navigate to http://localhost:3000

πŸ§ͺ Test Credentials

For testing the admin features, you can use the following test admin account:

Admin Account:

  • Email: testadmin@gmail.com
  • Password: testadmin1234

⚠️ Note: These are test credentials for development/demo purposes. Make sure to change or disable these credentials in production environments.

πŸ“ Project Structure

ashmark/
β”œβ”€β”€ prisma/
β”‚   └── schema.prisma          # Database schema
β”œβ”€β”€ public/                     # Static assets
β”œβ”€β”€ scripts/                    # Database seeding scripts
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ app/                   # Next.js app router pages
β”‚   β”‚   β”œβ”€β”€ (auth)/           # Authentication pages
β”‚   β”‚   β”œβ”€β”€ admin/            # Admin dashboard pages
β”‚   β”‚   β”œβ”€β”€ api/              # API routes
β”‚   β”‚   └── ...               # Other pages
β”‚   β”œβ”€β”€ components/           # React components
β”‚   β”‚   β”œβ”€β”€ admin/           # Admin components
β”‚   β”‚   β”œβ”€β”€ cart/            # Cart components
β”‚   β”‚   β”œβ”€β”€ checkout/        # Checkout components
β”‚   β”‚   β”œβ”€β”€ layout/          # Layout components
β”‚   β”‚   β”œβ”€β”€ product/         # Product components
β”‚   β”‚   β”œβ”€β”€ profile/         # Profile components
β”‚   β”‚   └── ui/              # UI components
β”‚   β”œβ”€β”€ contexts/            # React contexts
β”‚   β”œβ”€β”€ lib/                 # Utility functions
β”‚   └── types/               # TypeScript types
β”œβ”€β”€ components.json           # shadcn/ui configuration
β”œβ”€β”€ next.config.ts           # Next.js configuration
β”œβ”€β”€ tailwind.config.ts       # Tailwind CSS configuration
└── package.json            # Dependencies

πŸ—„οΈ Database Schema

The application uses Prisma ORM with MySQL. Key models include:

  • User - User accounts and authentication
  • Product - Product catalog with images, sizes, and colors
  • Category - Product categories
  • Order - Customer orders with status tracking
  • CartItem - Shopping cart items
  • WishlistItem - User wishlist
  • Review - Product reviews and ratings
  • Address - User shipping addresses
  • PromoCodeUsage - Promo code tracking

πŸ” Authentication

The application uses NextAuth.js for authentication with:

  • Email/Password authentication
  • Google OAuth - Sign in with Google account
  • Session management
  • Role-based access control (USER, ADMIN)

πŸ’³ Payment Integration

Payment processing is handled through Razorpay:

  • Secure payment gateway
  • Order creation and verification
  • Payment status tracking
  • Support for multiple payment methods

🎨 UI Components

Built with Radix UI and styled with Tailwind CSS:

  • Accessible components
  • Dark mode support (via next-themes)
  • Responsive design
  • Custom animations

πŸ“ Available Scripts

  • npm run dev - Start development server
  • npm run build - Build for production
  • npm run start - Start production server
  • npm run lint - Run ESLint
  • npm run prisma:generate - Generate Prisma Client
  • npm run prisma:push - Push schema changes to database

🚒 Deployment

Vercel (Recommended)

  1. Push your code to GitHub
  2. Import your repository on Vercel
  3. Add environment variables
  4. Deploy

Other Platforms

The application can be deployed on any platform that supports Next.js:

  • AWS
  • Google Cloud Platform
  • DigitalOcean
  • Railway
  • Render

Make sure to:

  • Set up a MySQL database
  • Configure all environment variables
  • Run database migrations
  • Set up UploadThing account for file uploads
  • Configure Google OAuth credentials

🀝 Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the repository
  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

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ‘€ Author

Harsh Srivastava

πŸ™ Acknowledgments

πŸ“ž Support

For support, email support@ashmark.com or open an issue in the repository.


Made with ❀️ by ASHMARK Team

About

A modern, full-featured e-commerce platform built with Next.js for selling premium t-shirts. ASHMARK provides a seamless shopping experience with comprehensive features for both customers and administrators.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages