Skip to content

dpp0007/PeerQ

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

30 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

PeerQ - College Community Discourse Platform

A modern JavaFX desktop application that provides a platform for college students to ask questions, share knowledge, and engage in academic discussions. Built with JavaFX and PostgreSQL, PeerQ offers a clean, intuitive interface for community-driven learning.

PeerQ Logo

๐Ÿš€ Features

Core Functionality

  • Question & Answer System: Post questions and receive answers from the community
  • User Authentication: Secure login and registration with Galgotias University email validation
  • Search & Filter: Find questions by keywords, categories, or users
  • Category Organization: Questions organized into academic categories (Academics, Campus Life, Career, Technology, etc.)
  • Real-time Updates: Questions and answers sync with the shared database

User Experience

  • Dark Theme: Modern dark UI with green accents for reduced eye strain
  • Responsive Design: Adapts to different screen sizes and resolutions
  • Keyboard Shortcuts: Quick navigation with F1-F4 keys and Escape
  • Character Limits: Visual feedback for input length with color-coded warnings
  • Form Validation: Comprehensive validation with helpful error messages
  • Password Visibility Toggle: Eye icon to show/hide password while typing
  • Search Icon: Visual indicator for search functionality

Technical Features

  • Database Integration: PostgreSQL backend with connection pooling
  • Cross-platform: Runs on Windows, macOS, and Linux
  • Modern UI: JavaFX-based interface with custom CSS styling
  • Error Handling: Robust error handling and user feedback

๐Ÿ“‹ Prerequisites

Before running PeerQ, ensure you have the following installed:

  • Java 17 or higher (OpenJDK or Oracle JDK)
  • Maven 3.6+ for building and dependency management
  • PostgreSQL 12+ database server
  • Git for cloning the repository

๐Ÿ› ๏ธ Installation & Setup

1. Clone the Repository

git clone https://github.com/your-username/peerq-community-platform.git
cd peerq-community-platform

2. Database Setup

Install PostgreSQL

  • Windows: Download from PostgreSQL Official Site
  • macOS: brew install postgresql
  • Linux: sudo apt-get install postgresql postgresql-contrib

Create Database

-- Connect to PostgreSQL as superuser
psql -U postgres

-- Create database and user
CREATE DATABASE peerq_db;
CREATE USER peerq_user WITH PASSWORD 'your_secure_password';
GRANT ALL PRIVILEGES ON DATABASE peerq_db TO peerq_user;
\q

Run Database Schema

# Navigate to the sql directory
cd sql

# Run the schema file
psql -U peerq_user -d peerq_db -f schema.sql

3. Configure Database Connection

Edit the database configuration in src/main/java/com/peerq/util/DBConnection.java:

// Update these values to match your PostgreSQL setup
private static final String URL = "jdbc:postgresql://localhost:5432/peerq_db";
private static final String USER = "peerq_user";
private static final String PASSWORD = "your_secure_password";

4. Build the Application

# Clean and compile
mvn clean compile

# Run the application
mvn javafx:run

๐ŸŽฎ How to Use

Getting Started

  1. Launch the Application: Run mvn javafx:run from the project root
  2. Register an Account: Use your Galgotias University email address
  3. Browse Questions: View existing questions on the home screen
  4. Ask Questions: Click "Ask Question" to post new questions
  5. Answer Questions: Contribute by answering other students' questions

Keyboard Shortcuts

  • F1: Go to Home/Question List
  • F2: Ask Question (if logged in)
  • F3: Focus Search Bar
  • F4: Login/Logout
  • Escape: Go back to Question List

Search & Filter

  • Use the search bar to find questions by title, content, or author
  • Filter questions by category using the dropdown menu
  • Combine search terms with category filters for precise results

๐Ÿ“ฑ Screenshots

Dashboard

Dashboard Main question list with search and filter functionality

Login Screen

Login Secure login with Galgotias University email validation

Ask Question

Ask Question Form for posting new questions with character limits

Question Detail

Question Detail Detailed view of questions with answers and reply functionality

๐Ÿ—๏ธ Project Structure

peerq-community-platform/
โ”œโ”€โ”€ src/main/java/com/peerq/
โ”‚   โ”œโ”€โ”€ desktopui/
โ”‚   โ”‚   โ””โ”€โ”€ PeerQMainApplication.java    # Main JavaFX application
โ”‚   โ”œโ”€โ”€ web/                             # Web application components
โ”‚   โ”‚   โ”œโ”€โ”€ AuthServlet.java
โ”‚   โ”‚   โ”œโ”€โ”€ QuestionServlet.java
โ”‚   โ”‚   โ””โ”€โ”€ StaticFileServlet.java
โ”‚   โ”œโ”€โ”€ model/                           # Data models
โ”‚   โ”‚   โ”œโ”€โ”€ User.java
โ”‚   โ”‚   โ”œโ”€โ”€ Question.java
โ”‚   โ”‚   โ”œโ”€โ”€ Answer.java
โ”‚   โ”‚   โ””โ”€โ”€ Vote.java
โ”‚   โ”œโ”€โ”€ dao/                             # Data Access Objects
โ”‚   โ”‚   โ”œโ”€โ”€ UserDAO.java
โ”‚   โ”‚   โ”œโ”€โ”€ QuestionDAO.java
โ”‚   โ”‚   โ”œโ”€โ”€ AnswerDAO.java
โ”‚   โ”‚   โ””โ”€โ”€ VoteDAO.java
โ”‚   โ””โ”€โ”€ util/
โ”‚       โ””โ”€โ”€ DBConnection.java            # Database connection management
โ”œโ”€โ”€ src/main/resources/
โ”‚   โ”œโ”€โ”€ styles.css                       # JavaFX styling
โ”‚   โ””โ”€โ”€ static/                          # Web application resources
โ”‚       โ”œโ”€โ”€ index.html
โ”‚       โ”œโ”€โ”€ css/
โ”‚       โ”œโ”€โ”€ js/
โ”‚       โ””โ”€โ”€ images/
โ”œโ”€โ”€ sql/
โ”‚   โ””โ”€โ”€ schema.sql                       # Database schema
โ”œโ”€โ”€ pom.xml                              # Maven configuration
โ””โ”€โ”€ README.md

๐Ÿ”ง Configuration

Application Settings

  • Window Size: Default 1200x800, minimum 800x600
  • Database Pool: Configurable connection pool size
  • Theme: Dark theme with customizable accent colors

Development Configuration

  • Java Version: 17+
  • JavaFX Version: 21
  • Maven Version: 3.6+

๐Ÿงช Testing

Manual Testing

  1. User Registration: Test with valid/invalid email addresses
  2. Login Functionality: Verify authentication and session management
  3. Question Posting: Test form validation and database persistence
  4. Search & Filter: Verify search accuracy and filter functionality
  5. Answer Submission: Test answer posting and display

Database Testing

# Test database connection
mvn test -Dtest=DBConnectionTest

# Run integration tests
mvn verify

๐Ÿค Contributing

We welcome contributions to PeerQ! Here's how you can help:

Development Setup

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

Code Style Guidelines

  • Follow Java naming conventions
  • Use meaningful variable and method names
  • Add comments for complex logic
  • Ensure proper error handling
  • Test your changes thoroughly

Areas for Contribution

  • UI/UX Improvements: Better accessibility, responsive design
  • Performance Optimization: Database queries, UI rendering
  • New Features: Advanced search, notifications, file uploads
  • Bug Fixes: Report and fix issues
  • Documentation: Improve code comments and user guides

๐Ÿ› Troubleshooting

Common Issues

Database Connection Failed

Error: Connection refused

Solution: Ensure PostgreSQL is running and connection details are correct

JavaFX Runtime Error

Error: JavaFX runtime components are missing

Solution: Use mvn javafx:run instead of running the JAR directly

Maven Build Fails

Error: Compilation failed

Solution: Ensure Java 17+ is installed and JAVA_HOME is set correctly

Application Won't Start

Error: Failed to start PeerQ

Solution: Check database connection and ensure all dependencies are resolved

Getting Help

  • Issues: Create an issue on GitHub with detailed error information
  • Discussions: Use GitHub Discussions for questions and ideas
  • Documentation: Check this README and inline code comments

๐Ÿ“„ License

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

๐Ÿ™ Acknowledgments

  • JavaFX Team: For the excellent UI framework
  • PostgreSQL Community: For the robust database system
  • Galgotias University: For supporting student innovation
  • Contributors: All those who have contributed to this project

๐Ÿ“ž Contact


Made with โค๏ธ by the PeerQ Team

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published