A full-stack event booking system with a Java HTTP backend, vanilla HTML frontend, no frameworks, no build tools, no external libraries.
Event Horizon is a two-tier web app for managing and booking events. The backend is a raw Java HTTP server using only the JDK's built-in com.sun.net.httpserver. Data is persisted to local .dat files. The frontend is a single HTML file that talks to the backend via REST. Users can register, browse events, and book or cancel tickets. Admins can create and delete events.
| Feature | Description |
|---|---|
| User Auth | Register and login with username/password; sessions stored in localStorage |
| Role System | Admin and regular user roles; admin flag set at registration |
| Event Browsing | View all events with name, date, and available ticket count |
| Ticket Booking | Book one ticket per action; capacity enforced server-side |
| Ticket Cancellation | Users can void their own tickets; seat count is restored |
| Admin Panel | Admins can create events (ID, name, date, capacity) and delete them |
| File Persistence | Users, events, and tickets saved to users.dat, events.dat, tickets.dat |
| Default Admin | A default admin / admin123 account is created on first run |
| Zero Dependencies | Backend uses only standard JDK — no Maven, no Gradle, no third-party JARs |
Backend : Java (com.sun.net.httpserver) — runs on port 8080
Frontend : HTML5, Tailwind CSS (CDN), Vanilla JavaScript
Persistence : Java Object Serialization (.dat files)
Fonts : JetBrains Mono, Playfair Display (Google Fonts)
Both files need to be in the same directory. The Java backend must be running before you open the HTML file.
javac EventHorizon.javajava EventHorizonThe server starts on http://localhost:8080. You should see it running with no output unless an error occurs. Three .dat files will be created in the same directory on first run.
Open index.html directly in your browser:
# macOS
open index.html
# Linux
xdg-open index.html
# Windows
start index.htmlOr just double-click index.html in your file explorer.
Username : admin
Password : admin123
All endpoints are served at http://localhost:8080/api.
| Method | Endpoint | Description |
|---|---|---|
POST |
/api/register |
Register a new user |
POST |
/api/login |
Login and receive user info |
GET |
/api/events |
List all events |
POST |
/api/events |
Create a new event (admin) |
DELETE |
/api/events |
Delete an event by ID (admin) |
GET |
/api/tickets?username=X |
Get tickets for a user |
POST |
/api/tickets |
Book a ticket |
DELETE |
/api/tickets |
Cancel a ticket |