This document describes the internal architecture of OpenPlayground, explaining how the project is structured, how data flows through the application, and how different components work together to render the platform.
OpenPlayground is a static, frontend-only web application built with HTML, CSS, and JavaScript, designed to be lightweight, easy to contribute to, and suitable for hosting on platforms like GitHub Pages.
- Architecture Type: Static, component-based frontend
- Rendering: Client-side rendering using JavaScript
- Data Source: Centralized JSON file
- Backend: None (as of now)
- Beginner-friendly codebase
- Clear separation of concerns
- Reusable UI components
- Simple contribution workflow
- Zero setup required to run locally
OpenPlayground/
│
├── .github/ # GitHub workflows, templates, configs
├── .vscode/ # Editor configuration
│
├── components/ # Reusable HTML components
│ ├── header.html
│ ├── footer.html
│ └── hero.html
│
├── css/ # Stylesheets
│ ├── style.css # Global styles
│ ├── theme.css # Light/Dark theme styles
│ ├── responsive.css # Responsive design rules
│ ├── footer.css
│ ├── about.css
│ ├── bookmarks.css
│ ├── contributor-cards.css
│ └── feedback.css
│
├── js/ # JavaScript logic
│ ├── core/
│ │ └── app.js # App bootstrap logic
│ │
│ ├── components.js # Loads reusable HTML components
│ ├── projects-loader.js # Loads and renders projects
│ ├── bookmarks.js # Bookmark functionality
│ ├── bookmarks-page.js # Bookmark page logic
│ ├── chatbot.js # Chatbot interactions
│ ├── feedback.js # Feedback handling
│ └── theme.js # Theme toggling logic
│
├── projects/ # Project-related pages/assets
│
├── projects.json # Central project data source
│
├── index.html # Home page
├── projects.html # Projects listing page
├── contributors.html # Contributors page
├── about.html
├── contact.html
├── feedback.html
├── bookmarks.html
├── chatbot.html
├── stats.html
├── sitemap.html
├── starterTemplate.html
│
├── logo.jpg
├── validate-links.js
│
├── README.md
├── CONTRIBUTING.md
├── CODE_OF_CONDUCT.md
├── DEBUGGING_GUIDE.md
└── LICENSE
Contains reusable UI sections such as:
header.htmlfooter.htmlhero.html
These components are dynamically injected into pages using JavaScript to avoid duplication and maintain consistency across pages.
CSS files are modular and responsibility-based:
style.css→ Base/global stylestheme.css→ Dark/light mode themingresponsive.css→ Mobile and tablet responsiveness- Page-specific CSS files (about, bookmarks, feedback, etc.)
This approach keeps styles clean and manageable.
core/app.js- Entry point for initializing the app
- Sets up shared behaviors and loads dependencies
components.js- Dynamically injects header, footer, and hero components into pages
projects-loader.js- Fetches
projects.json - Parses project data
- Dynamically creates and inserts project cards into the DOM
- Fetches
bookmarks.js→ Save/remove bookmarked projectsbookmarks-page.js→ Render bookmarked itemschatbot.js→ Chatbot UI logicfeedback.js→ Feedback form handlingtheme.js→ Theme toggle and persistence
projects.json is the single source of truth for all showcased projects.
Each project entry typically contains:
- Project title
- Description
- Tech stack
- Category/tags
- Live demo link
- GitHub repository link
- Preview image (optional)
This file is consumed by projects-loader.js to render projects dynamically.
- User opens a page (e.g.,
projects.html) components.jsinjects reusable UI componentsprojects-loader.jsfetchesprojects.json- JavaScript parses project data
- Project cards are dynamically created
- Cards are rendered into the DOM
- Filters, bookmarks, and theme logic update UI in real time
- No server or database
- No authentication
- All logic runs in the browser
- Easy local preview (
open index.html) - Ideal for GitHub Pages hosting
The current architecture allows easy expansion:
- Backend API for dynamic project submission
- Database instead of JSON
- User authentication
- Commenting and reactions
- Analytics dashboard
- Admin moderation panel
| Layer | Responsibility |
|---|---|
| HTML | Page structure |
| CSS | Styling & theming |
| JavaScript | Logic & interactivity |
| JSON | Project data |
| Components | Reusable UI sections |
OpenPlayground’s architecture prioritizes simplicity, clarity, and community contribution, making it an ideal platform for beginners and open-source collaboration.
Just tell me 🚀