How thynkzone/pnc-social works
Project type and purpose
• This is a full-stack Java web application: a workplace social networking platform (“P&C”).
• Backend: Java/JSP/Servlets running on Apache Tomcat, using JDBC to talk to MySQL.
• Frontend: JSP pages, HTML5/CSS3, JavaScript, jQuery.
• Purpose: user management, social graph, content sharing, gamification, real-time notifications, admin tools, strong security.
File structure
• Top level:
• java/com/thynkzone/jsp/… – backend classes (database access, hashing, encryption, utilities).
• WEB-INF/web.xml + META-INF/MANIFEST.MF – servlet mappings, deployment descriptor.
• Patterns:
• Traditional MVC-ish: JSPs as views + Java utility classes invoked via scriptlets or custom tags.
• Single Tomcat WAR deployable module.
• Config & build:
• No explicit build script in repo (Maven optional).
• Sensitive configs (DB creds, security keys) under WEB-INF/secured/ (gitignored).
README for additional insights
• Tech stack reconfirmed (Tomcat, MySQL, BCrypt, AES, reCAPTCHA).
• Security features: CSRF tokens, prepared statements, input sanitization.
• External dependencies: email service (SMTP), Google reCAPTCHA.
• Data model: 8+ database tables (users, posts, comments, likes, notifications, ranks, reports).
Components
a. Main Components
– Browser/UI (JSP pages, JS and CSS)
– Web Server / Application Server (Apache Tomcat)
– Servlet Container + JSP Engine
– Business Logic Layer (Java classes in com.thynkzone.jsp)
– Data Access Layer (db.java)
– MySQL Database
– External Services: SMTP Mail Server, Google reCAPTCHA endpoint
– (Optional) File Storage for user uploads (e.g., external file server or cloud storage)
– Security Modules (BCrypt, AES encryption, CSRF filter)
b. Relationships and Interactions
1. User’s browser sends HTTP(S) request → Apache Tomcat
2. Tomcat consults web.xml → dispatch to JSP/Servlet
3. JSP invokes Java utility classes (business logic)
4. Business logic layer calls db.java → JDBC → MySQL
5. Results flow back through layers → JSP view → HTTP response
6. For file uploads: JSP forwards to storage module → saved externally
7. For email notifications: business logic calls SMTP server
8. For CAPTCHA: frontend requests token → backend verifies with Google API
9. Session cookie management, CSRF token checks at filter layer
c. Architectural Patterns & Design Principles
– Layered architecture (Presentation → Business Logic → Data Access)
– Security-first: encryption, hashing, prepared statements, token filters
– Modular utility classes for reuse (hashing, encoding, image processing)
– WAR-based monolith deploy
– MVC flavor: JSPs = Views, Java classes = Controllers/Models
d. Key Technologies/Frameworks
– Java Servlets & JSP on Apache Tomcat
– JDBC for MySQL connectivity
– BCrypt, SHA-512, AES for security
– Google reCAPTCHA v2/v3
– HTML5/CSS3/jQuery for client UI