Skip to content

GaneshRenuse/Virtual-Private-Network-For-Office

Repository files navigation

πŸ” ACE VPN - A VPN for Office

ACE VPN Logo Java Spring Boot License

ACE VPN is a secure, enterprise-grade VPN system designed for office environments. This project simulates a complete VPN infrastructure with client-server architecture, encrypted communication, and an admin dashboard for managing connections and users.

Work Flow


πŸ“‹ Table of Contents


🎯 Overview

ACE VPN is a full-stack VPN solution built as a learning project to understand:

  • Network security and encryption
  • Client-server architecture
  • Spring Boot backend development
  • JavaFX desktop application development
  • Database management with Hibernate
  • JWT-based authentication
  • Secure tunneling and data encryption

This project demonstrates real-world implementation of VPN concepts while maintaining production-ready code quality and architecture.


✨ Features

πŸ”’ Security

  • AES & RSA Encryption - End-to-end encrypted communication
  • JWT Authentication - Secure token-based user authentication
  • BCrypt Password Hashing - Industry-standard password security
  • SSL/TLS Support - Encrypted data transmission

πŸ–₯️ Client Application

  • JavaFX Desktop GUI - Modern, responsive desktop interface
  • Real-time Connection Status - Live monitoring of VPN connection
  • Company Code Management - Flexible organization-based access
  • Auto-reconnect - Automatic connection recovery

🌐 Server Backend

  • RESTful APIs - Clean, well-documented API endpoints
  • Multi-user Support - Handle multiple concurrent connections
  • Session Management - Track active user sessions
  • Logging & Monitoring - Comprehensive activity logs

πŸ‘¨β€πŸ’Ό Admin Dashboard

  • User Management - Add, remove, and manage users
  • Connection Monitoring - View active VPN connections
  • Session Logs - Detailed connection history and analytics
  • Statistics - Real-time metrics and usage data

πŸ“Έ Screenshots

Login Screen

Login Screen

Secure authentication with Company ID and Password

Main Interface - Disconnected

Disconnected State

Ready to establish VPN connection

Main Interface - Connected

Connected State

Active VPN tunnel with encrypted communication

Error Handling

Error Modal

User-friendly error messages with themed modals


πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                 β”‚         β”‚                 β”‚         β”‚                 β”‚
β”‚  ACE VPN Client │◄───────►│  ACE VPN Server │◄───────►│  MySQL Database β”‚
β”‚   (JavaFX UI)   β”‚  HTTPS  β”‚  (Spring Boot)  β”‚   JDBC  β”‚                 β”‚
β”‚                 β”‚   JWT   β”‚                 β”‚         β”‚                 β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
        β”‚                           β”‚
        β”‚                           β”‚
        β”‚                    β”Œβ”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”
        β”‚                    β”‚             β”‚
        └───────────────────►│   Admin     β”‚
            Web Access       β”‚  Dashboard  β”‚
                             β”‚  (Web UI)   β”‚
                             β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Data Flow

  1. Authentication: Client sends credentials β†’ Server validates against DB β†’ JWT token issued
  2. Connection: Client requests VPN tunnel β†’ Server creates encrypted session β†’ Tunnel established
  3. Data Transfer: All data encrypted with AES β†’ Transmitted through secure tunnel β†’ Decrypted at destination
  4. Monitoring: Admin dashboard queries server β†’ Real-time connection data displayed

πŸ’» Technology Stack

Backend

  • Java 17+ - Core programming language
  • Spring Boot 3.0+ - Application framework
  • Spring Security - Authentication & authorization
  • Hibernate ORM - Database object-relational mapping
  • Spring Data JPA - Data persistence layer
  • JWT (jjwt) - JSON Web Token authentication
  • BCrypt - Password encryption
  • Maven - Build automation and dependency management

Frontend (Client)

  • JavaFX 17+ - Desktop GUI framework
  • FXML - UI markup language
  • SceneBuilder - Visual UI design tool
  • CSS3 - Styling and theming

Database

  • MySQL 8.0 / MariaDB - Relational database
  • XAMPP - Local development environment

Security & Networking

  • AES-256 - Symmetric encryption
  • RSA-2048 - Asymmetric encryption
  • TCP/UDP Sockets - Network communication
  • SSL/TLS - Secure transport layer

Tools & DevOps

  • Git - Version control
  • GitHub - Code hosting and collaboration
  • Postman - API testing
  • IntelliJ IDEA - IDE for Java development
  • Docker (optional) - Containerization
  • Render/Railway - Cloud deployment platforms

πŸ“ Project Structure

ace-vpn/
β”œβ”€β”€ vpn-server/              # Spring Boot backend application
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ main/
β”‚   β”‚   β”‚   β”œβ”€β”€ java/
β”‚   β”‚   β”‚   β”‚   └── com/acevpn/
β”‚   β”‚   β”‚   β”‚       β”œβ”€β”€ controller/    # REST API controllers
β”‚   β”‚   β”‚   β”‚       β”œβ”€β”€ service/       # Business logic
β”‚   β”‚   β”‚   β”‚       β”œβ”€β”€ repository/    # Data access layer
β”‚   β”‚   β”‚   β”‚       β”œβ”€β”€ model/         # Entity classes
β”‚   β”‚   β”‚   β”‚       β”œβ”€β”€ security/      # JWT & encryption
β”‚   β”‚   β”‚   β”‚       └── config/        # Configuration classes
β”‚   β”‚   β”‚   └── resources/
β”‚   β”‚   β”‚       β”œβ”€β”€ application.properties
β”‚   β”‚   β”‚       └── schema.sql
β”‚   β”‚   └── test/              # Unit and integration tests
β”‚   └── pom.xml
β”‚
β”œβ”€β”€ vpn-client/              # JavaFX desktop client
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ main/
β”‚   β”‚   β”‚   β”œβ”€β”€ java/
β”‚   β”‚   β”‚   β”‚   └── com/acevpn/client/
β”‚   β”‚   β”‚   β”‚       β”œβ”€β”€ ui/            # JavaFX controllers
β”‚   β”‚   β”‚   β”‚       β”œβ”€β”€ network/       # Socket communication
β”‚   β”‚   β”‚   β”‚       └── util/          # Helper classes
β”‚   β”‚   β”‚   └── resources/
β”‚   β”‚   β”‚       β”œβ”€β”€ fxml/              # UI layouts
β”‚   β”‚   β”‚       β”œβ”€β”€ css/               # Stylesheets
β”‚   β”‚   β”‚       └── images/            # Assets
β”‚   β”‚   └── test/
β”‚   └── pom.xml
β”‚
β”œβ”€β”€ vpn-common/              # Shared libraries
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   └── main/
β”‚   β”‚       └── java/
β”‚   β”‚           └── com/acevpn/common/
β”‚   β”‚               β”œβ”€β”€ encryption/    # AES/RSA utilities
β”‚   β”‚               β”œβ”€β”€ dto/           # Data transfer objects
β”‚   β”‚               └── constants/     # Shared constants
β”‚   └── pom.xml
β”‚
β”œβ”€β”€ vpn-admin/               # Web admin dashboard
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   └── main/
β”‚   β”‚       β”œβ”€β”€ resources/
β”‚   β”‚       β”‚   β”œβ”€β”€ templates/         # Thymeleaf/React
β”‚   β”‚       β”‚   └── static/            # CSS, JS, images
β”‚   └── pom.xml
β”‚
β”œβ”€β”€ docs/                    # Documentation
β”‚   β”œβ”€β”€ API.md              # API documentation
β”‚   β”œβ”€β”€ ARCHITECTURE.md     # System architecture
β”‚   └── DEPLOYMENT.md       # Deployment guide
β”‚
β”œβ”€β”€ screenshots/             # Project screenshots
β”œβ”€β”€ .gitignore
β”œβ”€β”€ README.md
└── pom.xml                  # Parent POM

πŸš€ Installation

Prerequisites

  • Java JDK 17 or higher
  • Maven 3.6+
  • MySQL 8.0 or MariaDB
  • XAMPP (for local MySQL)
  • Git

Step 1: Clone the Repository

git clone https://github.com/yourusername/ace-vpn.git
cd ace-vpn

Step 2: Database Setup

  1. Start XAMPP and launch MySQL
  2. Create database:
CREATE DATABASE acevpn_db;
USE acevpn_db;
  1. Run the schema script:
mysql -u root -p acevpn_db < vpn-server/src/main/resources/schema.sql

Step 3: Configure Server

Edit vpn-server/src/main/resources/application.properties:

# Database Configuration
spring.datasource.url=jdbc:mysql://localhost:3306/acevpn_db
spring.datasource.username=root
spring.datasource.password=yourpassword

# Server Port
server.port=8080

# JWT Secret (change this!)
jwt.secret=your-secret-key-here
jwt.expiration=86400000

Step 4: Build the Project

# Build all modules
mvn clean install

# Or build specific modules
cd vpn-server && mvn clean install
cd vpn-client && mvn clean install

Step 5: Run the Server

cd vpn-server
mvn spring-boot:run

Step 6: Run the Client

cd vpn-client
mvn javafx:run

πŸ“– Usage

For End Users

  1. Launch the Client Application

    • Double-click the ACE VPN executable or run via Maven
  2. Login

    • Enter your Company ID: GR01120999
    • Enter your Password: Ganesh@1120999
    • Click "Login"
  3. Configure Company Code

    • The default code is pre-filled: company.com/slrc/connectgroup
    • You can modify this to connect to different company servers
  4. Connect to VPN

    • Click the "Connect" button
    • Wait for status to change to "Connected"
    • Your connection is now encrypted and secure
  5. Disconnect

    • Click "Disconnect" to end the VPN session
    • Click "Logout" to return to login screen

For Administrators

  1. Access Admin Dashboard

    • Navigate to http://localhost:8080/admin
    • Login with admin credentials
  2. Manage Users

    • Add new users with company codes
    • Remove or disable user accounts
    • Reset passwords
  3. Monitor Connections

    • View all active VPN sessions
    • Check connection logs
    • Analyze usage statistics

πŸ“š API Documentation

Authentication Endpoints

POST /api/auth/login

Authenticate user and receive JWT token.

Request:

{
  "companyId": "GR01120999",
  "password": "Ganesh@1120999"
}

Response:

{
  "token": "eyJhbGciOiJIUzI1NiIs...",
  "userId": "123",
  "expiresIn": 86400
}

VPN Endpoints

POST /api/vpn/connect

Establish VPN tunnel connection.

Headers:

Authorization: Bearer <jwt_token>

Request:

{
  "companyCode": "company.com/slrc/connectgroup"
}

Response:

{
  "sessionId": "abc123",
  "status": "connected",
  "encryptionKey": "encrypted_aes_key"
}

POST /api/vpn/disconnect

Terminate VPN session.

GET /api/vpn/status

Check current VPN connection status.

Admin Endpoints

GET /api/admin/users

List all registered users (Admin only).

GET /api/admin/sessions

View active VPN sessions (Admin only).

POST /api/admin/users

Create new user account (Admin only).

DELETE /api/admin/users/{id}

Remove user account (Admin only).


πŸ—“οΈ Development Roadmap

Phase 1: Week 1 - Project Setup βœ…

  • Java Socket Programming basics
  • TCP/UDP communication
  • Multi-module Maven project structure
  • Basic client-server connection

Phase 2: Week 2 - Spring Boot & REST APIs βœ…

  • Spring Boot setup
  • REST API endpoints
  • JSON handling
  • Postman testing

Phase 3: Week 3 - Database Integration πŸ”„

  • MySQL/MariaDB setup
  • Hibernate configuration
  • JPA repositories
  • User entity and authentication

Phase 4: Week 4 - Security & Encryption πŸ“…

  • AES & RSA implementation
  • JWT authentication
  • BCrypt password hashing
  • Encrypted communication

Phase 5: Week 5 - Client Application πŸ“…

  • JavaFX UI design
  • Login screen
  • Connection management
  • Status monitoring

Phase 6: Week 6 - Admin Dashboard πŸ“…

  • Web-based admin panel
  • User management
  • Session monitoring
  • Analytics and logs

Phase 7: Week 7 - VPN Tunnel Simulation πŸ“…

  • Packet encryption/decryption
  • Network routing simulation
  • Multi-threading implementation
  • Data flow visualization

Phase 8: Week 8 - Deployment & Documentation πŸ“…

  • Error handling & validation
  • Cloud deployment (Render/Railway)
  • Complete documentation
  • Demo video and screenshots

🀝 Contributing

Contributions are welcome! Please follow these steps:

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

Coding Standards

  • Follow Java naming conventions
  • Write unit tests for new features
  • Document public APIs with Javadoc
  • Keep code coverage above 80%
  • Use meaningful commit messages

πŸ“ License

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


πŸ‘¨β€πŸ’» Author

Your Name


πŸ™ Acknowledgments


πŸ“ž Support

If you have any questions or need help, please:


🌟 Star History

If you find this project useful, please give it a ⭐!

Star History Chart


Made with ❀️ by Ganesh Renuse

Β© 2025 ACE VPN. All rights reserved.

Releases

No releases published

Packages

No packages published

Languages