Skip to content

Repository files navigation

πŸ“¦ SOSMIT β€” IT Asset Stock Opname System

Docker Compose Go Angular PostgreSQL

SOSMIT (Stock Opname System for IT Assets) is an enterprise-grade digital inventory management platform designed to streamline, track, and verify physical IT asset stock counts across multi-location organizations, branch offices (sites), and head office departments.


πŸ’‘ What is SOSMIT? (Non-Technical Explanation)

In large organizations with multiple offices, keeping track of laptops, desktops, monitors, and specialized IT equipment is a complex challenge. Traditionally, teams used manual paper forms or disconnected Excel spreadsheets to conduct Stock Opname (physical inventory counts). This approach caused lost assets, unverified equipment conditions, missing signatures, and zero real-time visibility.

SOSMIT solves this problem by turning physical asset counting into a simple, digital workflow:

  1. πŸ“± Scan & Verify: Field inspectors visit branch offices or departments and quickly scan asset tags/barcodes or search serial numbers using a phone, tablet, or laptop.
  2. πŸ“Έ Record Asset Health: If a laptop screen is broken, an asset is missing, or a desktop was moved to a new owner, inspectors take a photo, flag the condition, and record loss/repair notes on the spot.
  3. ✍️ Multi-Tier Digital Approvals: Once an opname session is completed, it automatically progresses through an official approval hierarchy:
    • Field Inspector (Submitter) $\rightarrow$ Finishes opname and attaches digital signature.
    • Area Manager $\rightarrow$ Reviews findings, approves asset changes, and adds manager signature.
    • L1 IT Support $\rightarrow$ Performs final verification and seals the opname report.
  4. πŸ“„ Automated BAP PDF Generation: The system automatically generates official Berita Acara Pemeriksaan (BAP) documents embedded with timestamped digital signatures for audit compliance.
  5. πŸ“§ Real-Time Notifications: Instant email alerts keep inspectors, managers, and IT teams informed at every step of the approval process.

✨ Key Features

  • Real-Time Stock Opname: Interactive barcode scanner and instant condition updates (Good, Damaged, Lost).
  • Photo Documentation: Direct image uploads for damaged equipment with automatic file storage.
  • Hierarchical Location Management:
    • Area Mode: Region $\rightarrow$ Site Group $\rightarrow$ Site $\rightarrow$ Sub-Site.
    • Head Office Mode: Region $\rightarrow$ Site Group $\rightarrow$ Head Office $\rightarrow$ Department.
  • Multi-Level Approval Workflow: $$\text{Draft/Active} \longrightarrow \text{Submitted} \longrightarrow \text{Escalated (Manager Approved)} \longrightarrow \text{Verified (L1 Approved)}$$
  • Automated Official BAP PDF: PDF reports generated via server-side rendering with signatures, totals, and change logs.
  • Data Exporting: Export full inventory stock reports in CSV format compatible with Microsoft Excel.
  • Advanced Dashboard & Search: Dynamic search by location, site group, region, department, inspector, date range, or opname status.

πŸ› οΈ System Architecture & Technology Stack

Layer Technology Description
Frontend Angular 19 Single Page Application (SPA), Angular Material, Bootstrap 5, RxJS
Backend Go 1.24 (Gin Framework) High-performance RESTful API, JWT Auth, GORM / SQL
Database PostgreSQL 16 Alpine Relational Database for structured inventory and audit trails
PDF Generation wkhtmltopdf HTML-to-PDF rendering engine for official BAP generation
Notifications SendGrid API HTML email delivery service
Containerization Docker & Docker Compose Multi-stage container builds and container orchestration

πŸš€ How to Run the Application (Containerized with Docker)

Follow these simple step-by-step instructions to get the application running on your local machine.

πŸ“‹ Prerequisites

Before starting, ensure you have the following software installed:

  1. Docker Desktop (Download & run from docker.com)
  2. Node.js (v18 or v20 recommended) & npm (Download from nodejs.org)
  3. Git

πŸƒ Quick Start Guide

Step 1: Clone the Repository

Open your terminal or command prompt and run:

git clone https://github.com/Sam-Gunawan/SOSMIT.git
cd SOSMIT

Step 2: Configure Environment Variables

A default .env file is included in the project root. Verify or adjust the settings in .env:

SENDGRID_API_KEY="SG.your_sendgrid_api_key_here"
SENDER_EMAIL="your_email@example.com"
FRONTEND_URL="http://localhost:4200"
BACKEND_URL="http://localhost:8080"

Step 3: Launch Backend & Database using Docker

Run Docker Compose to build and start the PostgreSQL database and Go backend server:

docker compose up --build -d

πŸ’‘ What does this command do?

  • Starts the PostgreSQL database container on port 5433 (mapped from container port 5432).
  • Builds the Go backend container with wkhtmltopdf installed and exposes port 8080.
  • Creates persistent volumes for database records (db_data) and uploaded asset photos (/app/uploads).

Check that both containers are running cleanly:

docker compose ps

Step 4: Initialize & Seed the Database (First-Time Setup)

If running for the first time, load the database schema and seed dummy data:

  1. Load Database Schema:

    docker exec -i sosmit-db-1 psql -U sosmit_admin -d sosmit_db < backend/internal/seed/init.sql
  2. Seed Initial Data: Run the seeding script using Go from your host machine (or execute seed logic):

    go run backend/internal/seed/seed.go

    (Note: This populates regions, sites, departments, users, cost centers, approval paths, and asset records).

Step 5: Start the Angular Frontend

Open a new terminal window, navigate to the frontend folder, install dependencies, and start the development server:

cd frontend
npm install
npm start

Once compilation completes, open your web browser and navigate to: πŸ‘‰ http://localhost:4200


πŸ”‘ Demo Login Credentials

You can test different user roles using the pre-seeded account credentials below (Default password for all demo accounts is sosmit):

Role Username Position / Department Access / Capabilities
Field Inspector SAM Admin Staff General Affairs Conducts stock opname, uploads photo, submits session
Area Manager DION Area Manager Reviews submitted opname, approves/escalates, signs BAP
L1 Support PRISKA L1 Support (IT Services) Final verification step, approves/verifies, signs final BAP
IT Manager RIO IT Services Manager Full visibility across IT assets and reporting
Finance Manager SHEILA Finance & Accounting Manager Asset valuation view, cost center oversight, CSV export

πŸ“ Repository Directory Structure

SOSMIT/
β”œβ”€β”€ backend/                  # Golang API Server & Core Logic
β”‚   β”œβ”€β”€ cmd/
β”‚   β”‚   └── api/
β”‚   β”‚       └── main.go       # Application entrypoint & Gin routing
β”‚   β”œβ”€β”€ internal/             # Domain logic (auth, asset, opname, report, email)
β”‚   β”‚   β”œβ”€β”€ asset/            # Asset inventory queries and handlers
β”‚   β”‚   β”œβ”€β”€ auth/             # JWT authentication & session guard
β”‚   β”‚   β”œβ”€β”€ opname/           # Stock opname state machine & approvals
β”‚   β”‚   β”œβ”€β”€ report/           # BAP PDF & CSV generation logic
β”‚   β”‚   └── seed/             # Database initialization (init.sql) & CSV seed scripts
β”‚   └── templates/            # HTML templates for BAP PDF and SendGrid emails
β”‚
β”œβ”€β”€ frontend/                 # Angular 19 Web Client
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ app/
β”‚   β”‚   β”‚   β”œβ”€β”€ components/   # Reusable UI components (modals, search bars, cards)
β”‚   β”‚   β”‚   β”œβ”€β”€ guards/       # Route security guards (AuthGuard)
β”‚   β”‚   β”‚   β”œβ”€β”€ pages/        # Dashboard, Opname Workspace, Reports, Login
β”‚   β”‚   β”‚   └── services/     # REST API client services
β”‚   β”‚   └── assets/           # Application graphics, icons, and static assets
β”‚   β”œβ”€β”€ package.json          # Node dependencies
β”‚   └── angular.json          # Angular CLI configuration
β”‚
β”œβ”€β”€ uploads/                  # Mounted directory for asset condition photos
β”œβ”€β”€ .env                      # Environment configurations
β”œβ”€β”€ Dockerfile                # Multi-stage Docker build for Go + wkhtmltopdf
β”œβ”€β”€ docker-compose.yml        # Docker orchestration file for DB and Backend
β”œβ”€β”€ MANUAL_PENGGUNA_SOSMIT.md # Detailed Indonesian User Manual
└── README.md                 # Project Overview & Setup Instructions (This file)

🐳 Useful Docker Commands Cheat Sheet

  • View Container Logs:
    docker compose logs -f backend
  • Stop All Containers:
    docker compose down
  • Stop Containers and Remove Volumes (Fresh Reset):
    docker compose down -v
  • Rebuild Containers without Cache:
    docker compose build --no-cache
    docker compose up -d

❓ Troubleshooting & FAQs

1. Port 5433 or 8080 is already in use

If another application is using port 8080 or 5433 on your machine, edit the port mappings in docker-compose.yml (e.g. change "8080:8080" to "8081:8080").

2. Database Connection Error (connection refused)

Ensure the PostgreSQL container is running (docker compose ps). The backend service automatically retries 3 times to connect to the database on startup.

3. BAP PDF Generation Failing

The backend uses wkhtmltopdf inside the production Docker container. If running the backend locally outside Docker, ensure wkhtmltopdf is installed on your host machine's system PATH.

4. Email Notifications Not Arriving

Verify that SENDGRID_API_KEY and SENDER_EMAIL in .env contain valid SendGrid credentials and that the sender email is verified in SendGrid.


πŸ“„ License & Attribution

Developed for Stock Opname Management System for IT Assets (SOSMIT).
For technical questions or support, contact the IT Support team or refer to MANUAL_PENGGUNA_SOSMIT.md.

About

IT Stock Opname Management Web-App with complex asset fields

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages