How aaditya-5281/realtime_tracker works
Project Type and Purpose
• This is a full-stack web application that provides real-time location sharing.
• The backend is powered by Node.js/Express with Socket.IO handling the real-time communication.
• The frontend is served as static assets (HTML templates, CSS, and JavaScript) from designated directories.
File Structure
• The main server file is “app.js” which initializes the Express server and Socket.IO for handling HTTP endpoints and WebSocket events.
• The “public” folder contains the client-side static assets (“css” for styling and “js” for client side scripts) that are loaded by the browser.
• The “views” folder contains the EJS template (“index.ejs”), which dynamically renders the main page.
• The project contains a “package.json” that lists dependencies such as express, socket.io, and ejs, confirming the technical stack.
Core Components
a. Client (Browser):
• Within this component, note that HTML/CSS/JS are served from “views” and “public” directories. The browser loads the main page (index.ejs) and the associated static files.
• That the client uses the Socket.IO client library (included via “public/js/script.js”) to communicate in real-time.
b. Server:
• Within this server component:
• Express as handling HTTP requests. The “GET /” route serves the main page.
• That Socket.IO is integrated into the server to handle WebSocket events like “sendLocation”, “receiveLocation”, and “userDisconnected”.
Relationships and Interactions
• HTTP requests (i.e., GET / for loading the page).
• Real-time communication:
Architectural Patterns and Technologies
• Tiered separation:
• The Frontend tier is clearly separated (served through static files and EJS templates).
• The Backend tier comprises Express to handle HTTP requests and Socket.IO for enabling bi-directional real-time communication.
• That the application uses an event-driven architectural style facilitated by Socket.IO.
• Make note of the technologies: Node.js, Express, Socket.IO, and EJS.