Skip to content

Professional accounting application with Django REST API and React TypeScript frontend

License

Notifications You must be signed in to change notification settings

calnet/accountspro

Repository files navigation

AccountsPro - Professional Accounting Application

A modern, full-stack accounting application built with Django REST Framework and React TypeScript, designed with Sage-style professional UI/UX.

AccountsPro Dashboard

πŸš€ Features

Backend (Django REST API)

  • βœ… Double-Entry Bookkeeping - Proper accounting principles with debit/credit validation
  • βœ… Chart of Accounts - Hierarchical account structure with parent-child relationships
  • βœ… Transaction Management - Draft β†’ Pending β†’ Posted β†’ Cancelled workflow
  • βœ… Real-time Balance Calculation - Account balances calculated from posted transactions
  • βœ… JWT Authentication - Secure API access with token refresh
  • βœ… Professional Data Validation - Comprehensive business rule enforcement
  • βœ… PostgreSQL Database - Optimized with proper indexing and relationships

Frontend (React TypeScript)

  • βœ… Sage-Style UI - Professional accounting software interface
  • βœ… Responsive Dashboard - Financial overview with key metrics
  • βœ… Account Management - Create, edit, and organize chart of accounts
  • βœ… Transaction Entry - Intuitive double-entry transaction recording
  • βœ… Financial Reports - Template system for standard accounting reports
  • βœ… Type-Safe API Integration - Full TypeScript coverage with Axios
  • βœ… Modern Component Architecture - Reusable, maintainable React components

πŸ›  Tech Stack

Backend:

  • Django 4.2.7
  • Django REST Framework
  • PostgreSQL
  • JWT Authentication
  • Docker & Docker Compose

Frontend:

  • React 18
  • TypeScript
  • Vite
  • Tailwind CSS
  • Axios
  • Lucide React Icons

πŸ“¦ Installation

Prerequisites

  • Python 3.11+
  • Node.js 18+
  • PostgreSQL 15+ (or Docker)
  • Git

Backend Setup

  1. Clone the repository

    git clone https://github.com/yourusername/accountspro.git
    cd accountspro/backend
  2. Create virtual environment

    python -m venv venv
    source venv/bin/activate  # On Windows: venv\Scripts\activate
  3. Install dependencies

    pip install -r requirements.txt
  4. Database setup

    # Option A: Using Docker
    docker run --name accounts-postgres -e POSTGRES_PASSWORD=postgres -e POSTGRES_DB=accounts_db -p 5432:5432 -d postgres:15
    
    # Option B: Use local PostgreSQL and create database 'accounts_db'
  5. Environment configuration

    cp .env.example .env
    # Edit .env with your database credentials
  6. Run migrations and create sample data

    python manage.py makemigrations
    python manage.py migrate
    python manage.py create_sample_data
  7. Start development server

    python manage.py runserver

Frontend Setup

  1. Navigate to frontend directory

    cd ../frontend
  2. Install dependencies

    npm install
  3. Environment configuration

    cp .env.example .env
    # Configure API URL if needed
  4. Start development server

    npm run dev

Docker Setup (Alternative)

  1. Using Docker Compose

    cd backend
    docker-compose up -d
  2. Run migrations in Docker

    docker-compose exec backend python manage.py migrate
    docker-compose exec backend python manage.py create_sample_data

πŸš€ Usage

  1. Access the application:

  2. Default credentials:

    • Username: admin
    • Password: admin123
  3. Key workflows:

    • Create accounts in the Chart of Accounts
    • Record transactions with proper debit/credit entries
    • View real-time financial dashboard
    • Generate financial reports

πŸ“Š API Documentation

Authentication

# Login
POST /api/auth/login/
{
  "username": "admin",
  "password": "admin123"
}

# Refresh token
POST /api/auth/refresh/
{
  "refresh": "your_refresh_token"
}

Accounts

# List accounts
GET /api/accounts/

# Create account
POST /api/accounts/
{
  "code": "1000",
  "name": "Cash",
  "account_type": "asset",
  "description": "Primary cash account"
}

# Get accounts by type
GET /api/accounts/by_type/

# Get chart summary
GET /api/accounts/chart_summary/

Transactions

# List transactions
GET /api/transactions/

# Create transaction
POST /api/transactions/
{
  "reference": "TXN-001",
  "date": "2025-01-15",
  "description": "Cash sale",
  "total_amount": 1000.00,
  "entries": [
    {
      "account": "1",
      "entry_type": "debit",
      "amount": 1000.00
    },
    {
      "account": "7",
      "entry_type": "credit",
      "amount": 1000.00
    }
  ]
}

# Post transaction
POST /api/transactions/{id}/post_transaction/

# Get dashboard metrics
GET /api/transactions/dashboard_metrics/

πŸ— Project Structure

accountspro/
β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ accounts_project/          # Django project settings
β”‚   β”œβ”€β”€ accounts/                  # Chart of accounts app
β”‚   β”œβ”€β”€ transactions/              # Transaction management app
β”‚   β”œβ”€β”€ users/                     # User management app
β”‚   β”œβ”€β”€ requirements.txt
β”‚   β”œβ”€β”€ docker-compose.yml
β”‚   └── Dockerfile
β”œβ”€β”€ frontend/
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ types/                 # TypeScript type definitions
β”‚   β”‚   β”œβ”€β”€ services/              # API service layer
β”‚   β”‚   β”œβ”€β”€ App.tsx                # Main application component
β”‚   β”‚   └── ...
β”‚   β”œβ”€β”€ package.json
β”‚   β”œβ”€β”€ vite.config.ts
β”‚   └── ...
└── README.md

πŸ§ͺ Testing

Backend Tests

cd backend
python manage.py test

Frontend Tests

cd frontend
npm run test

πŸš€ Deployment

Production Environment Variables

Backend (.env)

SECRET_KEY=your-production-secret-key
DEBUG=False
ALLOWED_HOSTS=yourdomain.com,www.yourdomain.com
DB_NAME=accounts_db_prod
DB_USER=prod_user
DB_PASSWORD=secure_password
DB_HOST=your-db-host
DB_PORT=5432

Frontend (.env.production)

VITE_API_BASE_URL=https://yourdomain.com/api
VITE_APP_NAME=AccountsPro

Docker Production

docker-compose -f docker-compose.prod.yml up -d

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Development Guidelines

  • Follow PEP 8 for Python code
  • Use TypeScript for all frontend code
  • Write tests for new features
  • Update documentation for API changes
  • Follow conventional commit messages

πŸ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

  • Inspired by Sage accounting software design
  • Built with modern web development best practices
  • Community feedback and contributions

πŸ“§ Support

  • Create an issue for bug reports
  • Discussions for feature requests
  • Wiki for additional documentation

AccountsPro - Professional accounting made simple with modern technology.

About

Professional accounting application with Django REST API and React TypeScript frontend

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors