ITR-6 Filing System Documentation

Version 1.0.0

Comprehensive documentation for the ITR-6 Filing Automation System

Overview

The ITR-6 Filing Automation System is a comprehensive Django-based application designed to streamline the process of filing Income Tax Returns for companies in India. The system provides automated form generation, validation, and submission capabilities.

Key Features

  • Automated ITR-6 form generation from company data
  • Multi-level validation (field, section, cross-section, form)
  • Progressive form completion with auto-save
  • Document management and OCR integration
  • Role-based access control
  • Comprehensive audit trail
  • Multi-tenant architecture for CA firms

Technology Stack

  • Backend: Django 5.2.4, Python
  • Database: PostgreSQL with JSONB support
  • Cache: Redis for sessions and form data
  • Frontend: Django Templates, Tailwind CSS, jQuery + HTMX
  • Storage: AWS S3 for documents
  • Queue: Celery with Redis backend

Getting Started

Prerequisites

  • Python 3.9+
  • PostgreSQL 12+
  • Redis 6+
  • Node.js 16+ (for frontend build tools)

Installation

# Clone the repository
git clone https://github.com/your-org/aaykar.git
cd aaykar

# 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 configuration

# Run migrations
python manage.py migrate

# Create superuser
python manage.py createsuperuser

# Start development server
python manage.py runserver

Quick Start

  1. Access the application at http://localhost:8000
  2. Log in with your superuser credentials
  3. Navigate to Companies section to add your first company
  4. Create an ITR-6 form for the company
  5. Fill out the form sections progressively
  6. Generate and download the ITR-6 JSON file

Architecture

System Components

  • Web Application: Django MVT architecture
  • Database Layer: PostgreSQL with structured and JSONB storage
  • Cache Layer: Redis for sessions and form data
  • Storage Layer: AWS S3 for document storage
  • Queue System: Celery for async task processing

Data Model

The system uses a hybrid storage approach combining structured tables for core entities (Users, Companies, ITR Forms) with JSONB storage for flexible form sections.

Security Architecture

  • Session-based authentication with CSRF protection
  • Role-based access control (RBAC)
  • AES-256 encryption for sensitive data
  • TLS 1.3 for data in transit
  • Comprehensive audit logging

API Reference

REST Endpoints

Company Management

GET    /api/companies/          # List companies
POST   /api/companies/          # Create company
GET    /api/companies/{id}/     # Get company details
PUT    /api/companies/{id}/     # Update company
DELETE /api/companies/{id}/     # Delete company

ITR Form Management

GET    /api/forms/             # List ITR forms
POST   /api/forms/             # Create ITR form
GET    /api/forms/{id}/        # Get form details
PUT    /api/forms/{id}/        # Update form
DELETE /api/forms/{id}/        # Delete form

Section Management

GET    /api/sections/{form_id}/           # List form sections
GET    /api/sections/{form_id}/{section}/ # Get section data
POST   /api/sections/{form_id}/{section}/ # Save section data
PUT    /api/sections/{form_id}/{section}/ # Update section data

User Guide

Creating a Company

  1. Navigate to the Companies section
  2. Click "Add New Company"
  3. Fill in company details including PAN, name, and address
  4. Save the company profile

Creating an ITR-6 Form

  1. Select a company from your company list
  2. Click "Create ITR Form"
  3. Select the assessment year
  4. Choose the form type (ITR-6)
  5. Start filling sections progressively

Form Sections

ITR-6 forms contain over 50 schedules including:

  • Schedule BI: Business Income
  • Schedule CG: Capital Gains
  • Schedule 80G: Donations
  • Schedule SI: Speculative Income
  • And many more...

Development

Common Commands

# Run development server
python manage.py runserver

# Create migrations
python manage.py makemigrations

# Apply migrations
python manage.py migrate

# Run tests
python manage.py test

# Create superuser
python manage.py createsuperuser

# Collect static files
python manage.py collectstatic

Database Management

# Reset database (caution: destroys data)
python manage.py flush

# Load sample data
python manage.py loaddata sample_data.json

# Create database backup
pg_dump aaykar_db > backup.sql

Redis Commands

# Start Redis server
redis-server

# Check Redis connection
redis-cli ping

# Monitor Redis operations
redis-cli monitor

# View cache keys
redis-cli keys "*"

Deployment

Production Setup

# Install dependencies
pip install -r requirements/production.txt

# Set environment variables
export DJANGO_SETTINGS_MODULE=aaykar.settings.production
export SECRET_KEY="your-secret-key"
export DATABASE_URL="postgresql://user:pass@host:port/dbname"
export REDIS_URL="redis://host:port/0"

# Run migrations
python manage.py migrate

# Collect static files
python manage.py collectstatic --noinput

# Start server with Gunicorn
gunicorn aaykar.wsgi:application --bind 0.0.0.0:8000

Docker Deployment

# Build Docker image
docker build -t aaykar .

# Run with Docker Compose
docker-compose up -d

# View logs
docker-compose logs -f

Security

Security Features

  • HTTPS-only in production
  • CSRF protection on all forms
  • Session-based authentication
  • Role-based access control
  • Input validation and sanitization
  • SQL injection protection via ORM
  • XSS protection via template escaping

Data Protection

  • AES-256 encryption for sensitive fields
  • Encrypted database connections
  • Secure file uploads with validation
  • Audit trail for all data modifications

Troubleshooting

Common Issues

Database Connection Issues

# Check database connection
python manage.py dbshell

# Verify database settings in settings.py
# Ensure PostgreSQL service is running

Redis Connection Issues

# Test Redis connection
redis-cli ping

# Check Redis process
ps aux | grep redis

# Restart Redis service
sudo systemctl restart redis

Static Files Not Loading

# Collect static files
python manage.py collectstatic

# Check STATIC_URL and STATIC_ROOT settings
# Ensure web server is configured to serve static files

Health Checks

  • GET /health/ - Overall system health
  • GET /health/redis/ - Redis connectivity
  • Check Django admin for database connectivity

For additional support, please contact the development team.

Last updated: 1.0.0 - March 05, 2026