Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
929c05e
feat: attempting to restructure as standard java project
Razdeep Apr 5, 2025
95b7836
refactor: formatted using spotless plugin
Razdeep Apr 5, 2025
2e96ceb
refactor: code refactored, jasper bug fixed
Razdeep Apr 5, 2025
accdd3e
refactor: formatting fixed
Razdeep Apr 5, 2025
413a8f7
refactor: moved model classes to model directory
Razdeep Apr 5, 2025
7da62b6
fix: build gradle made working
Razdeep Apr 6, 2025
c924956
feat: removed all dependency from deprecated jfoenix
Razdeep Apr 6, 2025
35461b8
fix: addbill improved and fxml fixed
Razdeep Apr 6, 2025
d2f7e30
feat: launch pdf functionality added
Razdeep Apr 6, 2025
344035d
feat: ui improved for bill entry, collection and payment
Razdeep Apr 6, 2025
9dab2e7
feat: layout for collection entry improved
Razdeep Apr 6, 2025
ca620d2
fix: layout of collection entry fixed
Razdeep Apr 6, 2025
9a05b6c
fix: bug fixes
Razdeep Apr 6, 2025
ddb8eb1
fix: attempting to fix bugs
Razdeep Apr 6, 2025
e4bbadf
spotless apply
Razdeep May 26, 2025
891a426
fix: improved AddCollection.java
Razdeep May 26, 2025
b670223
fix: improved Add Payment
Razdeep May 26, 2025
4708940
fix: improved View and delete bill, collection
Razdeep May 26, 2025
b70f5a0
fix: unnecessary code removed
Razdeep Jul 16, 2025
29d83ce
refactor: moving repeated code to common class
Razdeep Jul 18, 2025
955c974
repeated code moved to common class
Razdeep Jul 18, 2025
a73e4f7
fix: bug fixed
Razdeep Jul 19, 2025
915333e
feat: commission report functionality removed
Razdeep Jul 19, 2025
054a829
ci: added ci step
Razdeep Jul 19, 2025
e500358
ci: upgraded step
Razdeep Jul 19, 2025
8e6e7b2
ci: upgraded step
Razdeep Jul 19, 2025
99b6b14
refactor: classes improved
Razdeep Jul 19, 2025
8931637
fix: fixed return feed formatting
Razdeep Jul 19, 2025
232ddb9
ci: suppressing spotlessCheck
Razdeep Jul 19, 2025
2fa0bcd
refactor: improved ledger classes
Razdeep Jul 20, 2025
4cd7b92
layout improved
Razdeep Jul 20, 2025
b3313c8
refactor: improved history classes
Razdeep Jul 20, 2025
093fc5d
fix: improved view and delete bill
Razdeep Jul 20, 2025
db2f3c7
fix: ViewAndDeleteCollection improved
Razdeep Jul 20, 2025
f9fba7f
fix: ViewAndDeletePayment improved
Razdeep Jul 20, 2025
a570b28
fix: fixed linting issues
Razdeep Jul 20, 2025
81d0501
refactor: fxml files fixed
Razdeep Jul 26, 2025
550f1be
refactor: improved build.gradle
Razdeep Jul 26, 2025
b2b00da
fix: add collection bug fixed
Razdeep Jul 26, 2025
a2b9288
fix: fixed Add payment
Razdeep Jul 26, 2025
09b474c
fix: fixed reporting
Razdeep Jul 26, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: JavaFX Build (Gradle)

on:
push:
branches: [ main, modern ]
pull_request:
branches: [ main, modern ]

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up JDK
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'

- name: Cache Gradle dependencies
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-

- name: Grant execute permission for Gradle wrapper
run: chmod +x ./gradlew

- name: Build using Gradle
run: ./gradlew clean build --exclude-task spotlessCheck

- name: Upload JAR artifact
uses: actions/upload-artifact@v4
with:
name: javafx-app
path: build/libs/*.jar
8 changes: 5 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
build
.gradle
.idea
build
.gradle
.idea
.pdf
.db
83 changes: 48 additions & 35 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
plugins {
id 'application'
id 'java'
id "org.openjfx.javafxplugin" version "0.0.9"
id "org.openjfx.javafxplugin" version "0.1.0"
id 'com.diffplug.spotless' version '7.0.2'
}

repositories {
mavenCentral()
maven{url "http://jasperreports.sourceforge.net/maven2/"}
maven{url "http://jaspersoft.artifactoryonline.com/jaspersoft/third-party-ce-artifacts/"}
maven{url "http://maven.geomajas.org/"}
}

dependencies {
implementation group: 'org.controlsfx', name: 'controlsfx', version: '8.40.9'
implementation group: 'org.controlsfx', name: 'controlsfx', version: '11.2.2'
implementation group: 'net.sf.jasperreports', name: 'jasperreports', version: '6.1.0'
implementation group: 'com.jfoenix', name: 'jfoenix', version: '9.0.10'
implementation group: 'com.ibm.icu', name: 'icu4j', version: '68.2'
implementation group: 'org.xerial', name: 'sqlite-jdbc', version: '3.34.0'
implementation group: 'org.olap4j', name: 'olap4j', version: '1.2.0'
implementation group: 'com.lowagie', name: 'itext', version: '2.1.7'

implementation("org.openjfx:javafx-controls:17")
implementation("org.openjfx:javafx-base:17")
implementation("org.openjfx:javafx-graphics:17")
implementation("org.openjfx:javafx-fxml:17")

compileOnly 'org.projectlombok:lombok:1.18.20'
annotationProcessor 'org.projectlombok:lombok:1.18.20'

Expand All @@ -28,23 +29,23 @@ dependencies {
}

javafx {
version = "11"
version = "17"
modules = [ 'javafx.controls', 'javafx.fxml', 'javafx.graphics', 'javafx.base' ]
}

sourceSets {
main {
java {
srcDirs = ['src']
}
resources {
srcDirs = ['src']
}
spotless {
java {
lineEndings 'WINDOWS'
target 'src/**/*.java'
eclipse().configFile('spotless.eclipseformat.xml')
removeUnusedImports()
}
}
mainClassName = 'satyamconsignment.ui.login.Launcher'

mainClassName = 'satyamconsignment.Launcher'

application {
mainClassName = 'satyamconsignment.ui.login.Launcher'
mainClassName = mainClassName
}

run {
Expand All @@ -59,32 +60,44 @@ jar {
manifest {
attributes(
'Manifest-Version': 1.0,
'Main-Class': 'satyamconsignment.ui.login.Launcher',
'Main-Class': mainClassName,
"Class-Path": configurations.runtimeClasspath.collect { "lib/" + it.getName() }.join(' ')
)
}
/*
this part is commented because it is unnecessarily creating the fat jar though the actual dependencies are using from the lib directory.
In future, I'll try to create a fat jar without the lib directory.
*/

// from {
// configurations.compile.collect { it.isDirectory() ? zipTree(it) : it }
// configurations.runtimeClasspath.collect { it.isDirectory() ? zipTree(it) : it }
// }
}

def dependency_directory = "${buildDir}/libs/lib/"
def dependencyDirectory = layout.buildDirectory.dir("libs/lib")

tasks.register('copyDatabase', Copy) {
from('example') {
include 'database.db'
}
into "${layout.buildDirectory.get()}/libs"
doLast {
println "Copied database.db to build directory"
}
}

tasks.register('copyRuntimeDeps', Copy) {
from configurations.runtimeClasspath
into "${dependency_directory}"
from(configurations.runtimeClasspath)
into(dependencyDirectory)
doLast {
println "Copied runtime dependencies"
}
}

tasks.register('copyDeps', Copy) {
dependsOn tasks.copyRuntimeDeps
from configurations.compile
into "${dependency_directory}"
from(configurations.compileClasspath)
into(dependencyDirectory)
doLast {
println "Copied compile-time dependencies"
}
}

jar.finalizedBy(copyDeps)
tasks.named('jar') {
dependsOn (
tasks.named('copyDatabase'),
tasks.named('copyDeps'),
tasks.named('copyRuntimeDeps')
)
}
File renamed without changes.
10 changes: 5 additions & 5 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-bin.zip
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.2-bin.zip
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
26 changes: 26 additions & 0 deletions spotless.eclipseformat.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<profiles version="12">
<profile kind="CodeFormatterProfile" name="GoogleStyleWith4Space" version="12">
<!-- INDENTATION -->
<setting id="org.eclipse.jdt.core.formatter.tabulation.char" value="space"/>
<setting id="org.eclipse.jdt.core.formatter.tabulation.size" value="4"/>
<setting id="org.eclipse.jdt.core.formatter.indentation.size" value="4"/>

<!-- WRAPPING & LINE SPLITS -->
<setting id="org.eclipse.jdt.core.formatter.lineSplit" value="100"/>

<!-- BRACES: same as Google -->
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_type_declaration" value="end_of_line"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_method_declaration" value="end_of_line"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration" value="end_of_line"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block" value="end_of_line"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_switch" value="end_of_line"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration" value="end_of_line"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration" value="end_of_line"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_constant" value="end_of_line"/>

<!-- SPACING AFTER COMMAS -->
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_arguments" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameter_list" value="true"/>
</profile>
</profiles>
45 changes: 45 additions & 0 deletions src/main/java/satyamconsignment/Launcher.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
package satyamconsignment;

import java.io.InputStream;
import java.net.URL;
import java.util.logging.Level;
import java.util.logging.Logger;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.image.Image;
import javafx.stage.Stage;
import satyamconsignment.common.Utils;

public class Launcher extends Application {

public static void main(String[] args) {
launch(args);
}

@Override
public void start(Stage stage) {
try {
String mainFxmlPath = "/satyamconsignment/ui/Main/Main.fxml";
URL resource = getClass().getResource(mainFxmlPath);
if (resource == null) {
throw new RuntimeException("Resource not found");
}
Parent root = FXMLLoader.load(resource);
Scene scene = new Scene(root);
stage.setScene(scene);
stage.setMaximized(true);
stage.show();
InputStream resourceAsStream = getClass()
.getResourceAsStream("/satyamconsignment/icons/Icon.png");
if (resourceAsStream != null) {
stage.getIcons().add(new Image(resourceAsStream));
}
stage.setTitle("Satyam Consignment");
} catch (Exception ex) {
Utils.showAlert(ex.toString());
Logger.getLogger(Launcher.class.getName()).log(Level.SEVERE, ex.toString(), ex);
}
}
}
6 changes: 6 additions & 0 deletions src/main/java/satyamconsignment/common/Constants.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package satyamconsignment.common;

public class Constants {
public static final String REPORT_FILE_NAME = "report.pdf";
public static final String DATE_TIME_FORMAT = "dd-MM-yyyy";
}
Original file line number Diff line number Diff line change
@@ -1,38 +1,34 @@
package satyamconsignment.misc;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;


public final class DatabaseHandler {

private static DatabaseHandler databaseHandler = null;
private Connection conn = null;

private DatabaseHandler() {
Rrc rrc = new Rrc();
try {
Class.forName("org.sqlite.JDBC");
conn = DriverManager.getConnection("jdbc:sqlite:database.db");
} catch (ClassNotFoundException | SQLException ex) {
Rrc.showAlert(ex.toString());
Logger.getLogger(DatabaseHandler.class.getName()).log(Level.SEVERE, null, ex);
}

}

public static DatabaseHandler getInstance() {
if (databaseHandler == null) {
databaseHandler = new DatabaseHandler();
}
return databaseHandler;
}

public Connection getConnection() {
return conn;
}

}
package satyamconsignment.common;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;

public final class DatabaseHandler {

private static DatabaseHandler databaseHandler = null;
private Connection conn = null;

private DatabaseHandler() {
try {
Class.forName("org.sqlite.JDBC");
conn = DriverManager.getConnection("jdbc:sqlite:database.db");
} catch (ClassNotFoundException | SQLException ex) {
Utils.showAlert(ex.toString());
Logger.getLogger(DatabaseHandler.class.getName()).log(Level.SEVERE, ex.toString(), ex);
}
}

public static DatabaseHandler getInstance() {
if (databaseHandler == null) {
databaseHandler = new DatabaseHandler();
}
return databaseHandler;
}

public Connection getConnection() {
return conn;
}
}
Loading