From bffdcf4bdf34649564c4b920d800ff02673466ab Mon Sep 17 00:00:00 2001 From: "Geir O. Jerstad" Date: Tue, 1 Jul 2025 20:42:02 +0200 Subject: [PATCH] second commit --- .direnv/flake-profile | 2 +- .direnv/flake-profile-2-link | 1 - .direnv/flake-profile-6-link | 1 + CLAUDE.md | 60 +++ flake.nix | 6 +- webshop_app/mvc-emne2/ACCESSIBILITY.md | 252 +++++++++++++ webshop_app/mvc-emne2/README-NO.md | 481 +++++++++++++++++++++++++ webshop_app/mvc-emne2/README.md | 452 +++++++++++++++++++++++ webshop_app/mvc-emne2/flow-diagram.md | 105 ++++++ webshop_app/mvc-emne2/index.html | 21 ++ webshop_app/mvc-emne2/js/app.js | 30 ++ webshop_app/mvc-emne2/js/controller.js | 95 +++++ webshop_app/mvc-emne2/js/model.js | 195 ++++++++++ webshop_app/mvc-emne2/js/view.js | 283 +++++++++++++++ webshop_app/mvc-emne2/styles.css | 345 ++++++++++++++++++ webshop_app/prd.md | 41 +++ 16 files changed, 2366 insertions(+), 4 deletions(-) delete mode 120000 .direnv/flake-profile-2-link create mode 120000 .direnv/flake-profile-6-link create mode 100644 CLAUDE.md create mode 100644 webshop_app/mvc-emne2/ACCESSIBILITY.md create mode 100644 webshop_app/mvc-emne2/README-NO.md create mode 100644 webshop_app/mvc-emne2/README.md create mode 100644 webshop_app/mvc-emne2/flow-diagram.md create mode 100644 webshop_app/mvc-emne2/index.html create mode 100644 webshop_app/mvc-emne2/js/app.js create mode 100644 webshop_app/mvc-emne2/js/controller.js create mode 100644 webshop_app/mvc-emne2/js/model.js create mode 100644 webshop_app/mvc-emne2/js/view.js create mode 100644 webshop_app/mvc-emne2/styles.css diff --git a/.direnv/flake-profile b/.direnv/flake-profile index c7ae5b7..2ea10f8 120000 --- a/.direnv/flake-profile +++ b/.direnv/flake-profile @@ -1 +1 @@ -flake-profile-2-link \ No newline at end of file +flake-profile-6-link \ No newline at end of file diff --git a/.direnv/flake-profile-2-link b/.direnv/flake-profile-2-link deleted file mode 120000 index 1c3f436..0000000 --- a/.direnv/flake-profile-2-link +++ /dev/null @@ -1 +0,0 @@ -/nix/store/rsbmjvqa6n7vf10pm0cg0fv437ixj57q-nix-shell-env \ No newline at end of file diff --git a/.direnv/flake-profile-6-link b/.direnv/flake-profile-6-link new file mode 120000 index 0000000..60e81dc --- /dev/null +++ b/.direnv/flake-profile-6-link @@ -0,0 +1 @@ +/nix/store/6813nrz8y11cdvr8iw2czgdmqhsd6yr6-nix-shell-env \ No newline at end of file diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..b004a51 --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,60 @@ +# CLAUDE.md + +This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. + +## Development Environment + +This project uses **Nix Flakes** for development environment management: +- Run `nix develop` to enter the development shell with Node.js v22 and git +- The flake.nix configures a reproducible development environment + +## Project Structure + +This is a **frontend web development educational project** with two main areas: + +### 1. Pensum (Curriculum Modules) +Five learning modules in `/pensum/` directory, each focusing on different aspects of frontend development: +- `Framworkless/` - Vanilla JavaScript/HTML/CSS implementations +- `HTML-CSS/` - Web fundamentals and styling +- `Functional Programming/` - Programming paradigm concepts +- `Typescript/` - Type-safe JavaScript development +- `Vue/` - Vue.js framework implementations + +### 2. Webshop Application (`/webshop_app/`) +The main practical project implementing a progressive web store: +- **PRD Location**: `webshop_app/prd.md` contains complete requirements and implementation phases +- **Current Phase**: MVC implementation in `webshop_app/mvc-emne2/` +- **Architecture**: Designed for progressive complexity - starting with plain JS/HTML/CSS MVC, then enhanced with TypeScript, Vue.js, and advanced features + +## Key Implementation Details + +### MVC Architecture (Current Phase) +- **Model**: Handle data (products, cart) using local storage/JSON +- **View**: HTML templates and DOM manipulation +- **Controller**: Business logic and user interaction handling +- **Requirements**: Pure JavaScript (ES6+), HTML5, CSS3, no external frameworks + +### Progressive Enhancement Strategy +The webshop will be rewritten multiple times during the course: +1. **Phase 1**: Plain JS/HTML/CSS with MVC pattern +2. **Phase 2**: Enhanced with modern JavaScript features +3. **Phase 3**: TypeScript implementation +4. **Phase 4**: Vue.js implementation +5. **Phase 5**: Advanced features (auth, payment, etc.) + +## Core Application Features +- Product listing page with basic product information +- Product detail page with purchase functionality +- Basic navigation and routing +- Shopping cart functionality (localStorage-based) +- Responsive design for desktop and mobile + +## Data Structure +- **Products**: id, name, price, description, image, category +- **Cart**: product references and quantities +- **Storage**: localStorage for client-side persistence + +## Development Notes +- No package.json files exist yet - modules are currently empty placeholders +- Entry point for webshop MVC implementation: `webshop_app/mvc-emne2/index.html` +- Educational focus: demonstrating core web development concepts through practical implementation \ No newline at end of file diff --git a/flake.nix b/flake.nix index 1708519..386716b 100644 --- a/flake.nix +++ b/flake.nix @@ -19,11 +19,13 @@ buildInputs = [ pkgs.nodejs pkgs.git + pkgs.zsh ]; shellHook = '' + export SHELL=${pkgs.zsh}/bin/zsh echo "Node.js development environment ready." - node --version - npm --version + echo "Node version: $(node --version)" + echo "Npm version: $(npm --version)" ''; }; } diff --git a/webshop_app/mvc-emne2/ACCESSIBILITY.md b/webshop_app/mvc-emne2/ACCESSIBILITY.md new file mode 100644 index 0000000..3d4badd --- /dev/null +++ b/webshop_app/mvc-emne2/ACCESSIBILITY.md @@ -0,0 +1,252 @@ +# Accessibility & Semantic HTML Improvements + +## Overview +The MVC webshop application has been enhanced with proper semantic HTML elements and accessibility features to ensure it's usable by all users, including those using assistive technologies. + +## Semantic HTML Elements Added + +### 1. Document Structure +- **`
`**: Wraps the primary content area +- **`
`**: Used for page headers and section headers +- **`