Create a comprehensive student admission management application for IBM i with the following specifications:

Database Design:

Design a student table with the following fields: Student ID (auto-generated primary key), Student Name (varchar 50), Age (integer), Date of Birth (date format), Date of Joining (date format), Standard (varchar 10), Section (varchar 5), Father's Name (varchar 50), Mother's Name (varchar 50), Address (varchar 100), City (varchar 30), Pincode (numeric 7 digits with validation), Contact Details (numeric 10 digits with validation), and Status (char 1 with values A for Active or I for Inactive, default A). Implement proper constraints including NOT NULL for mandatory fields, CHECK constraints for Pincode length and Contact Details length, and appropriate indexing on Student ID and Status fields.

Backend Development in RPGLE:

Develop modular RPGLE programs using embedded SQL for all database operations. Create separate service programs for each CRUD operation: one for inserting new student records with input validation, one for retrieving student records with filtering capabilities, one for updating existing student records with field-level modifications, and one for soft-deleting records by changing Status from A to I instead of physical deletion. Implement proper error handling with SQLSTATE checking, transaction management with COMMIT and ROLLBACK, data validation routines for Pincode and Contact Details format, and logging mechanisms for audit trails. Use modern free-format RPGLE syntax with proper procedure definitions and return codes for success or failure status.

Frontend Development:

Create a responsive web interface using HTML5, CSS3, and Python Flask framework. Design a clean dashboard with navigation menu containing options for Add New Student, View All Students, Search Student, Update Student, and Delete Student. Implement a data entry form with proper input fields matching all database columns, client-side validation using JavaScript for format checking before submission, date picker widgets for DOB and DOJ fields, dropdown menus for Standard and Section, and real-time validation feedback. Create a student listing page with sortable columns, search and filter functionality by name, standard, section, or status, pagination for large datasets, and action buttons for Edit and Delete operations on each row. Design an update form pre-populated with existing student data allowing modifications to all fields except Student ID. Implement a confirmation dialog for delete operations that explains the record will be marked inactive rather than permanently removed.

Python Web Service Layer:

Develop Python Flask application as middleware to handle HTTP requests from the frontend and communicate with RPGLE backend programs. Create RESTful API endpoints for POST /api/students for adding new records, GET /api/students for retrieving all active records, GET /api/students/{id} for retrieving specific student details, PUT /api/students/{id} for updating records, and DELETE /api/students/{id} for soft deletion. Implement connection handling to IBM i using ODBC or XMLSERVICE to call RPGLE programs and execute SQL queries. Add proper request validation, JSON serialization and deserialization, error handling with appropriate HTTP status codes, session management for tracking user actions, and CORS configuration if needed.

Directory Structure:

Organize the application across two locations on IBM i. First, inside library STUADMLIB on QSYS, create the following source physical files to hold all RPGLE source members: STUADMLIB/QRPGLESRC for all RPGLE and SQLRPGLE source code including service program modules and procedures, STUADMLIB/QRPGLEREF for all RPGLE copybook and include files containing shared data structures, constants, and prototypes, STUADMLIB/QSRVSRC for binder source used to create the service program, and STUADMLIB/QBNDSRC for the binding directory definition. Second, on the IFS create the following directory structure under /STUADMAPP as root directory: /STUADMAPP/QSQLSRC for all SQL DDL scripts to create tables, indexes, and authority grants, /STUADMAPP/WEBSRC for all Python Flask application files, /STUADMAPP/WEBSRC/templates for HTML template files, /STUADMAPP/WEBSRC/static/css for CSS stylesheets, /STUADMAPP/WEBSRC/static/js for JavaScript files, /STUADMAPP/LOGS for application and error logs, and /STUADMAPP/CONFIG for configuration files containing database connection parameters and application settings.

Additional Requirements:

Implement comprehensive input validation on both client and server sides to prevent SQL injection and invalid data entry. Add audit logging to track all CRUD operations with timestamp, user identification, and operation type. Create database indexes on frequently queried fields for performance optimization. Implement proper exception handling throughout the application stack with user-friendly error messages displayed on the frontend. Add data export functionality to download student records in CSV or PDF format. Include a statistics dashboard showing total students, active students, inactive students, and students by standard. Ensure the application follows IBM i security best practices with proper authority settings on directories and database objects. Document all RPGLE procedures, Python functions, and API endpoints with inline comments and separate technical documentation. The library STUADMLIB already exists on the IBM i server so do not recreate it. All RPGLE and SQLRPGLE source must be created directly as QSYS source members inside STUADMLIB. All copybook include directives must use QSYS member syntax in the format /copy STUADMLIB/QRPGLEREF,STUDINC and not IFS relative paths. All SQL DDL, Python, HTML, CSS, and JavaScript files must be written to the IFS under /STUADMAPP. Once all source is written compile all RPGLE modules, create the service program and binding directory, run the SQL DDL to create the tables, and verify all objects exist clean in STUADMLIB before finishing.