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.
- 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
- 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
- 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
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
git clone https://github.com/your-username/peerq-community-platform.git
cd peerq-community-platform
- Windows: Download from PostgreSQL Official Site
- macOS:
brew install postgresql
- Linux:
sudo apt-get install postgresql postgresql-contrib
-- 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
# Navigate to the sql directory
cd sql
# Run the schema file
psql -U peerq_user -d peerq_db -f schema.sql
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";
# Clean and compile
mvn clean compile
# Run the application
mvn javafx:run
- Launch the Application: Run
mvn javafx:run
from the project root - Register an Account: Use your Galgotias University email address
- Browse Questions: View existing questions on the home screen
- Ask Questions: Click "Ask Question" to post new questions
- Answer Questions: Contribute by answering other students' questions
- 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
- 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
Main question list with search and filter functionality
Secure login with Galgotias University email validation
Form for posting new questions with character limits
Detailed view of questions with answers and reply functionality
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
- Window Size: Default 1200x800, minimum 800x600
- Database Pool: Configurable connection pool size
- Theme: Dark theme with customizable accent colors
- Java Version: 17+
- JavaFX Version: 21
- Maven Version: 3.6+
- User Registration: Test with valid/invalid email addresses
- Login Functionality: Verify authentication and session management
- Question Posting: Test form validation and database persistence
- Search & Filter: Verify search accuracy and filter functionality
- Answer Submission: Test answer posting and display
# Test database connection
mvn test -Dtest=DBConnectionTest
# Run integration tests
mvn verify
We welcome contributions to PeerQ! Here's how you can help:
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature
- Make your changes and test thoroughly
- Commit your changes:
git commit -m 'Add amazing feature'
- Push to the branch:
git push origin feature/amazing-feature
- Open a Pull Request
- Follow Java naming conventions
- Use meaningful variable and method names
- Add comments for complex logic
- Ensure proper error handling
- Test your changes thoroughly
- 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
Error: Connection refused
Solution: Ensure PostgreSQL is running and connection details are correct
Error: JavaFX runtime components are missing
Solution: Use mvn javafx:run
instead of running the JAR directly
Error: Compilation failed
Solution: Ensure Java 17+ is installed and JAVA_HOME is set correctly
Error: Failed to start PeerQ
Solution: Check database connection and ensure all dependencies are resolved
- 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
This project is licensed under the MIT License - see the LICENSE file for details.
- 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
- Project Link: https://github.com/your-username/peerq-community-platform
- Issues: GitHub Issues
- Email: deepankarpatel28@gmail.com
Made with โค๏ธ by the PeerQ Team