Portal Inventory Management System
A modern, high-performance web application for managing inventory, requests, and approvals. Built with Next.js, Prisma, and PostgreSQL.
Features
- Role-Based Access Control: Differentiate between Users, Approvers, and Super Admins.
- Inventory Tracking: Real-time visibility into available, borrowed, and damaged items.
- Approval Workflow: Multi-step approval process for item requests.
- Activity Logging: Comprehensive audit trails for all actions.
- Enterprise Ready: Packaged for Docker Swarm and high availability environments.
Deployment Options
This application supports both Docker Swarm (for clustered environments) and Regular Docker Compose (for single-server deployments).
Option 1: Docker Swarm (Recommended for Portainer)
If you are using Portainer with Swarm mode:
- Create a new Stack in Portainer.
- Select Repository and connect to your Gitea repository.
- In the Environment variables section, define:
DATABASE_URL:postgresql://USER:PASS@HOST:5432/DB_NAME?schema=publicSESSION_SECRET:your_random_secret_string
- Click Deploy the stack.
Option 2: Regular Docker Compose (Single Server / Zero Config)
If you prefer running it directly on a single VPS without Swarm, this option includes a built-in lightweight PostgreSQL (Alpine) database.
- Clone this repository:
git clone https://git.proit.id/ypratama/portal-inventory.git cd portal-inventory - Simply run the application (the database will configure itself automatically):
docker-compose up -d
(Note: If you want to use your own external database instead of the built-in one, simply delete the postgres-db block from docker-compose.yml before running).
Option 3: Raw Docker Run Command
If you just want to run the image instantly without cloning:
docker run -d --name portal-inventory \
-p 3000:3000 \
-e DATABASE_URL="postgresql://USER:PASS@HOST:5432/DB_NAME?schema=public" \
-e SESSION_SECRET="your_random_secret_string" \
git.proit.id/ypratama/portal-inventory:latest
Initial Setup (Production)
To secure the application, there are no default user credentials provided in the codebase. When deploying for the first time, you must create the initial Super Admin account manually via the database.
Connect to your PostgreSQL database and execute the following SQL command:
INSERT INTO "User" (username, email, password, name, role, "failedLoginAttempts", "updatedAt")
VALUES ('superadmin', 'admin@super', 'your_secure_password', 'Super Admin', 'super_admin', 0, NOW());
After executing the query, you can log in to the web interface using:
- Email:
admin@super - Password:
your_secure_password