Introduction
Welcome to Atslegas (ARS)
Atslegas (Access Registry System) is a purpose-built web application designed for Riga State German Grammar School (Rīgas Valsts vācu ģimnāzija). It serves as a centralized platform for managing physical key inventories, user authentication, and access auditing.
Originally developed as a capstone project for the Programming I course, the system provides school administrators and staff with a secure, concurrent environment to track key assignments and system access.
Core Capabilities
The system is structured to handle the daily operations of a large educational institution:
- Key Management: Organize keys by categories, floors, and groups (e.g., "Old Building").
- Role-Based Access Control (RBAC): Distinct interfaces and permissions for
admin,person, anduserroles. - Audit Logging: Automatic tracking of key issuance and returns, including timestamps and user comments.
- Session Security: Server-side session management with configurable timeouts to protect sensitive data.
- Live Dashboard: A visual interface for administrators to monitor key states and recent activities in real-time.
System Architecture
Atslegas is built on a modular Python/Flask backend with a responsive JavaScript frontend.
- Backend: A RESTful API built with Flask Blueprints. It handles business logic, session validation, and database interactions.
- Database: A high-concurrency SQLite backend utilizing Write-Ahead Logging (WAL) and automated retry logic to ensure stability during simultaneous access.
- Frontend: A split interface architecture:
- User Interface: Focused on key availability and personal status.
- Admin Dashboard: Dedicated tools for user management, log editing, and group configuration.
Quick Start for Developers
To get the application running locally for development or school deployment:
1. Environment Setup
Clone the repository and install the required dependencies:
git clone https://github.com/JamesAce60/ARS.git
cd ARS
pip install -r requirements.txt
2. Configuration
Create a .env file in the root directory to store your secret key:
FLASK_SECRET_KEY=your_secure_random_string
3. Launching the Application
Run the main entry point. On the first run, the system will automatically initialize the SQLite database using the provided schema and create a default root user.
python3 main.py
- Default URL:
http://localhost:5000 - Default Credentials:
- Username:
root - Password:
root
- Username:
[!IMPORTANT] Immediately change the default root password upon first login via the Admin Dashboard to ensure system security.
API Overview
For advanced integration, Atslegas exposes a JSON-based API. All requests to the API (except login) require an active session cookie.
Example: Authenticating a session
POST /api/login
Content-Type: application/json
{
"username": "admin_user",
"password": "your_password"
}
Example: Listing Key Groups
GET /api/keyGroup/list
For detailed endpoint documentation, please refer to the API Documentation section.