Skip to content

shahnawaz-hussaink/Log-Management-System

Repository files navigation

File-Management-System

A secure, reactive document sharing and approval workflow application built using a Go (Echo) backend, an Angular frontend, and a PostgreSQL database.

System Architecture Overview

  • Frontend: Angular 17+ with Tailwind CSS (Light Office Theme & Micro-animations) running on port 4200.
  • Backend: Go 1.26+ (Echo Framework + GORM + JWT Auth) running on port 8080.
  • Database: PostgreSQL (Auto-migrations & Seeding via GORM) running on port 5432.

Database Schema Diagram

Database Schema Diagram

System Architecture Diagram

System Architecture Diagram


1. Database Setup (PostgreSQL)

The application requires a PostgreSQL instance running locally.

Installation

Make sure PostgreSQL is installed and running on your machine:

  • Windows: Verify that the PostgreSQL service (e.g., postgresql-x64-18) is running.

  • Mac/Linux: Install via Homebrew/APT and start the service:

    brew services start postgresql
    # or
    sudo systemctl start postgresql

Creating the Database

  1. Open your terminal or Command Prompt.

  2. Run createdb using the default postgres superuser (enter the database password when prompted):

    createdb -U postgres office_files

    (Note: The default password configured in the app is postgres. If your credentials differ, set the DATABASE_URL environment variable.)


2. Backend Setup (Go)

The backend is built as a modular monolithic API server using the Echo framework and GORM, running on port 8080.

Backend Prerequisites

  • Go 1.26 or higher.

Configuration

By default, the backend connects using the database credentials defined in the .env file located in the backend folder:

DATABASE_URL="host=localhost user=postgres password=postgres dbname=office_files port=5432 sslmode=disable"

To update database credentials, open the backend/.env file and edit the DATABASE_URL parameter directly.

Installation & Run

  1. Navigate to the backend directory:

    cd backend
  2. Start the API monolithic server:

    go run cmd/api/main.go

    The backend API will be available at http://localhost:8080.

Database Reset & Seeding

If you need to reset the database and seed the default SuperAdmin credentials, navigate to the backend folder and run:

go run cmd/seed/main.go

This will clear all tables (except the SuperAdmin user) and seed the default administrator credentials:

  • Email: superadmin@school.edu
  • Password: password

Running Tests

To run backend unit tests:

go test -v ./...

3. Frontend Setup (Angular)

The Angular frontend provides dashboard controls for document actions, tracking logs, and a PDF viewer.

Frontend Prerequisites

  • Node.js v20+ and npm.
  • If Node.js is not on your system path, you can run commands pointing directly to your Node path.

Installation

  1. Navigate to the frontend directory:

    cd frontend
  2. Install the package dependencies:

    npm install

Run

  1. Start the Angular local development server:

    npm start
  2. Open your browser and navigate to http://localhost:4200.

Key Features Implemented

  1. Receipts (Inward Documents) & Files (Noting Sheets):
    • Dual-mode workflow workspace supporting standard inward receipts and official file noting sheets.
  2. Noting Sheet Collaboration (Green & Yellow Notes):
    • Yellow Notes (Drafts): Collaborative, editable draft notes that can be edited by the author or finalized.
    • Green Notes (Official): Permanent, un-editable official notes stamped with electronic signatures.
  3. Point of Contact (PoC) Sibling & Parent Routing:
    • Administrative point-of-contacts can forward files up to parent organizations or across to sibling organizations.
    • Role-based boundaries restrict standard staff visibility to their own organization while admins serve as gateway points of contact.
  4. Document Actions: Approve, Reject, and Send Back for Revision.
  5. Resubmit or Replace:
    • Uploaders can replace a document that was sent back.
    • Alternatively, they can resubmit with comments without modifying the original file.
  6. Workflow Timeline: Complete action tracking shown chronologically on a vertical history timeline.
  7. Document Previews (PDF & DOCX):
    • Embeds an inline browser-native PDF viewer dynamically using DomSanitizer inside the document details page.
    • Embeds a client-side DOCX document viewer using the docx-preview library.
  8. Action Stamp Tokens: Generates and overlays a secure, verifiable transaction token (e.g. SIG-TX-XXXX) automatically when an action (Approve/Reject) is completed.
  9. Separate Admin Panel: A centralized, secure console for school administrators allowing:
    • System stats oversight (users, documents).
    • CRUD management for users and class settings.
    • CRUD management for document categories and workflow rules.
    • School settings adjustments.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages