Projects

CRA-UNES | Academic Control & Reporting System

in_development

Overview

The CRA (Control y Reporte Académico) is a comprehensive digital platform designed for UNES (Universidad Nacional Experimental de la Seguridad) to modernize academic and disciplinary management. It replaces manual paper trails with a robust digital workflow for attendance tracking, incident reporting, and military-style rank administration for students and officers.

Key Features:

  • Role-Based Portals: Dedicated dashboards for Students, Delegates, Staff, and Administrators.

  • Attendance & Justifications: Digital check-ins with support for absence justifications (file uploads) and staff approval workflows.

  • Disciplinary Processes: End-to-end case management (Open → Investigating → Closed/Acquitted) with evidence attachments and sanction appeals.

  • Records Management: Student files, classroom assignments, and rank management with procedurally-rendered police insignia.

  • Security: Account lockouts, forced password rotation, comprehensive audit logs, and session caching.



Built With

This project leverages a fully serverless architecture running on Cloudflare's edge network.

  • Frontend: Next.js 16 (App Router), React 19, TypeScript 5.9, Tailwind CSS 4.

  • Backend: Next.js API routes running on Cloudflare Workers via OpenNext.

  • Database: Cloudflare D1 (SQLite) with Kysely for type-safe queries and versioned migrations.

  • Storage: Cloudflare R2 (6 buckets) for student files, evidence, appeals, and profile pictures with signed URLs.

  • Cache/State: Cloudflare KV for session caching and rate limiting.

  • Auth & Security: better-auth (username plugin), Resend for emails, and native Workers rate limiting.



How It Works

1. Authentication & Authorization:
- Users log in via a custom edge middleware that validates credentials against the D1 database.
- Role-based access controls (RBAC) restrict dashboard access and API endpoints.
- Security measures include automatic lockouts after failed attempts and forced password resets for temporary credentials.

2. Data Flow:
- UI: The Next.js frontend sends requests to API routes hosted on Cloudflare Workers.
- Persistence: Workers interact directly with D1 (SQL) for relational data (students, processes, ranks) and R2 for file storage.
- State Management: KV stores session snapshots to ensure consistency across edge locations.

3. Disciplinary Lifecycle:
- A staff member registers an incident, linking students and evidence files.
- Statuses progress through a defined workflow. Involved parties can submit appeals via the system.
- The timeline is recorded in the database for auditing.

4. Attendance Logic:
- Students mark attendance. Staff can approve/reject justifications.
- Automatic expiry of temporary permissions is handled by a scheduled cron endpoint.

Next.jsReactTypeScriptTailwind CSSCloudflare

Collaborators

Jean SerranoLead Developer
Carlos LopezProject Manager