SwiftCart is a cutting-edge e-commerce platform meticulously designed for home and decor enthusiasts. Discover a carefully curated selection of stylish furniture, decor essentials, and lifestyle products that transform your space into a dream home. With an intuitive user experience, advanced features, and seamless shopping flow, SwiftCart makes furnishing your perfect home effortless and enjoyable.
Experience the future of home decor shopping with our fully-featured e-commerce platform!
SwiftCart represents the next generation of e-commerce platforms, specifically crafted for the home and decor market. Built with modern web technologies and user-centric design principles, it offers a comprehensive shopping experience that rivals industry leaders. From browsing beautiful furniture collections to managing personalized wishlists and secure checkout processes, SwiftCart delivers enterprise-grade functionality with startup agility.
Our platform serves homeowners, interior designers, and decor enthusiasts seeking high-quality products with a seamless digital shopping experience. Whether you're furnishing a new home or adding finishing touches to your space, SwiftCart provides the tools and products you need.
- Extensive Product Catalog: Browse thousands of home and decor products with rich descriptions, specifications, and high-resolution imagery
- Smart Search & Discovery: Powerful search functionality with auto-suggestions and category-based filtering
- Advanced Filtering & Sorting: Multi-dimensional filtering by category, price range, brand, rating, availability, and custom attributes
- Dynamic Product Views: Multiple view modes including grid, list, and detailed comparison views
- Product Recommendations: AI-powered suggestions based on browsing history and preferences
- Wishlist Management: Create and manage multiple wishlists with sharing capabilities
- Shopping Cart: Persistent cart with quantity management, price calculations, and saved items
- User Profiles: Comprehensive user accounts with order history, preferences, and saved addresses
- Review System: Dynamic product reviews and ratings with verified purchase indicators
- Personalized Dashboard: Custom user interface showing recent activity, recommendations, and account status
- Multi-Provider Authentication: Secure login with Google, Facebook, and email/password options via NextAuth.js
- Protected Routes: Role-based access control for user and admin areas
- Session Management: Secure session handling with JWT tokens
- Data Encryption: Encrypted user data and secure password hashing with bcrypt
- Mobile-First Architecture: Optimized for seamless mobile shopping experiences
- Cross-Device Synchronization: Cart and wishlist sync across all devices
- Accessibility Compliance: WCAG 2.1 AA standards for inclusive design
- Progressive Web App: Fast loading with offline capabilities
- Server-Side Rendering: Lightning-fast page loads with Next.js SSR
- Image Optimization: Automatic image compression and responsive delivery
- Caching Strategies: Intelligent caching for optimal performance
- Real-Time Updates: Live inventory and pricing updates
- Framework: Next.js 14 with App Router for optimal performance and SEO
- UI Library: React 18 with modern hooks and concurrent features
- Styling: Tailwind CSS for utility-first, responsive design
- Typography: Custom Google Font (Inter) optimized via
next/font
- State Management: React Hooks and Context API for lightweight state handling
- Server State: TanStack Query for efficient server-state management and caching
- Form Handling: Advanced form validation and submission handling
- Real-Time Data: Live updates for inventory, pricing, and user interactions
- Authentication: NextAuth.js with multiple OAuth providers
- Database: MongoDB with Mongoose ODM for flexible, scalable data storage
- Email Service: Resend API for transactional emails and notifications
- Security: Environment-based configuration with secure API endpoints
- Notifications: React Toastify for elegant user feedback
- Loading States: Sophisticated loading indicators and skeleton screens
- Error Handling: Comprehensive error boundaries and user-friendly error messages
- Analytics: Built-in analytics for tracking user behavior and conversions
- Hosting: Vercel for serverless deployment and edge optimization
- CDN: Global content delivery for fast asset loading
- Monitoring: Performance monitoring and error tracking
- Scalability: Auto-scaling infrastructure for high-traffic periods
Before setting up SwiftCart, ensure you have the following installed:
- Node.js (v18 or higher) - Download here
- MongoDB (local instance or MongoDB Atlas)
- Git - Download here
- npm or yarn package manager
-
Clone the Repository
git clone https://github.com/your-username/swiftcart.git cd swiftcart
-
Install Dependencies
npm install # or yarn install
-
Environment Configuration
Create a
.env.local
file in the root directory and configure the following variables:# Database Configuration # MongoDB connection string for SwiftCart database MONGODB_CONNECTION_STRING=mongodb+srv://[username]:[password]@cluster0.pfan7vt.mongodb.net/swiftcart # NextAuth Configuration # Generate with: openssl rand -base64 32 AUTH_SECRET=your_nextauth_secret_here # Google OAuth Configuration # Get from: https://console.developers.google.com/ AUTH_GOOGLE_ID=your_google_oauth_client_id AUTH_GOOGLE_SECRET=your_google_oauth_client_secret # Facebook OAuth Configuration # Get from: https://developers.facebook.com/ AUTH_FACEBOOK_ID=your_facebook_app_id AUTH_FACEBOOK_SECRET=your_facebook_app_secret # Application URLs # Update for production deployment NEXT_PUBLIC_API_BASE_URL=http://localhost:3000 # Email Service Configuration # Get from: https://resend.com/ RESEND_API_KEY=your_resend_api_key_here
โ ๏ธ Security Warning: Never commit your.env.local
file to version control. Replace all placeholder values with your actual credentials from the respective service providers. -
Start Development Server
npm run dev # or yarn dev
-
Access SwiftCart
Open http://localhost:3000 in your browser to start exploring SwiftCart!
-
Build the Application
npm run build # or yarn build
-
Start Production Server
npm start # or yarn start
-
Deploy to Vercel
# Install Vercel CLI npm i -g vercel # Deploy to production vercel --prod
swiftcart/
โโโ .next/ # Next.js build output and cache
โโโ actions/ # Server actions for data mutations
โ โโโ auth.js # Authentication actions
โ โโโ products.js # Product management actions
โ โโโ cart.js # Cart operations
โ โโโ orders.js # Order processing actions
โโโ app/ # Next.js 14 App Router directory
โ โโโ (auth)/ # Authentication group routes
โ โ โโโ login/ # User login page
โ โ โโโ register/ # User registration page
โ โโโ (main)/ # Main application group routes
โ โ โโโ about/ # About page
โ โ โโโ contact/ # Contact page
โ โ โโโ products/ # Product listing and details
โ โ โ โโโ [id]/ # Dynamic product detail pages
โ โ โ โโโ page.js # Product listing page
โ โ โโโ category/ # Category-specific pages
โ โ โโโ [slug]/ # Dynamic category pages
โ โโโ api/ # API routes for backend functionality
โ โ โโโ auth/ # Authentication endpoints
โ โ โโโ products/ # Product CRUD operations
โ โ โโโ users/ # User management APIs
โ โ โโโ orders/ # Order processing APIs
โ โ โโโ cart/ # Shopping cart APIs
โ โ โโโ reviews/ # Product review APIs
โ โโโ dashboard/ # Admin dashboard pages
โ โ โโโ analytics/ # Analytics and reports
โ โ โโโ products/ # Product management interface
โ โ โโโ orders/ # Order management system
โ โ โโโ users/ # User management panel
โ โ โโโ settings/ # Admin settings
โ โโโ user-dashboard/ # User account management
โ โ โโโ profile/ # User profile settings
โ โ โโโ orders/ # Order history and tracking
โ โ โโโ wishlist/ # Saved products management
โ โ โโโ cart/ # Shopping cart interface
โ โ โโโ addresses/ # Shipping address management
โ โโโ fonts/ # Custom font files
โ โโโ terms-conditions/ # Legal pages and policies
โ โโโ ClientLayout.jsx # Client-side layout wrapper
โ โโโ favicon.ico # Application favicon
โ โโโ globals.css # Global CSS styles and Tailwind
โ โโโ layout.js # Root layout component
โ โโโ not-found.jsx # Custom 404 error page
โ โโโ page.js # Homepage component
โโโ components/ # Reusable UI components library
โ โโโ ui/ # Basic UI building blocks
โ โ โโโ Button.jsx # Reusable button component
โ โ โโโ Card.jsx # Card layouts
โ โ โโโ Modal.jsx # Modal dialogs
โ โ โโโ Input.jsx # Form input components
โ โโโ forms/ # Form-specific components
โ โ โโโ LoginForm.jsx # User login form
โ โ โโโ CheckoutForm.jsx # Checkout process form
โ โ โโโ ReviewForm.jsx # Product review form
โ โโโ navigation/ # Navigation components
โ โ โโโ Header.jsx # Main site header
โ โ โโโ Footer.jsx # Site footer
โ โ โโโ Sidebar.jsx # Navigation sidebar
โ โโโ product/ # Product-related components
โ โ โโโ ProductCard.jsx # Product display card
โ โ โโโ ProductGrid.jsx # Product grid layout
โ โ โโโ ProductFilter.jsx # Filter interface
โ โ โโโ ProductReviews.jsx # Review display
โ โโโ dashboard/ # Dashboard-specific components
โ โโโ AdminNav.jsx # Admin navigation
โ โโโ UserStats.jsx # User statistics
โ โโโ OrderTable.jsx # Order management table
โโโ lib/ # Utility libraries and configurations
โ โโโ auth.js # NextAuth.js configuration
โ โโโ db.js # MongoDB connection setup
โ โโโ utils.js # General utility functions
โ โโโ validators.js # Input validation schemas
โ โโโ constants.js # Application constants
โโโ models/ # MongoDB/Mongoose data models
โ โโโ User.js # User schema and methods
โ โโโ Product.js # Product data model
โ โโโ Order.js # Order management model
โ โโโ Category.js # Product category model
โ โโโ Review.js # Product review model
โ โโโ Cart.js # Shopping cart model
โโโ providers/ # React context providers
โ โโโ AuthProvider.jsx # Authentication context
โ โโโ CartProvider.jsx # Shopping cart state management
โ โโโ ThemeProvider.jsx # Theme and UI preferences
โ โโโ QueryProvider.jsx # TanStack Query configuration
โโโ public/ # Static assets and media
โ โโโ images/ # Product and UI images
โ โ โโโ products/ # Product photography
โ โ โโโ categories/ # Category banners
โ โ โโโ ui/ # UI icons and graphics
โ โโโ icons/ # Favicon and app icons
โ โโโ homepage.png # Homepage hero banner
โโโ service/ # API service layer
โ โโโ auth.js # Authentication API calls
โ โโโ products.js # Product data fetching
โ โโโ orders.js # Order processing services
โ โโโ users.js # User management services
โ โโโ analytics.js # Analytics data services
โโโ utils/ # Utility functions and helpers
โ โโโ formatters.js # Data formatting utilities
โ โโโ constants.js # Application-wide constants
โ โโโ helpers.js # General helper functions
โ โโโ api.js # API utility functions
โโโ .env.local # Local environment variables
โโโ .eslintrc.json # ESLint configuration
โโโ .gitignore # Git ignore rules
โโโ auth.js # NextAuth.js main configuration
โโโ jsconfig.json # JavaScript project configuration
โโโ next.config.mjs # Next.js build configuration
โโโ package.json # Dependencies and scripts
โโโ postcss.config.mjs # PostCSS configuration
โโโ tailwind.config.js # Tailwind CSS configuration
Variable | Description | Example | Where to Get |
---|---|---|---|
MONGODB_CONNECTION_STRING |
MongoDB database connection | mongodb+srv://user:pass@cluster.mongodb.net/swiftcart |
MongoDB Atlas |
AUTH_SECRET |
NextAuth.js encryption secret | your_generated_secret_here |
Generate with openssl rand -base64 32 |
AUTH_GOOGLE_ID |
Google OAuth client ID | your_google_client_id |
Google Console |
AUTH_GOOGLE_SECRET |
Google OAuth client secret | your_google_client_secret |
Google Console |
AUTH_FACEBOOK_ID |
Facebook OAuth app ID | your_facebook_app_id |
Facebook Developers |
AUTH_FACEBOOK_SECRET |
Facebook OAuth app secret | your_facebook_app_secret |
Facebook Developers |
NEXT_PUBLIC_API_BASE_URL |
Application base URL | http://localhost:3000 |
Your domain |
RESEND_API_KEY |
Email service API key | your_resend_api_key |
Resend |
- Visit Google Cloud Console
- Create a new project or select existing one
- Enable Google+ API
- Create OAuth 2.0 credentials
- Add authorized redirect URIs:
http://localhost:3000/api/auth/callback/google
- Visit Facebook Developers
- Create a new app
- Add Facebook Login product
- Configure OAuth redirect URIs
- Copy App ID and App Secret
Script | Description | Usage |
---|---|---|
dev |
Start development server with hot reload | npm run dev |
build |
Create optimized production build | npm run build |
start |
Start production server | npm start |
lint |
Run ESLint for code quality | npm run lint |
lint:fix |
Automatically fix ESLint issues | npm run lint:fix |
analyze |
Analyze bundle size | npm run analyze |
type-check |
Run TypeScript type checking | npm run type-check |
- Primary:
#2563eb
(Blue) - Trust and reliability - Secondary:
#059669
(Green) - Success and growth - Accent:
#dc2626
(Red) - Urgency and attention - Neutral:
#6b7280
(Gray) - Balance and sophistication - Background:
#f8fafc
(Light Gray) - Clean and modern
- Display: 48px - Hero headings
- H1: 36px - Page titles
- H2: 30px - Section headings
- H3: 24px - Subsection titles
- Body: 16px - Main content
- Small: 14px - Supporting text
- Spacing: 8px base unit with consistent margins and padding
- Border Radius: 8px for cards, 6px for buttons, 4px for inputs
- Shadows: Subtle elevation with consistent shadow hierarchy
- Animation: 200ms transitions for micro-interactions
POST /api/auth/signin
- User authenticationPOST /api/auth/signup
- User registrationGET /api/auth/session
- Get current sessionPOST /api/auth/signout
- User logout
GET /api/products
- List all products with paginationGET /api/products/[id]
- Get product detailsGET /api/products/search
- Search productsPOST /api/products
- Create new product (admin)PUT /api/products/[id]
- Update product (admin)DELETE /api/products/[id]
- Delete product (admin)
GET /api/cart
- Get user's cartPOST /api/cart/add
- Add item to cartPUT /api/cart/update
- Update cart item quantityDELETE /api/cart/remove
- Remove item from cartDELETE /api/cart/clear
- Clear entire cart
POST /api/orders
- Create new orderGET /api/orders
- Get user's order historyGET /api/orders/[id]
- Get order detailsPUT /api/orders/[id]/status
- Update order status (admin)
We welcome contributions from developers, designers, and e-commerce enthusiasts! Here's how you can help make SwiftCart even better:
- ๐ Bug Reports: Found an issue? Report it with detailed steps to reproduce
- โจ Feature Requests: Suggest new features or improvements
- ๐ง Code Contributions: Submit bug fixes or new features
- ๐ Documentation: Improve setup guides, API docs, or user manuals
- ๐จ Design: Enhance UI/UX with better designs or accessibility improvements
-
Fork the Repository
git fork https://github.com/your-username/swiftcart.git
-
Create Feature Branch
git checkout -b feature/amazing-new-feature
-
Make Your Changes
- Follow existing code style and conventions
- Add tests for new features
- Update documentation as needed
-
Test Thoroughly
npm run test npm run lint npm run build
-
Commit with Clear Messages
git commit -m "feat: add amazing new feature for better UX"
-
Push and Create PR
git push origin feature/amazing-new-feature
- Code Style: Follow ESLint rules and Prettier formatting
- Testing: Include unit tests for new features
- Documentation: Update README and code comments
- Performance: Ensure changes don't negatively impact performance
- Accessibility: Maintain WCAG 2.1 AA compliance
- Mobile: Test on mobile devices and various screen sizes
- ๐ Advanced Search: Implement Elasticsearch for better search capabilities
- ๐ณ Payment Integration: Add Stripe and PayPal payment processing
- ๐ฑ Mobile App: React Native companion app
- ๐ Internationalization: Multi-language support (Spanish, French, German)
- ๐ Analytics Dashboard: Enhanced admin analytics with charts and insights
- ๐ค AI Recommendations: Machine learning-powered product suggestions
- ๐ฏ Personalization: Dynamic content based on user behavior
- ๐ฆ Inventory Management: Real-time inventory tracking and alerts
- ๐ Shipping Integration: FedEx, UPS, and DHL shipping APIs
- ๐ฌ Live Chat: Customer support chat system
- ๐ Global Expansion: Multi-currency and regional customization
- ๐ช Marketplace: Allow third-party sellers and vendors
- ๐ฑ AR Visualization: Augmented reality for furniture placement
- ๐ Social Commerce: Social media integration and sharing
- ๐ฎ Gamification: Loyalty programs and reward systems
- Core Web Vitals: Excellent ratings across all metrics
- Lighthouse Score: 95+ for Performance, Accessibility, Best Practices, SEO
- Page Load Time: < 2 seconds on 3G networks
- Time to Interactive: < 3 seconds average
- Cumulative Layout Shift: < 0.1 (excellent)
- โก 99.9% Uptime: Reliable hosting on Vercel infrastructure
- ๐ Security: A+ SSL rating and secure authentication
- ๐ฑ Mobile Performance: 90+ mobile Lighthouse score
- โฟ Accessibility: WCAG 2.1 AA compliant
- ๐ Global CDN: Fast loading worldwide
- ๐ Conversion Rate: Optimized checkout flow
- ๐ User Engagement: High session duration and low bounce rate
- ๐ก User Experience: Intuitive navigation and search
- ๐ Return Customers: Strong user retention features
Error: MongoNetworkError: failed to connect to server
Solutions:
- Verify your MongoDB URI in
.env.local
- Check if your IP is whitelisted in MongoDB Atlas
- Ensure your database user has proper permissions
- Test connection with MongoDB Compass
Error: [next-auth][error][SIGNIN_EMAIL_ERROR]
Solutions:
- Verify OAuth credentials in
.env.local
- Check OAuth app configuration in provider dashboards
- Ensure redirect URIs match your domain
- Verify AUTH_SECRET is properly set
Error: Module not found or build failed
Solutions:
- Clear
.next
folder and node_modules - Run
npm install
to reinstall dependencies - Check for Node.js version compatibility
- Verify all environment variables are set
- Enable caching for static assets
- Optimize images using Next.js Image component
- Implement lazy loading for product lists
- Use React.memo for expensive components
- Monitor Core Web Vitals regularly
This project is licensed under the MIT License - see the LICENSE file for complete details.
- โ Commercial Use: Free to use in commercial projects
- โ Modification: Modify and customize as needed
- โ Distribution: Share and distribute freely
- โ Private Use: Use in private and proprietary projects
- โ Liability: No warranty or liability from authors
- โ License Notice: Must include original license and copyright
- Next.js: MIT License
- React: MIT License
- Tailwind CSS: MIT License
- MongoDB: Server Side Public License
- NextAuth.js: ISC License
- Next.js Team for the incredible React framework that powers SwiftCart
- Vercel for seamless deployment and hosting infrastructure
- MongoDB for the flexible and scalable database solution
- Tailwind CSS for the utility-first CSS framework
- NextAuth.js for robust authentication and session management
- Modern E-commerce Platforms for UX/UI best practices
- Home Decor Industry for understanding user needs and market trends
- Accessibility Guidelines for inclusive design principles
- Performance Community for optimization techniques and strategies
- Contributors who have helped improve SwiftCart
- Beta Testers who provided valuable feedback
- Open Source Community for tools and libraries
- Design Systems that inspired our component architecture
- ๐ Documentation: Complete setup and usage guides in this README
- ๐ Bug Reports: GitHub Issues for technical problems
- ๐ก Feature Requests: GitHub Discussions for new ideas
- ๐ง Direct Contact: support@swiftcart.com for urgent inquiries
- ๐ฌ Community Discord: Join our developer community for real-time help
- ๐ Star on GitHub: Show your support by starring the repository
- ๐ด Fork & Contribute: Help improve SwiftCart with your contributions
- ๐ข Share: Spread the word about SwiftCart in your network
- ๐ฑ Follow Updates: Watch the repository for latest features and updates
For businesses requiring custom development, consulting, or enterprise features:
- ๐ข Enterprise Solutions: Custom e-commerce implementations
- ๐ง Custom Development: Tailored features for your business needs
- ๐ Scaling Support: Help with high-traffic deployments
- ๐ Training: Team training for SwiftCart development
- ๐๏ธ Total Files: 150+ organized files and components
- ๐ฆ Dependencies: 25+ carefully selected packages
- ๐จ Components: 50+ reusable UI components
- ๐ API Endpoints: 30+ RESTful API routes
- ๐ฑ Responsive Breakpoints: 5 device size optimizations
- โฟ Accessibility: 100% keyboard navigable
- ๐ SEO Optimized: Meta tags and structured data
- โก Performance: Sub-3s load time guaranteed
Transform Your Space with SwiftCart! ๐กโจ
Where style meets functionality in the world of home decor e-commerce.