The Purchase Order System is a backend solution designed to manage and track the lifecycle of purchase requests.
It provides a robust, normalized database schema to handle various aspects of the purchasing process — from initial requests to logging, item tracking, and technical specifications.
- Framework: AdonisJS (or a similar backend framework)
- Database: PostgreSQL (via Docker Compose, or any relational database)
- ORM / Migrations: Lucid ORM
The system’s core functionality is structured around the following database entities:
- Central table for all purchase orders.
- Captures essential details: requestor info, office, branch, budget clearance, and approval status.
- Related table that details each individual item in a purchase request.
- Fields include: item description, quantity, unit cost, and total cost.
- Allows one purchase request to contain multiple items.
- Stores technical requirements/details related to a purchase request.
- Examples: delivery requirements, warranty info, and other notes.
- Handles all file uploads associated with a purchase request.
- Stores metadata such as filename, storage path, document type, and MIME type.
- Comprehensive audit log table.
- Records significant events (status changes, user actions, remarks).
- Provides a traceable history of all activities.
- Node.js (LTS version)
- Docker + Docker Compose
Clone the repository:
git clone https://github.com/Mowpey/csu_po.git
cd csu_po
Install dependencies:
npm install
- Ensure you have Docker and Docker Compose installed.
- Start PostgreSQL using Docker Compose:
docker-compose up -d
- Update your database configuration in
config/database.ts
with the values from yourdocker-compose.yml
.
Example (default values if using standard setup):connection: { host: 'localhost', port: 5432, user: 'postgres', password: 'postgres', database: 'test_db', }
- Run database migrations:
node ace migrate
Distributed under the MIT License. See LICENSE for more information.