Skip to content

Antriksh999/SmartStock-AI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

SmartStock AI - Intelligent Inventory Management System

SmartStock AI Next.js TypeScript MongoDB Google Cloud Vercel

SmartStock AI is a revolutionary inventory management application that leverages artificial intelligence to transform traditional stock management. Built with Next.js 15 and TypeScript, this comprehensive solution automates inventory processes through intelligent data extraction and modern web technologies.

🌐 Live Demo

πŸš€ Visit SmartStock AI

Alternative deployment: https://smartstock-95glfz1u4-antriksh-sharmas-projects.vercel.app

Experience the power of AI-driven inventory management in action!

πŸš€ Features

AI-Powered Processing

  • Multi-Format Support: CSV, Excel, PDF, and image files
  • Google Cloud Vision AI: Intelligent text extraction from images
  • Google Vertex AI: Advanced data processing and recognition
  • Smart Column Mapping: Automatic detection of product data fields

Modern User Interface

  • Dark Theme: Professional, modern design
  • Responsive Design: Works seamlessly on desktop and mobile
  • Drag & Drop: Intuitive file upload experience
  • Camera Integration: Direct photo capture for inventory sheets
  • Real-time Charts: Interactive data visualization

Comprehensive Management

  • Stock Inventory: Complete CRUD operations with status tracking
  • Import History: Detailed logging of all data imports
  • User Authentication: Secure JWT-based authentication
  • Dashboard Analytics: Real-time insights and statistics

πŸ› οΈ Tech Stack

  • Frontend: Next.js 15, React 18, TypeScript
  • Styling: Tailwind CSS, shadcn/ui components
  • Backend: Next.js API Routes, Node.js
  • Database: MongoDB Atlas
  • Authentication: JWT (JSON Web Tokens)
  • AI Services: Google Cloud Vision, Google Vertex AI
  • File Processing: CSV Parser, XLSX, PDF Parse
  • Deployment: Vercel (recommended)

πŸ“‹ Prerequisites

  • Node.js 18+
  • npm or yarn
  • MongoDB Atlas account
  • Google Cloud Platform account
  • Git

πŸ”§ Installation

  1. Clone the repository

    git clone https://github.com/antriksh999/smartstock-ai.git
    cd smartstock-ai
  2. Install dependencies

    npm install
  3. Set up environment variables

    cp .env.example .env.local

    Fill in your environment variables:

    # Database
    MONGODB_URI=your_mongodb_connection_string
    
    # Authentication
    JWT_SECRET=your_jwt_secret_key
    
    # Google Cloud
    GOOGLE_APPLICATION_CREDENTIALS=./path-to-service-account.json
    GOOGLE_CLOUD_PROJECT_ID=your_project_id
    GOOGLE_VISION_API_KEY=your_vision_api_key
  4. Set up Google Cloud Services

    • Enable Vision AI and Vertex AI APIs
    • Download service account credentials
    • Place the JSON file in your project root
  5. Run the development server

    npm run dev
  6. Open your browser Navigate to http://localhost:3000

🎯 Usage

  1. Register/Login: Create an account or sign in
  2. Upload Data: Use drag & drop or camera to upload inventory files
  3. AI Processing: Let AI extract and organize your data
  4. Manage Inventory: View and manage your stock items
  5. Track History: Monitor all import activities

πŸ“ Project Structure

smartstock-ai/
β”œβ”€β”€ app/                    # Next.js App Router
β”‚   β”œβ”€β”€ api/               # API routes
β”‚   β”œβ”€β”€ dashboard/         # Dashboard pages
β”‚   β”œβ”€β”€ data-import/       # Import functionality
β”‚   └── page.tsx          # Home page
β”œβ”€β”€ components/            # Reusable UI components
β”œβ”€β”€ lib/                   # Utility functions
β”‚   β”œβ”€β”€ database.ts       # MongoDB operations
β”‚   β”œβ”€β”€ data-processor.ts # AI processing logic
β”‚   └── google-cloud.ts  # Google Cloud integration
β”œβ”€β”€ public/               # Static assets
└── types/               # TypeScript definitions

πŸ”‘ Environment Variables

Variable Description Required
MONGODB_URI MongoDB connection string βœ…
JWT_SECRET JWT secret for authentication βœ…
GOOGLE_APPLICATION_CREDENTIALS Path to Google service account βœ…
GOOGLE_CLOUD_PROJECT_ID Google Cloud project ID βœ…
GOOGLE_VISION_API_KEY Google Vision API key βœ…

πŸš€ Deployment

Vercel (Recommended) βœ…

The application is currently deployed on Vercel. To deploy your own instance:

  1. Fork this repository

  2. Connect to Vercel

    • Go to vercel.com
    • Import your GitHub repository
    • Choose "Next.js" framework
  3. Set environment variables in Vercel Dashboard:

    NEXTAUTH_SECRET=your-nextauth-secret
    NEXTAUTH_URL=https://your-domain.vercel.app
    MONGODB_URI=your-mongodb-connection-string
    JWT_SECRET=your-jwt-secret
    GOOGLE_VISION_API_KEY=your-google-vision-key
    GOOGLE_CLOUD_PROJECT_ID=your-google-project-id
    RESEND_API_KEY=your-resend-key (optional)
    UPLOADTHING_SECRET=your-uploadthing-secret (optional)
    UPLOADTHING_APP_ID=your-uploadthing-app-id (optional)
  4. Deploy

    • Vercel will automatically build and deploy
    • Access your live application!

Manual Deployment

  1. Build the project

    npm run build
  2. Start production server

    npm start

Docker Deployment

# Use the official Node.js image
FROM node:18-alpine

# Set working directory
WORKDIR /app

# Copy package files
COPY package*.json ./

# Install dependencies
RUN npm ci --only=production

# Copy source code
COPY . .

# Build the application
RUN npm run build

# Expose port
EXPOSE 3000

# Start the application
CMD ["npm", "start"]

πŸ“Š Performance & Features

βœ… Successfully Deployed Features

  • Multi-format File Processing: CSV, Excel, PDF, and image support
  • AI-Powered Data Extraction: Google Cloud Vision integration
  • Real-time Dashboard: Interactive charts and analytics
  • Secure Authentication: JWT-based user management
  • Responsive Design: Mobile-first, modern UI
  • Database Integration: MongoDB Atlas with optimized queries
  • Import History: Complete audit trail of all imports
  • Error Handling: Comprehensive error management and logging

🎯 Production Ready

  • Build Status: βœ… Passing
  • TypeScript: βœ… Type-safe codebase
  • ESLint: βœ… Code quality maintained
  • Deployment: βœ… Live on Vercel
  • Database: βœ… MongoDB Atlas connected
  • API Integration: βœ… All services operational

🀝 Contributing

  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

Antriksh Sharma

πŸ™ Acknowledgments


Built with ❀️ using Next.js, TypeScript, and AI

About

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors