Skip to content

LavanuruRohithRoy/finance-system

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

5 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ’ฐ Finance Dashboard Architecture

A production-ready financial management system built on strict Role-Based Access Control constraints.

Django DRF PostgreSQL React Vite Docker


๐Ÿ“– System Overview

Architected explicitly around a strict Role-Based Access Control (RBAC) core, this application securely manages financial data entries using a completely decoupled matrix architecture.

The Backend Integration is orchestrated natively via Django REST Framework (DRF). Instead of processing expensive calculations in Python memory loops, it executes highly optimized PostgreSQL native Database Aggregations (TruncMonth, Sum QuerySets) strictly mapping API data structures over REST.

The Frontend Visualization is built securely on React & Vite. It totally rejects bloated component frameworks and is instead mapped natively utilizing optimized Vanilla CSS Variables engineering dynamic glass-morphic UI styling.


๐Ÿ› ๏ธ Technical Architecture Breakdown

This application implements a completely decoupled environment, separating core data logic from interface rendering naturally.

1. Backend REST API (BE)

  • Core Frameworks: Django 5.0 + Django REST Framework (DRF) + Python 3.12
  • Functionality: Rejects monolithic server templates, operating exclusively as a stateless JSON architecture. It securely coordinates deep structural validations and enforces server side API throttling directly explicitly blocking data overloads.
  • Authorization Scopes: Access controls operate strictly over custom BasePermission object structures explicitly routing or rejecting GET/POST/DELETE verbs depending precisely on the requesting account role.

2. Frontend Visual Interface (FE)

  • Core Frameworks: React 18 + Vite SPA Build Toolkit
  • Interface Structure: Utilizes pure Native Vanilla CSS tracking variables explicitly rejecting bloated external libraries (Tailwind/MUI). Provides lightning fast state renders utilizing responsive Glassmorphic patterns specifically.
  • Network Client: Executes fully decoupled API connections mapping specifically over isolated Axios network interceptors seamlessly.

3. Deep Data Persistence (DB)

  • Relational Storage: PostgreSQL 15 securely mapped locally to Docker Volumes.
  • Query Optimization Focus: Deep dashboard math (Category Sums, Monthly Aggregations) physically compute efficiently within the Postgres Nodes leveraging Django ORM (TruncMonth, Sum) directly blocking python memory loop faults entirely explicitly mapping structural speed mathematically.

4. Zero-Trust Security (JWT)

  • Strategy Architecture: JSON Web Tokens mapping short-lived Access credentials gracefully.
  • Integrations: Secured natively integrating django-cors-headers tightly filtering explicit Allowed Origins resolving port mismatches dynamically efficiently.

โœ“ Evaluation Criteria Fulfillment

1. User & Role Management

  • Extends Django's AbstractUser dynamically providing string-bound configurations (viewer, analyst, admin).
  • Security privileges are evaluated both server-side over distinct DRF BasePermission logic scopes, and client-side via React Context API routers rendering boundaries effectively.

2. Financial Records Management

  • Built secure Django viewsets supporting CRUD integrations natively.
  • Frontend components explicitly capture inputs injecting safely into the DRF layer formatting dates and parameters perfectly.
  • Soft Delete constraint naturally enforced: Deleting rows physically flips is_deleted = True, hiding records intelligently preventing accidental data-loss globally.

3. Dashboard Summary APIs

  • /api/finances/records/summary/: Executes strict Database logic fetching the user payload (Net Income, Recent Transactions, Categories) instantly via a single decoupled network request natively avoiding sequential slow queries.

4. Validation & Error Exceptions

  • Application-wide UI Alert blocks! Submitting empty fields cleanly catches 400 Bad Request Native Django validation errors and safely renders them via frontend DOM notifications safely bypassing white-screen crashes natively.
  • Navigation Routing guards aggressively parse 403/401 HTTP blockers seamlessly pushing users back globally to authentication prompts.

5. Advanced Enhancements

  • Fully paginated native tables supporting debounced string Regex DB filtering cleanly natively.
  • JWT Access architectures entirely intercepting standard components cleanly.
  • Strict Automated Swagger interface visualizations natively hooked safely onto API configurations.

๐Ÿš€ Setup & Execution Guide

The entire framework operates fully containerized avoiding local python bindings requirements completely.

1. Initialization

In your project command terminal space globally execute:

docker-compose up --build

This dynamically orchestrates:

  • The PostgreSQL db container on port 5432.
  • The Django web backend running on localhost:8000.
  • The React frontend Vite server mounted natively onto localhost:5173.

2. Administrator Pipeline

Construct your master administrator credentials running essentially directly against the container:

docker-compose exec web python manage.py createsuperuser

(Admin accounts natively pass unrestricted access inside both the UI Interface mutation states and API blocks.)

3. Generating the Mock User Roles

To easily validate the custom-built Viewer and Analyst RBAC barriers, execute this exact isolated Python generator in your terminal space:

docker-compose exec web python manage.py shell -c "from django.contrib.auth import get_user_model; User=get_user_model(); User.objects.create_user(username='test_viewer', password='password123', role='viewer'); User.objects.create_user(username='test_analyst', password='password123', role='analyst')"

4. Interfacing the Product

  1. Proceed exactly to http://localhost:5173/.
  2. Login Testing Specifications:
    • test_viewer | password123 -> Restricts Navigation exclusively mapping Dashboard intelligence arrays smoothly.
    • test_analyst | password123 -> Safely expands access viewing tabular database records effectively.
    • YOUR ADMIN ACCOUNT -> Absolute mutation clearance natively rendering Record Create actions physically inside interfaces.

5. Backend Developer Documentation

If operating APIs externally, visual endpoints schemas sit mapping securely globally natively:

  • Open documentation natively via: http://localhost:8000/api/docs/

๐Ÿง  Core System Design Tradeoffs

  • Strict Vanilla Aesthetics Constraint: Rather than relying heavily on bloated frameworks like Chart.js or Tailwind, visualization metrics (e.g., the Expense by Category distribution arrays) map purely via calculated width properties mathematically into native DOM <div> CSS. Thus generating extreme UI rendering speed safely!
  • Database Processing: Data grouping (Aggregate(), Sum(), TruncMonth()) bypasses Python lists entirely physically mapping math logic completely on the Postgres nodes natively guaranteeing structural memory safety scaling extensively into massive queries automatically.

๐Ÿ”ฎ Future Scalability Deployments

  • Install Redis Caching specifically around the global summary/ endpoint logic cleanly eliminating Postgres parsing redundancy naturally.
  • Bind WebSockets specifically connecting API validations pushing state mutations fluidly dynamically avoiding frontend useEffect() polling boundaries permanently.
  • Expand dedicated user workspaces grouping Finance transactions conditionally by isolated Teams globally linking custom Company arrays intuitively natively.

About

A finance dashboard system where different users interact with financial records based on their role

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors