How nerdies24/lernkarten works
Project type and purpose
• This is a single-page, client-side flashcard (Lernkarten) web application built with static assets: HTML, CSS (Bootstrap + custom), JavaScript (Bootstrap bundle + custom), and a JSON file of questions/answers.
• Purpose: Load flashcards from a JSON file, present interactive Q&A sessions in the browser, support responsive design, and allow easy content updates.
File structure
• Top-level:
• index.html — entry-point UI
• css/ — bootstrap.css + styles.css
• js/ — bootstrap.bundle.js + script.js
• text/ — fragen_und_antworten.json
• No backend code beyond static file serving; JSON is loaded client-side via fetch/AJAX.
• Lerngkarten_Prompt.txt is a ChatGPT prompt for generating new JSON content (out-of-band).
README insights
• Confirms static‐server requirement to serve JSON via HTTP.
• Describes MVC-style separation: JSON (Model), script.js (Controller), HTML/CSS (View).
• Emphasizes Bootstrap for responsive UI.
Main components & interactions
a. Components:
1. User’s Browser (Client)
2. Static File Server (any HTTP server)
3. Static Assets:
– index.html (HTML view template)
– css/bootstrap.css + css/styles.css (styling)
– js/bootstrap.bundle.js + js/script.js (UI logic)
– text/fragen_und_antworten.json (flashcard data model)
b. Data flows / relationships:
1. Browser → HTTP GET index.html
2. index.html → references CSS and JS → Browser GETs those assets
3. script.js on load → HTTP GET text/fragen_und_antworten.json
4. script.js parses JSON → updates DOM in index.html
5. User interactions (click “show answer”, “next card”) → script.js controls view updates
c. Architectural patterns / principles:
– Client-side MVC: Model = JSON, View = HTML/CSS, Controller = script.js
– Responsive UI via Bootstrap
– Separation of concerns: data, styling, logic in separate folders
– Static asset hosting → minimal runtime complexity
d. Key technologies:
– HTML5
– CSS3 + Bootstrap 5
– Vanilla JavaScript + Bootstrap JS bundle
– JSON for content
– Any static HTTP server (e.g. Python SimpleHTTPServer, Nginx)