Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Crime Reporting System

A desktop application built with Java Swing and MySQL for filing and managing crime complaints. Users can register, log in, submit complaints, and track their status. Administrators can view, update, and manage all complaints.

Features

  • User Registration & Login – Secure account creation with hashed passwords (SHA-256)
  • User Dashboard – File new complaints, edit/delete your own complaints, view status
  • Admin Dashboard – View all complaints, edit status/title/description, delete any complaint
  • Role-Based AccessUSER and ADMIN roles control what each user can do

Tech Stack

  • Language: Java (Swing GUI)
  • Build: Apache Ant (NetBeans project)
  • Database: MySQL 8+ with Connector/J

Prerequisites

  • Java 8 or later
  • MySQL 8+
  • MySQL Connector/J JAR (included via NetBeans library reference)

Setup

1. Database

Run the database-schema.sql script to create the database and tables:

mysql -u root -p < database-schema.sql

This creates:

  • crime_reporting_system database
  • users table (id, username, email, password, role, created_at)
  • complaints table (id, user_id, title, description, status, created_at, updated_at)

2. Database Configuration

Edit src/DBConnection.java to match your MySQL credentials:

private static final String DB_URL = "jdbc:mysql://localhost:3306/crime_reporting_system?useSSL=false&serverTimezone=UTC";
private static final String DB_USER = "root";
private static final String DB_PASS = "your_password";

3. Build & Run

Using NetBeans:

  • Open the project folder in NetBeans
  • Ensure the MySQL Connector/J JAR is referenced (check project.properties)
  • Run the project (main class: LoginForm)

Using command line with Ant:

ant clean compile jar
ant run

4. Default Admin

Log in with username admin and password admin123 (or register a new account and update role to ADMIN manually in the database).

Project Structure

├── src/
│   ├── DBConnection.java      – MySQL connection manager
│   ├── User.java              – User model
│   ├── Complaint.java         – Complaint model
│   ├── UserDAO.java           – User data access (register/login with hashing)
│   ├── ComplaintDAO.java      – Complaint CRUD operations
│   ├── LoginForm.java         – Login window (entry point)
│   ├── RegisterForm.java      – Registration window
│   ├── UserDashboard.java     – User complaint management
│   └── AdminDashboard.java    – Admin complaint overview
├── database-schema.sql        – MySQL schema setup
├── build.xml                  – Ant build file
├── manifest.mf                – JAR manifest
└── nbproject/                 – NetBeans project files

Password Security

Passwords are hashed using SHA-256 before storage. The raw password is never persisted or logged.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages