AuditPal is a modern web-based analytics platform designed for internal audit departments in the banking sector. The platform provides real-time transaction monitoring, risk assessment, and interactive data visualization, enabling auditors to identify and respond to potential risks efficiently.
- Real-time transaction monitoring
- Automated risk scoring system
- Interactive data visualization
- Multiple chart types (Bar, Line, Area, Pie)
- Department-wise analytics
- Real-time updates with 5-second polling
- Framework: Next.js 13+ with TypeScript
- Styling: Tailwind CSS
- Components: shadcn/ui
- Charts: Recharts
- State Management: React Hooks
- Framework: Flask (Python)
- Database: PostgreSQL
- ORM: SQLAlchemy
- Python 3.8+
- Node.js 16+
- PostgreSQL
- npm or yarn
# Clone the repository
git clone https://github.com/yourusername/auditpal.git
cd auditpal/backend
# Create and activate virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Setup environment variables
cp .env.example .env
# Edit .env with your database credentials
# Initialize database
python scripts/init_db.py
# Run the server
python run.py# Navigate to frontend directory
cd ../frontend
# Install dependencies
npm install
# Run the development server
npm run devThe application will be available at:
- Frontend: http://localhost:3000
- Backend API: http://localhost:5001
auditpal/
├── backend/
│ ├── app/
│ │ ├── models/
│ │ │ ├── audit_record.py
│ │ │ └── user.py
│ │ ├── routes/
│ │ │ └── main.py
│ │ └── services/
│ │ └── risk_analyzer.py
│ ├── scripts/
│ └── config.py
└── frontend/
├── src/
│ ├── app/
│ ├── components/
│ │ ├── dashboard/
│ │ └── ui/
│ └── lib/
└── package.json
The platform implements a sophisticated risk scoring system based on:
- Transaction amount (40% weight)
- Transaction type (30% weight)
- Department risk level (30% weight)
- Automatic data refresh every 5 seconds
- Interactive charts and visualizations
- Department-wise performance metrics
- Risk level indicators
GET /api/analytics/summaryReturns dashboard analytics including:
- Total transactions
- Risk percentages
- Department statistics
POST /api/transactions
{
"transaction_date": "2024-01-19T10:00:00Z",
"department": "treasury",
"transaction_type": "international",
"amount": 5000.00
}- SQL injection prevention via SQLAlchemy
- Input validation and sanitization
- CORS protection
- Type checking with TypeScript
- Python: Follow PEP 8 guidelines
- TypeScript: ESLint configuration provided
- Pre-commit hooks for code formatting `