How umsisamess/fourspace-client works
Project type and purpose
• This is a pure frontend client (“FourSpace-Client”) for a coding-contest platform. It serves static HTML/CSS/JS pages that communicate with backend services (authentication, contests, questions, profiles).
• The purpose is to allow two user roles—job-seekers and companies—to sign up, log in, view/create contests, attempt questions, and view leaderboards.
File structure
• Top-level HTML pages (index.html, login.html, register.html, contests.html, contest.html, question.html, addContest.html, addquestion.html, leaderboard.html, profile.html).
• /css/ directory holds per-page style files and a default.css.
• /js/ directory holds per-page script files (e.g., contests.js, contest.js, question.js, addContest.js, addquestion.js, leaderboard.js, profile.js, register.js, login.js, default.js).
• No backend code here—implicit dependency on remote APIs.
README for additional insights
• Technology stack: HTML, CSS, JavaScript.
• Hosted on Netlify (static-site CDN).
• Uses RESTful calls to backend services for auth, contest management, question data, user profiles, and ratings/leaderboard.
• Future modules: Job listings service, interview platform, feedback form.
Main components
a. Clients
• Browser UI (the static site)
• Actors: Job-Seeker, Company
b. Frontend Application
• Static Hosting (Netlify/CDN)
• HTML pages + CSS + JS modules
• Central config/default.js for common logic (e.g., token storage)
c. Backend Services (external, not in this repo)
• Authentication Service (login, signup, token issuance)
• Contest Service (list contests, create contest, add questions)
• Question Service (serve question data, submit answers)
• Leaderboard/Rating Service (compute & serve leaderboards)
• User/Profile Service (fetch/update profiles & availability status)
d. Data Storage
• User database
• Contest database
• Question database
• Ratings database
Relationships and interactions
• Browser loads static assets from CDN.
• JS code orchestrates REST calls:
• Auth endpoints → receive JWT/token
• Contest endpoints → fetch/add contests
• Question endpoints → fetch questions, submit solutions
• Leaderboard endpoints → fetch ranking data
• Profile endpoints → fetch/update user metadata
• Responses drive dynamic DOM rendering.
Architectural patterns & principles
• Separation of concerns: each HTML page has paired JS and CSS modules.
• RESTful service integration: thin client, heavy lifting on backend.
• Stateless authentication via tokens stored in browser (e.g., localStorage).
• Modular frontend: default.js for common logic, page-specific scripts for feature logic.
Essential elements
• Arrowheads on every communication link with HTTP verbs (e.g., GET /contests)
• Notation of technology choices: “Netlify CDN”, “Fetch API in JavaScript”, “JWT auth”