Skip to content

JCheney20/ZooInsight

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ZooInsight 🦁

A Java-based zoo management system built with JavaFX and MySQL for managing zoo animals, staff, and operations.

📋 Overview

ZooInsight is a desktop application designed to help zoo administrators and caretakers manage various aspects of zoo operations including:

  • User Management: Create and manage staff accounts (Admins, Caretakers, Owners)
  • Animal Management: Track and manage animal information including species, age, diet, and mood
  • Database Integration: MySQL backend for persistent data storage
  • Role-Based Access: Different user types with appropriate permissions

✨ Features

User Management

  • Create new user accounts with role assignment (Admin, Caretaker, Owner)
  • Store user details: name, email, contact information, date of birth
  • Automatic username and password generation
  • User authentication and login system

Animal Management

  • Register new animals with detailed information
  • Track animal attributes:
    • Name, age, and gender
    • Taxonomic classification (class, family, species)
    • Favorite food preferences
    • Mood tracking and updates
  • View and edit animal records in interactive tables
  • Delete animal records with confirmation

Data Persistence

  • MySQL database integration for reliable data storage
  • File-based backup system (text files)
  • Import/export functionality for user and animal data

🛠️ Technology Stack

  • Language: Java
  • UI Framework: JavaFX
  • Database: MySQL
  • Database Connectivity: JDBC
  • UI Components: Swing (JOptionPane for dialogs)

📦 Prerequisites

  • Java Development Kit (JDK): Version 8 or higher
  • JavaFX: Ensure JavaFX library is properly configured
  • MySQL Server: Version 5.7 or higher
  • MySQL Connector/J: JDBC driver for MySQL

🚀 Installation & Setup

1. Clone the Repository

git clone https://github.com/JCheney20/ZooInsight.git
cd ZooInsight

2. Database Setup

-- Create the database
CREATE DATABASE zooinsight;

-- Use the database
USE zooinsight;

-- Create users table
CREATE TABLE users (
    accnum INT AUTO_INCREMENT PRIMARY KEY,
    firstname VARCHAR(100),
    surname VARCHAR(100),
    email VARCHAR(255),
    usertype VARCHAR(50),
    gender VARCHAR(20),
    cellnumber VARCHAR(20),
    dob VARCHAR(20),
    username VARCHAR(100),
    password VARCHAR(100)
);

-- Create animals table
CREATE TABLE animals (
    animalsid INT AUTO_INCREMENT PRIMARY KEY,
    fname VARCHAR(100),
    age VARCHAR(10),
    gender VARCHAR(20),
    a_class VARCHAR(100),
    family VARCHAR(100),
    species VARCHAR(100),
    favFood VARCHAR(255),
    mood VARCHAR(100)
);

-- Create MySQL user for the application
CREATE USER 'AAdmin'@'localhost' IDENTIFIED BY 'admin123';
GRANT ALL PRIVILEGES ON zooinsight.* TO 'AAdmin'@'localhost';
FLUSH PRIVILEGES;

3. Configure JavaFX

Ensure JavaFX libraries are added to your project build path:

  • Download JavaFX SDK from openjfx.io
  • Add JavaFX library modules to your project
  • Configure VM arguments if needed:
--module-path /path/to/javafx-sdk/lib --add-modules javafx.controls,javafx.fxml

4. Update Database Connection (if needed)

Edit src/utils_DBManager.java if your MySQL credentials differ:

static final String DB_URL = "jdbc:mysql://localhost:3306/zooinsight";
static final String USER = "AAdmin";
static final String PASS = "admin123";

5. Compile and Run

javac -d bin src/*.java
java -cp bin src.App

📁 Project Structure

ZooInsight/
├── src/
│   ├── App.java                    # Main application entry point
│   ├── Page_Login.java             # Login page
│   ├── Page_Home_Admin.java        # Admin dashboard
│   ├── obj_User.java               # User data model
│   ├── obj_Animal.java             # Animal data model
│   ├── utils_DBManager.java        # Database operations
│   ├── utils_CreateNew.java        # User/Animal creation utilities
│   ├── utils_newTabel.java         # Table generation utilities
│   ├── utils_newLabel.java         # Label creation utilities
│   ├── utils_background.java       # Background styling utilities
│   ├── utils_ObjectGen.java        # Interface for data models
│   └── Stylesheets.css             # Application styles
├── resources/
│   └── background.png              # Background image
├── javafx/                         # JavaFX libraries
├── DB/                             # Database scripts
└── DemoVideos/                     # Application demos

🎮 Usage

First Time Login

  1. Launch the application
  2. Use default credentials or create a new admin account
  3. Access the admin dashboard

Managing Users

  1. Click Create to add a new user
  2. Fill in user details in the dialog prompts
  3. Select user role (Admin/Caretaker/Owner)
  4. Credentials are automatically generated
  5. Click Save to File to backup data

Managing Animals

  1. Navigate to the animal management section
  2. Click Create to register a new animal
  3. Enter animal details (name, species, diet, etc.)
  4. View animals in the data table
  5. Edit mood status by clicking on the mood column
  6. Delete animals using the Delete button

🔒 Security Notes

⚠️ Important: The current implementation stores database credentials in plain text. For production use:

  • Use environment variables for sensitive data
  • Implement proper password hashing (BCrypt, Argon2)
  • Use prepared statements for all database queries (already implemented)
  • Add input validation and sanitization
  • Implement proper session management

🤝 Contributing

Contributions are welcome! Please follow these steps:

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

📄 License

This project is open source and available for educational purposes.

👤 Author

JCheney20

🙏 Acknowledgments

  • JavaFX community for UI framework
  • MySQL for database management
  • Oracle for Java platform

Note: This application was created for educational purposes. Ensure proper security measures are implemented before deploying in a production environment.

About

Java based zoo management system

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages