Skip to content

cecvl/art-front

Β 
Β 

Repository files navigation

Art Prints Marketplace - Frontend

A modern, full-featured React + TypeScript web application for an art prints marketplace that connects artists, collectors, and print shops. Built with Vite, Firebase Authentication, and a comprehensive role-based access control system.


πŸ“‹ Table of Contents


🎨 Overview

The Art Prints Marketplace is a comprehensive platform that enables:

  • Artists to showcase and manage their artwork portfolios
  • Collectors to discover, customize, and purchase art prints
  • Print Shops to offer printing services and manage orders
  • Seamless integration between all three parties for order fulfillment

The application features a modern, responsive UI with Firebase authentication, role-based access control, shopping cart functionality, and integrated payment processing.


✨ Key Features

For Collectors (General Users)

  • Browse curated artwork collections
  • Customize prints (size, material, framing options)
  • Add items to cart with real-time price calculations
  • Secure checkout process with M-Pesa integration
  • Order tracking and payment status monitoring
  • User profile management

For Artists

  • Dedicated Artist Management Console
  • Upload and manage artwork portfolios
  • Set pricing and availability
  • Track sales and earnings
  • Profile customization with bio and social links
  • Artwork analytics

For Print Shops

  • Print Shop Management Console
  • Configure services (printing, framing, delivery)
  • Set pricing matrices for different materials and sizes
  • Manage shop profile and contact information
  • Order fulfillment workflow

Technical Features

  • Firebase Authentication (Email/Password & Google Sign-In)
  • Role-based access control (artist, printShop, collector)
  • Protected routes with authentication guards
  • Responsive design for all screen sizes
  • Real-time cart management
  • Toast notifications for user feedback
  • Error boundary for graceful error handling

πŸ›  Technology Stack

Core Framework

  • React 19.1.1 - UI library
  • TypeScript 5.9.3 - Type safety
  • Vite (Rolldown) - Build tool and dev server

Routing & Navigation

  • React Router DOM 7.9.6 - Client-side routing

Authentication & Backend

  • Firebase 12.6.0 - Authentication and user management
  • Custom REST API integration for backend services

UI Components & Styling

  • Tailwind CSS 3.4.17 - Utility-first CSS framework
  • Radix UI - Accessible component primitives
  • Lucide React - Icon library
  • Shadcn/ui - Component library built on Radix UI
  • Recharts 3.5.0 - Data visualization for analytics

State Management

  • React Context API - Global state (Auth, Cart)
  • React Hooks - Local component state

Utilities

  • clsx & tailwind-merge - Conditional class management
  • Sonner - Toast notifications
  • class-variance-authority - Component variant management

πŸ“ Project Architecture

art-front/
β”œβ”€β”€ public/                    # Static assets
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ app/                   # App-level configurations
β”‚   β”œβ”€β”€ assets/                # Images, fonts, static files
β”‚   β”œβ”€β”€ components/            # React components
β”‚   β”‚   β”œβ”€β”€ artists/          # Artist-related components
β”‚   β”‚   β”œβ”€β”€ artworks/         # Artwork display components
β”‚   β”‚   β”œβ”€β”€ auth/             # Authentication components
β”‚   β”‚   β”œβ”€β”€ features/         # Feature-specific components
β”‚   β”‚   β”‚   β”œβ”€β”€ cart/        # Cart functionality
β”‚   β”‚   β”‚   β”œβ”€β”€ checkout/    # Checkout flow
β”‚   β”‚   β”‚   β”œβ”€β”€ home/        # Homepage components
β”‚   β”‚   β”‚   └── orders/      # Order management
β”‚   β”‚   β”œβ”€β”€ navigation/       # Header, Footer, Navigation
β”‚   β”‚   β”œβ”€β”€ printshop/        # Print shop components
β”‚   β”‚   └── ui/              # Reusable UI components (Shadcn)
β”‚   β”œβ”€β”€ context/              # React Context providers
β”‚   β”‚   β”œβ”€β”€ AuthContext.tsx  # Authentication state
β”‚   β”‚   └── CartContext.tsx  # Shopping cart state
β”‚   β”œβ”€β”€ hooks/                # Custom React hooks
β”‚   β”œβ”€β”€ lib/                  # Third-party library configs
β”‚   β”‚   └── firebase.ts      # Firebase initialization
β”‚   β”œβ”€β”€ pages/                # Page-level components
β”‚   β”‚   β”œβ”€β”€ Home.tsx
β”‚   β”‚   β”œβ”€β”€ Artists.tsx
β”‚   β”‚   β”œβ”€β”€ Cart.tsx
β”‚   β”‚   β”œβ”€β”€ Checkout.tsx
β”‚   β”‚   β”œβ”€β”€ Orders.tsx
β”‚   β”‚   β”œβ”€β”€ PaymentStatus.tsx
β”‚   β”‚   β”œβ”€β”€ ArtistManagementConsole.tsx
β”‚   β”‚   └── PrintShop.tsx
β”‚   β”œβ”€β”€ services/             # API service layer
β”‚   β”‚   β”œβ”€β”€ artworks.ts
β”‚   β”‚   β”œβ”€β”€ artists.ts
β”‚   β”‚   β”œβ”€β”€ cart.ts
β”‚   β”‚   β”œβ”€β”€ orders.ts
β”‚   β”‚   β”œβ”€β”€ payment.ts
β”‚   β”‚   β”œβ”€β”€ printshop.ts
β”‚   β”‚   └── matching.ts
β”‚   β”œβ”€β”€ styles/               # Global styles and themes
β”‚   β”œβ”€β”€ types/                # TypeScript type definitions
β”‚   β”œβ”€β”€ App.tsx               # Root application component
β”‚   β”œβ”€β”€ main.tsx              # Application entry point
β”‚   └── ErrorBoundary.tsx     # Error handling wrapper
β”œβ”€β”€ .env                       # Environment variables (gitignored)
β”œβ”€β”€ package.json
β”œβ”€β”€ tailwind.config.js
β”œβ”€β”€ tsconfig.json
└── vite.config.ts

πŸš€ Getting Started

Prerequisites

  • Node.js (v18 or higher recommended)
  • npm or yarn package manager
  • Firebase project with Authentication enabled
  • Backend API server running

Installation

  1. Clone the repository

    cd /Users/mac/Desktop/D.Apps/art-front
  2. Install dependencies

    npm install
  3. Configure environment variables

    Create a .env file in the root directory:

    VITE_API_BASE_URL=http://localhost:8080
    VITE_FIREBASE_API_KEY=your_firebase_api_key
    VITE_FIREBASE_AUTH_DOMAIN=your_project.firebaseapp.com
    VITE_FIREBASE_PROJECT_ID=your_project_id
    VITE_FIREBASE_STORAGE_BUCKET=your_project.appspot.com
    VITE_FIREBASE_MESSAGING_SENDER_ID=your_sender_id
    VITE_FIREBASE_APP_ID=your_app_id
  4. Start the development server

    npm run dev
  5. Access the application

    Open your browser and navigate to http://localhost:5173

Build for Production

npm run build

The production-ready files will be generated in the dist/ directory.

Preview Production Build

npm run preview

βš™οΈ Environment Configuration

The application uses Vite's environment variable system. All variables must be prefixed with VITE_ to be accessible in the client-side code.

Accessing Environment Variables

const apiUrl = import.meta.env.VITE_API_BASE_URL;

Testing (Recommended)

  • Write unit tests for utility functions
  • Test component rendering and interactions
  • Mock API calls in tests
  • Test authentication flows
  • Test protected route access

Performance

  • Lazy load routes and heavy components
  • Optimize images and assets
  • Minimize bundle size
  • Use React.memo for expensive components
  • Implement pagination for large lists

πŸ”§ Build & Deployment

Development Build

npm run dev
  • Runs on http://localhost:5173
  • Hot module replacement enabled
  • Source maps for debugging

Production Build

npm run build
  • TypeScript compilation
  • Vite optimization
  • Minification and tree-shaking
  • Output to dist/ directory

Preview Production

npm run preview
  • Test production build locally
  • Runs on http://localhost:4173

Deployment Checklist

  • Update environment variables for production
  • Test all authentication flows
  • Verify API endpoints are correct
  • Test payment integration
  • Check responsive design on all devices
  • Verify role-based access control
  • Test error scenarios
  • Enable HTTPS
  • Configure CORS on backend
  • Set up monitoring and logging

Built with ❀️ using React, TypeScript, and Firebase

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • TypeScript 93.5%
  • CSS 5.8%
  • Other 0.7%