Skip to content

putra4648/erp

Repository files navigation

ERP System

A modern ERP (Enterprise Resource Planning) system built with high-performance technologies, focused on Inventory Management.

🛠 Tech Stack

Backend

  • Language: Go (1.25+)
  • Framework: Fiber v2
  • Database ORM: GORM (PostgreSQL)
  • Authentication/Authorization:
  • Dependency Injection: Dig
  • Logging: Zap
  • Dev Tooling: Air (Live reload)

Frontend


✨ Features

  • Inventory Management:
    • Stock Levels: Real-time monitoring of product quantities across warehouses.
    • Stock Movements: Track inbound, outbound, and internal transfers.
    • Stock Adjustments: Manual inventory corrections with reason tracking.
    • Low Stock Alerts: Intelligent dashboard alerts for replenishment.
  • Master Data Management:
    • Manage Products, Categories, UOMs, Suppliers, and Warehouses.
  • Modern UI/UX:
    • Full-featured Dashboard with quick statistics and recent activity.
    • Responsive design with dark/light mode support.
    • Data-driven components based on @nuxt/ui.
  • RBAC & Security:
    • Secure API routes with OIDC-based middleware.
    • Role-based navigation and action control.

🚀 Getting Started

Prerequisites

Ensure you have the following installed:

🔐 Auth0 Setup

This project uses Auth0 for Authentication. You need to configure an Application and an API:

  1. Regular Web Application:
    • Create a Regular Web Application in Auth0.
    • Allowed Callback URLs: http://localhost:3000/auth/auth0.
    • Allowed Logout URLs: http://localhost:3000.
  2. API:
    • Create an API in Auth0.
    • Identifier (Audience): e.g., http://localhost:8080.

⚙️ Environment Variables

Backend (backend/.env)

AUTH0_CLIENT_ID=your-auth0-client-id
AUTH0_CLIENT_SECRET=your-auth0-client-secret
AUTH0_DOMAIN=your-auth0-domain
AUTH0_AUDIENCE=http://localhost:8080
DB_DSN=host=localhost user=postgres password=password dbname=erp port=5432 sslmode=disable
PORT=8080

Frontend (frontend/.env)

NUXT_OAUTH_AUTH0_CLIENT_ID=your-auth0-client-id
NUXT_OAUTH_AUTH0_CLIENT_SECRET=your-auth0-client-secret
NUXT_OAUTH_AUTH0_DOMAIN=your-auth0-domain
NUXT_OAUTH_AUTH0_AUDIENCE=http://localhost:8080
NUXT_OAUTH_AUTH0_REDIRECT_URL=http://localhost:3000/auth/auth0
NUXT_SESSION_PASSWORD=at-least-32-character-long-password
NUXT_SERVER_URL=http://localhost:8080

Local Development

Backend Setup

  1. Navigate to the backend directory:

    cd backend
  2. Install Go dependencies:

    go mod download
  3. Run with hot reload (using Air):

    go tool air

Frontend Setup

  1. Navigate to the frontend directory:

    cd frontend
  2. Install dependencies:

    pnpm install
  3. Run the development server:

    pnpm dev

🐳 Docker Setup

You can run the entire system using Docker Compose:

  1. Create a .env file in the root directory with the corresponding environment variables.

  2. Run:

    docker-compose up -d --build

📂 Project Structure

.
├── backend/            # Go Backend API (Fiber + GORM)
│   ├── cmd/            # Entry point
│   ├── internal/       # Core business logic (Hexagonal-lite)
│   ├── routes/         # API Route definitions
│   └── configs/        # Middleware, DI, and Auth configs
├── frontend/           # Nuxt 4 Frontend
│   ├── app/            # Vue components, pages, and layouts
│   ├── server/         # Nuxt server utilities
│   └── public/         # Static assets
└── migrations/         # Database migrations

🤝 Contributing

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

About

Simple ERP with few modules

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors