This project is a simple HTTP server built using Java sockets with file-based storage. It mimics basic REST API behaviour (GET, POST, PATCH, DELETE).
Client -> Server -> Router -> Logic -> Database ( request cycle ) Database -> Logic -> Router -> Server -> Client ( response cycle )
- Client sends HTTP request using Socket
- Server receives request via ServerSocket
- Server parses request line and headers
- Server extracts body using Content-Length header
- Router checks HTTP method (GET/POST/PATCH/DELETE)
- Router forwards request to Logic layer
- Logic performs operations on file-based database
- Response is returned back to Client
Server — Handles incoming connections, header parsing, and body extraction.
Client — Sends raw HTTP requests to the server for testing.
Router — Decides which function to call based on HTTP method and URL.
Logic — Contains business logic and enforces resource validation.
Database — Handles all file-based storage operations (read, write, update, delete).