Skip to content

Repository files navigation

♉ Inventauri v2 – Modern Inventory Management

License: MIT Docker TypeScript Astro Supabase


🚀 Features

  • Multi-tenant Architecture - Support for multiple shops with isolated data
  • Modern Tech Stack - Built with Astro, Supabase, and Prisma
  • Role-Based Access Control - Owner, Manager, and Staff roles with granular permissions
  • Real-time Inventory - Track stock levels across multiple locations
  • Point of Sale - Process sales with an intuitive interface
  • Comprehensive Reporting - Sales, inventory, and performance insights
  • API-First Design - Full-featured REST API for integration

🛠 Tech Stack

  • Frontend: Astro + React + TypeScript
  • UI Components: Shadcn UI + Tailwind CSS
  • Backend: Node.js with Astro API Routes
  • Database: PostgreSQL with Prisma ORM
  • Authentication: Supabase Auth
  • Containerization: Docker + Docker Compose
  • Testing: Vitest + Supertest

🚀 Quick Start

Prerequisites

  • Docker and Docker Compose
  • Node.js 18+
  • Git

Local Development

  1. Clone the repository

    git clone https://github.com/your-username/inventauri-v2.git
    cd inventauri-v2
  2. Set up environment variables

    cp .env.example .env.local

    Update the values in .env.local with your configuration.

  3. Start the development environment

    docker compose up -d
    npm install
    npx prisma migrate dev
    npm run dev
  4. Access the application


📚 Documentation


🏗 Project Structure

├── .github/              # GitHub Actions workflows
├── prisma/               # Database schema and migrations
│   ├── migrations/       # Versioned SQL migrations
│   ├── schema.prisma     # Prisma schema definition
│   └── seed.ts           # Database seeding script
│
├── public/               # Static assets
│   └── images/           # Image assets
│
├── src/
│   ├── components/       # Reusable UI components
│   ├── lib/              # Application logic
│   ├── pages/            # Application routes
│   ├── styles/           # Global styles
│   └── types/            # TypeScript type definitions
│
├── tests/                # Test suites
├── .env.example          # Example environment variables
├── docker-compose.yml    # Docker Compose configuration
├── package.json          # Project dependencies
└── tsconfig.json         # TypeScript configuration

🗃 Data Model

Core Entities

  • Shop, User, Product, ProductVariant, Warehouse, Inventory, Transaction, Order

Multi-tenancy

  • shop_id column for tenant-scoped tables
  • Row-level security for data isolation
  • Users linked to a single shop

🔐 Authentication & Authorization

  • Authentication: Email/password with Supabase Auth

  • Roles:

    • Owner: Full access
    • Manager: Inventory and sales
    • Staff: Basic POS

Environment Variables

  • NEXT_PUBLIC_SUPABASE_URL
  • NEXT_PUBLIC_SUPABASE_ANON_KEY
  • DATABASE_URL
  • JWT_SECRET
  • NODE_ENV

🛠 Development

Available Scripts

npm install          # Install dependencies
npm run dev          # Start development server
npm run build        # Build for production
npm test             # Run tests
npm run test:watch   # Watch mode tests
npm run test:contracts
npm run lint         # Run linter
npm run type-check   # Type checker

Database Management

npm run db:migrate   # Run migrations
npm run db:generate  # Generate Prisma client
npm run db:reset     # Reset database
npm run db:seed      # Seed database

🚀 Deployment

Production

docker compose -f docker-compose.prod.yml build
docker compose -f docker-compose.prod.yml up -d

Development

docker compose up -d
npm run db:migrate
npm run dev

🌟 Features in Development

  • Multi-tenant architecture
  • Role-based access control
  • Product variant management
  • Real-time inventory tracking
  • Offline mode with sync
  • Advanced reporting
  • Barcode scanning
  • Supplier management

📊 API Endpoints

Authentication

  • POST /api/auth/register
  • POST /api/auth/login
  • POST /api/auth/refresh
  • POST /api/auth/logout

Products

  • GET /api/products
  • POST /api/products
  • GET /api/products/:id
  • PUT /api/products/:id
  • DELETE /api/products/:id

Inventory

  • GET /api/inventory
  • POST /api/inventory/inbound
  • POST /api/inventory/adjust
  • GET /api/inventory/history

Sales

  • POST /api/sales
  • GET /api/sales/:id
  • POST /api/sales/:id/refund

🤝 Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Commit your changes
  4. Push to the branch
  5. Open a Pull Request

🙏 Acknowledgments


🤝 Community & Support


📄 License

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


Made with ❤️ by [Your Name] | Website | Twitter

About

Inventauri v2 is a lightweight web-based inventory system for micro-shops, featuring item management, stock tracking and simple sales insights.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages