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.
- Overview
- Key Features
- Technology Stack
- Project Architecture
- Getting Started
- Environment Configuration
- Application Walkthrough
- User Roles & Access Control
- Core Services
- Component Structure
- State Management
- Routing & Navigation
- Development Guidelines
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.
- 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
- 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
- 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
- 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
- React 19.1.1 - UI library
- TypeScript 5.9.3 - Type safety
- Vite (Rolldown) - Build tool and dev server
- React Router DOM 7.9.6 - Client-side routing
- Firebase 12.6.0 - Authentication and user management
- Custom REST API integration for backend services
- 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
- React Context API - Global state (Auth, Cart)
- React Hooks - Local component state
- clsx & tailwind-merge - Conditional class management
- Sonner - Toast notifications
- class-variance-authority - Component variant management
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
- Node.js (v18 or higher recommended)
- npm or yarn package manager
- Firebase project with Authentication enabled
- Backend API server running
-
Clone the repository
cd /Users/mac/Desktop/D.Apps/art-front -
Install dependencies
npm install
-
Configure environment variables
Create a
.envfile 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
-
Start the development server
npm run dev
-
Access the application
Open your browser and navigate to
http://localhost:5173
npm run buildThe production-ready files will be generated in the dist/ directory.
npm run previewThe application uses Vite's environment variable system. All variables must be prefixed with VITE_ to be accessible in the client-side code.
const apiUrl = import.meta.env.VITE_API_BASE_URL;- Write unit tests for utility functions
- Test component rendering and interactions
- Mock API calls in tests
- Test authentication flows
- Test protected route access
- Lazy load routes and heavy components
- Optimize images and assets
- Minimize bundle size
- Use React.memo for expensive components
- Implement pagination for large lists
npm run dev- Runs on
http://localhost:5173 - Hot module replacement enabled
- Source maps for debugging
npm run build- TypeScript compilation
- Vite optimization
- Minification and tree-shaking
- Output to
dist/directory
npm run preview- Test production build locally
- Runs on
http://localhost:4173
- 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