Database Schema Diagram

AccessHub Door Swipe Analytics - Prisma Schema

Executive Summary

AccessHub is a comprehensive security access management and analytics platform designed to give organizations complete visibility and control over physical access to their facilities. The system captures, analyzes, and reports on all badge swipe activities across your organization, enabling security teams to monitor access patterns, detect anomalies, and maintain compliance with security protocols.

Key Business Benefits

Enhanced Security

Real-time monitoring and anomaly detection to identify unauthorized access attempts

Operational Insights

Understand traffic patterns, peak hours, and zone utilization for better resource allocation

Cost Optimization

Identify underutilized access points and optimize security staffing based on traffic data

Incident Response

Rapid alert system with detailed investigation tools for security incidents

Core Data Models

Employee

Individual users with access credentials, including badge info, department assignment, and access level.

Department

Organizational units for grouping employees by team or function.

Zone

Logical security areas within the facility with assigned security levels and capacity limits.

AccessPoint

Physical door readers and entry hardware with status monitoring and zone assignment.

AccessLog

Every badge swipe transaction with timestamp, direction, status, and verification method.

ZoneAccess

Permission mappings between employees and zones with optional expiration dates.

SecurityAlert

Security incidents and anomalies with severity levels, investigation status, and resolution tracking.

AuditLog

Administrative action tracking for compliance, recording all system changes with before/after states.

FloorPlan

Building floor map data with interactive coordinates for visualizing access points.

SystemSetting

Application configuration key-value pairs for customizing system behavior.

Legend

PKPrimary Key
FKForeign Key
UUnique
Required
Optional
Employee

9 fields

Department

5 fields

Zone

7 fields

AccessPoint

7 fields

AccessLog

8 fields

ZoneAccess

7 fields

SecurityAlert

9 fields

AuditLog

7 fields

FloorPlan

6 fields

SystemSetting

4 fields

Relationships
EmployeeDepartment
DepartmentEmployee
AccessPointZone
AccessLogEmployee
AccessLogAccessPoint
ZoneAccessEmployee
ZoneAccessZone
SecurityAlertEmployee
SecurityAlertAccessPoint
SecurityAlertZone
SecurityAlertAccessLog
AuditLogEmployee
Enums
EmployeeStatus
ACTIVE
INACTIVE
SUSPENDED
TERMINATED
SecurityLevel
PUBLIC
STANDARD
RESTRICTED
HIGH_SECURITY
AccessPointType
DOOR
GATE
TURNSTILE
ELEVATOR
PARKING
AccessDirection
ENTRY
EXIT
BIDIRECTIONAL
SwipeDirection
IN
OUT
AccessStatus
GRANTED
DENIED
PENDING
ERROR
VerificationMethod
BADGE_ONLY
BADGE_AND_PIN
BIOMETRIC
MOBILE
AlertType
UNAUTHORIZED
TAILGATING
FORCED_ENTRY
DOOR_HELD
UNUSUAL_HOURS
AlertSeverity
LOW
MEDIUM
HIGH
CRITICAL
AlertStatus
OPEN
ACKNOWLEDGED
INVESTIGATING
RESOLVED
DISMISSED
AuditAction
CREATE
UPDATE
DELETE
LOGIN
LOGOUT
EXPORT