Skip to content

Dual-technology accounting application with Grails 2.4.5 backend and CUBA Platform admin interface

Notifications You must be signed in to change notification settings

TorbenMerrald/accounting

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Accounting

A dual-technology accounting application consisting of a Grails 2.4.5 web application and a CUBA Platform 7.2.20 admin interface.

Overview

This system handles accounting operations with support for:

  • Multiple environments (multi-tenant architecture)
  • Multiple currencies
  • Chart of accounts management
  • Financial dimensions
  • Posting management
  • VAT code handling
  • Vendor agreements

Architecture

Main Components

Component Technology Description
Backend Grails 2.4.5 Core accounting logic and REST APIs
Admin CUBA Platform 7.2.20 Modern admin interface (submodule)
Frontend ExtJS 6+ Rich client-side application
Database Microsoft SQL Server Primary data store

Multi-tenant Design

All domain entities use TENANT_ID for data isolation. The Environment domain represents tenant contexts.

REST API Patterns

  • /ext/$controller - RESTful CRUD endpoints (GET/PUT/POST/DELETE)
  • /ext/$controller/action/$customAction - Custom action endpoints
  • /workflow/$controller - Workflow-specific XML processing

Prerequisites

  • Java 8 (JDK 8)
  • Grails 2.4.5 (install via SDKMAN)
  • Gradle 5.6.4 (for CUBA admin)
  • Microsoft SQL Server
  • Docker (optional, for containerized deployment)

Installation

1. Clone the repository

git clone git@bitbucket.org:bpa-solutions-a-s/accounting.git
cd accounting
git submodule update --init --recursive

2. Install Grails via SDKMAN

curl -s "https://get.sdkman.io" | bash
source "$HOME/.sdkman/bin/sdkman-init.sh"
sdk install grails 2.4.5
sdk install java 8.0.302-open

3. Configure the application

Copy the example configuration files:

cp properties/Accounting-config.groovy.example properties/Accounting-config.groovy
cp properties/Accounting-dataSource.groovy.example properties/Accounting-dataSource.groovy

Edit the files to set your database connection and other settings.

Configuration

Configuration Loading Order

  1. System property: accounting.config.file and accounting.datasource.file
  2. Environment variables: ACCOUNTING_CONFIG_FILE and ACCOUNTING_DATASOURCE_FILE
  3. Default Tomcat location: $CATALINA_HOME/conf/accounting-*.groovy

Key Configuration Files

File Purpose
properties/Accounting-config.groovy Application settings, scheduled jobs
properties/Accounting-dataSource.groovy Database connection settings

Development

Grails Commands

# Run development server
grails run-app

# Build WAR file
grails war

# Build production WAR
grails prod war

# Run tests
grails test-app

# Clean and compile
grails clean
grails compile

CUBA Admin Commands

cd accountingadmin/

# Build the application
./gradlew assemble

# Deploy to local Tomcat
./gradlew deploy

# Create/update database
./gradlew createDb
./gradlew updateDb

# Build WAR files
./gradlew buildWar

# Build UberJar for standalone deployment
./gradlew buildUberJar

Testing

Grails Tests

Tests use Spock framework. Test files are in test/unit/ and test/integration/.

# Run all tests
grails test-app

# Run unit tests only
grails test-app unit:

# Run integration tests only
grails test-app integration:

# Run specific test
grails test-app unit: *PostingService*

CUBA Tests

cd accountingadmin/
./gradlew test

Deployment

Docker Deployment

Build and run the Docker image:

# Build production WAR first
grails prod war

# Build CUBA WARs
cd accountingadmin && ./gradlew buildWar && cd ..

# Build Docker image
docker build -t accounting:latest .

# Run container
docker run -d -p 8080:8080 \
  -e SQL_JDBCURL="jdbc:sqlserver://..." \
  -e SQL_USERNAME="..." \
  -e SQL_PASSWORD="..." \
  accounting:latest

Manual Tomcat Deployment

  1. Build the WAR files:

    grails prod war
    cd accountingadmin && ./gradlew buildWar
  2. Deploy to Tomcat:

    • Copy target/Accounting.war to $CATALINA_HOME/webapps/
    • Copy CUBA WARs (app.war, app-core.war) to $CATALINA_HOME/webapps/
    • Copy configuration files to $CATALINA_HOME/conf/

Project Structure

accounting/
├── grails-app/
│   ├── conf/           # Application configuration
│   ├── controllers/    # MVC controllers
│   ├── domain/         # GORM domain models
│   ├── jobs/           # Quartz scheduled jobs
│   ├── migrations/     # Database migrations
│   ├── services/       # Business logic services
│   └── views/          # GSP views
├── web-app/
│   └── static/         # ExtJS frontend application
│       ├── app/
│       │   ├── model/      # Data models
│       │   ├── view/       # UI views
│       │   ├── store/      # Data stores
│       │   └── overrides/  # ExtJS overrides
│       └── build/          # Compiled frontend
├── accountingadmin/    # CUBA admin (git submodule)
│   ├── modules/
│   │   ├── global/     # Shared entities
│   │   ├── core/       # Business logic
│   │   └── web/        # Web interface
│   └── build.gradle
├── properties/         # Configuration files
├── docker-image/       # Docker configuration
└── install4j/          # Windows installer config

Scheduled Jobs

The system includes several Quartz-based scheduled jobs:

Job Purpose
ImportJob General import processing
ImportCOAJob Chart of Accounts import
ImportUsersJob User synchronization
ImportVATCODESJob VAT code import
ExportPostingsJob Posting export processing
CreateSettingsJob Settings synchronization

Jobs are configured in properties/Accounting-config.groovy with cron triggers.

Git Submodules

The accountingadmin/ directory is a Git submodule.

Update submodule to latest

git submodule update --recursive --remote

Commit submodule changes

git status
git commit -a -m "Update accountingadmin submodule"

Security

  • Windows authentication via Waffle integration
  • Keycloak SSO support
  • Multi-tenant data isolation with TENANT_ID

Troubleshooting

Common Issues

Database Connection Errors

  • Verify SQL Server is running
  • Check connection strings in properties/Accounting-dataSource.groovy

Test Configuration

  • Update hardcoded paths in scripts/Events.groovy for your local environment

ExtJS Build Issues

  • Ensure proper build environment for production
  • Check web-app/static/build/ for compiled assets

Java Version

  • Main application requires Java 8
  • Use SDKMAN to manage Java versions

CI/CD

The project uses Bitbucket Pipelines for continuous integration:

  • Parallel builds for Grails and CUBA applications
  • Docker image creation and push to Docker Hub
  • Windows installer generation via Install4j

See bitbucket-pipelines.yml for configuration details.

License

Proprietary - BPA Solutions A/S

About

Dual-technology accounting application with Grails 2.4.5 backend and CUBA Platform admin interface

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •