Skip to content

TheRealSaiTama/RetailSyncSaaS

Repository files navigation

RetailSync SaaS

RetailSync Logo

RetailSync is a revolutionary SaaS platform that leverages multi-agent AI technology to optimize retail inventory management. By creating a collaborative ecosystem between stores, warehouses, suppliers, and customers, RetailSync eliminates stockouts, reduces excess inventory, and maximizes profitability through intelligent data synchronization and predictive analytics.

πŸš€ Features

Core Capabilities

  • Multi-Agent AI Architecture: Intelligent agents collaborate across the retail ecosystem
  • Real-time Inventory Synchronization: Seamless data sync between multiple systems
  • Advanced Demand Forecasting: AI-powered predictions to optimize stock levels
  • Google Sheets Integration: Easy data import/export and management
  • Automated Replenishment: Smart ordering suggestions based on historical data
  • Performance Analytics: Comprehensive dashboards and ROI tracking
  • Webhook Support: Real-time notifications and integrations
  • Multi-tenant Architecture: Secure, isolated environments for each client

AI-Powered Insights

  • Stock efficiency optimization (up to 94.3%)
  • Demand pattern recognition
  • Supplier performance analysis
  • Customer behavior prediction
  • Seasonal trend analysis
  • Waste reduction algorithms

πŸ›  Tech Stack

Frontend

  • React 18 with TypeScript
  • Vite for fast development and building
  • Tailwind CSS for styling
  • Shadcn/ui component library
  • React Router for navigation
  • Firebase for authentication and real-time features
  • Google Generative AI for chat functionality

Backend

  • Node.js with Express.js
  • Passport.js for Google OAuth authentication
  • Google APIs (Sheets, Drive) for data integration
  • Express Handlebars for server-side rendering
  • Multer for file uploads
  • Axios for HTTP requests

Infrastructure

  • RESTful API design
  • Session-based authentication
  • Environment-based configuration
  • CORS enabled
  • Webhook endpoints

πŸ“‹ Prerequisites

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

  • Node.js (v18 or higher)
  • npm or bun package manager
  • Google Cloud Console account for API credentials
  • Firebase project for frontend authentication

πŸ”§ Installation

  1. Clone the repository

    git clone https://github.com/SkyRex06/RetailSync_saas.git
    cd RetailSync_saas
  2. Install frontend dependencies

    npm install
    # or
    bun install
  3. Install backend dependencies

    cd backend
    npm install
    cd ..

βš™οΈ Configuration

Environment Variables

  1. Frontend (.env)

    VITE_FIREBASE_API_KEY=your_firebase_api_key
    VITE_FIREBASE_AUTH_DOMAIN=your_firebase_auth_domain
    VITE_FIREBASE_PROJECT_ID=your_firebase_project_id
    VITE_FIREBASE_STORAGE_BUCKET=your_firebase_storage_bucket
    VITE_FIREBASE_MESSAGING_SENDER_ID=your_firebase_messaging_sender_id
    VITE_FIREBASE_APP_ID=your_firebase_app_id
    VITE_FIREBASE_MEASUREMENT_ID=your_firebase_measurement_id
  2. Backend (backend/.env)

    GOOGLE_CLIENT_ID=your_google_client_id
    GOOGLE_CLIENT_SECRET=your_google_client_secret
    GOOGLE_CALLBACK_URL=http://localhost:3000/auth/google/callback
    SESSION_SECRET=your_random_session_secret
    WEBHOOK_TOKEN=your_webhook_token
    PORT=3000

Google Cloud Setup

  1. Go to Google Cloud Console
  2. Create a new project or select existing one
  3. Enable Google Sheets API and Google Drive API
  4. Create OAuth 2.0 credentials
  5. Add authorized redirect URIs:
    • http://localhost:3000/auth/google/callback
  6. Copy Client ID and Client Secret to backend/.env

Firebase Setup

  1. Go to Firebase Console
  2. Create a new project
  3. Enable Authentication and Firestore
  4. Go to Project Settings > General > Your apps
  5. Add a web app and copy the config to frontend/.env

πŸš€ Running the Application

Development Mode

  1. Start the backend server

    cd backend
    npm start
    # or
    node src/server.js

    Backend will run on http://localhost:3000

  2. Start the frontend development server

    npm run dev

    Frontend will run on http://localhost:8080

  3. Access the application

Production Build

  1. Build the frontend

    npm run build
  2. Start production server

    npm run preview

πŸ“‘ API Endpoints

Authentication

  • GET /auth/google - Initiate Google OAuth
  • GET /auth/google/callback - OAuth callback
  • GET /auth/logout - Logout user

Sheets Operations

  • POST /api/sheets/copy - Copy a Google Sheet
  • POST /api/sheets/upload - Upload spreadsheet file
  • GET /api/sheets/list - List user's sheets
  • POST /api/sheets/create - Create new sheet

Webhooks

  • POST /webhook/data - Receive data updates
  • GET /webhook/status - Check webhook status

Static Routes

  • GET / - Main application page

πŸ— Project Structure

RetailSyncSaaS/
β”œβ”€β”€ backend/                    # Node.js backend
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ config/
β”‚   β”‚   β”‚   └── passport-setup.js
β”‚   β”‚   β”œβ”€β”€ controllers/
β”‚   β”‚   β”‚   β”œβ”€β”€ authController.js
β”‚   β”‚   β”‚   β”œβ”€β”€ sheetController.js
β”‚   β”‚   β”‚   └── webhookController.js
β”‚   β”‚   β”œβ”€β”€ routes/
β”‚   β”‚   β”‚   β”œβ”€β”€ apiRoutes.js
β”‚   β”‚   β”‚   β”œβ”€β”€ authRoutes.js
β”‚   β”‚   β”‚   └── webhookRoutes.js
β”‚   β”‚   β”œβ”€β”€ services/
β”‚   β”‚   β”‚   └── googleService.js
β”‚   β”‚   β”œβ”€β”€ views/
β”‚   β”‚   β”‚   └── index.html
β”‚   β”‚   └── server.js
β”‚   β”œβ”€β”€ package.json
β”‚   └── .env
β”œβ”€β”€ src/                        # React frontend
β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”œβ”€β”€ ui/                 # Shadcn/ui components
β”‚   β”‚   β”œβ”€β”€ chat/               # Chat widget
β”‚   β”‚   β”œβ”€β”€ HeroSection.tsx
β”‚   β”‚   β”œβ”€β”€ FeaturesSection.tsx
β”‚   β”‚   └── ...
β”‚   β”œβ”€β”€ pages/
β”‚   β”‚   β”œβ”€β”€ Index.tsx
β”‚   β”‚   β”œβ”€β”€ FeaturesPage.tsx
β”‚   β”‚   β”œβ”€β”€ PricingPage.tsx
β”‚   β”‚   └── ...
β”‚   β”œβ”€β”€ context/
β”‚   β”‚   └── ChatContext.tsx
β”‚   β”œβ”€β”€ data/
β”‚   β”‚   └── pricing.ts
β”‚   β”œβ”€β”€ hooks/
β”‚   β”œβ”€β”€ lib/
β”‚   β”‚   β”œβ”€β”€ firebase.ts
β”‚   β”‚   β”œβ”€β”€ gemini.ts
β”‚   β”‚   └── utils.ts
β”‚   └── main.tsx
β”œβ”€β”€ public/                     # Static assets
β”œβ”€β”€ package.json
β”œβ”€β”€ vite.config.ts
β”œβ”€β”€ tailwind.config.ts
└── .env

πŸ”„ How It Works

  1. User Authentication: Users authenticate via Google OAuth
  2. Data Integration: Connect Google Sheets for inventory data
  3. AI Processing: Multi-agent system analyzes data patterns
  4. Optimization: Generate recommendations for inventory management
  5. Real-time Sync: Automated updates across all connected systems
  6. Reporting: Comprehensive analytics and performance metrics

🀝 Contributing

We welcome contributions! Please follow these steps:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Development Guidelines

  • Follow TypeScript best practices
  • Use ESLint configuration
  • Write meaningful commit messages
  • Test your changes thoroughly
  • Update documentation as needed

πŸ“„ License

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

πŸ“ž Support

For support, email support@retailsync.com or join our Discord community.

πŸ—Ί Roadmap

  • Mobile app development
  • Advanced ML models for forecasting
  • Integration with major POS systems
  • Real-time collaboration features
  • API marketplace for third-party integrations

Built with ❀️ for the retail industry

About

SaaS end for integrated AI system consisting of three agents: a Demand Forecasting Agent, a Category-wise Sales Predictor, and a Profit Estimation Agent.

Resources

Stars

3 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors