How manterolaenrique/guitar-app-git works
Project type and purpose
• This is a full-stack (front-end heavy) web application built with Next.js and React, designed to provide interactive guitar tools: scale visualizer, chord charts, circle of fifths, and a tuner.
• There is no custom back-end API; all data (chord formulas, scale data, circle-of-fifths notes) is served as static modules. The tuner uses the browser’s Web Audio API via a custom hook.
File structure
• app/ – file-based routing for Next.js pages (SSR/SSG).
• components/ – reusable UI pieces (ChordInfo, Tuner, Navbar, etc.).
• contexts/ – React Contexts for global state (theme, notation).
• hooks/ – custom hooks, e.g. useMicrophone.
• data/ – static data modules for chords, scales, circle of fifths.
• utils/ – helper functions (noteConverter, theme utilities).
• styles/ & globals.css, tailwind.config.js – global and Tailwind CSS configurations.
Key insights from README
• Built with Next.js (React + TypeScript) and Tailwind CSS.
• No external APIs; all functionality is client-side, except Next.js serving pages.
• Deployed as a static/SSR site (e.g. Vercel).
Main components
a. User Browser (Client)
• Renders HTML/CSS/JS, runs React.
• Requests microphone access via Web Audio API.
b. Next.js Server / CDN
• Serves pre-rendered pages or static bundles.
• Hosts static assets from public/.
c. React Application Layers
• Pages (app/*) – route handlers, layout.tsx, page.tsx.
• UI Components (components/) – chord viewer, tuner UI, circle of fifths.
• State Management (contexts/) – theme, notation selection.
• Business Logic (hooks/, utils/) – microphone access, note conversion.
• Data Layer (data/) – chord formulas, scale formulas, circle data.
d. Static Assets (public/, styles/)
• Images, CSS, Tailwind configuration.
Relationships and interactions
• Browser → Next.js Server: HTTP GET for pages & JS bundles.
• Browser ↔ React: Client-side hydration, routing, component rendering.
• React → Data Modules: import static data from data/*.ts to render scales/chords.
• React → Contexts: read/write global theme & notation state.
• React → Hooks: useMicrophone requests audio input, streams data to Tuner component.
• Browser → Web Audio API: capture audio for tuning.
Architectural patterns & principles
• File-based Routing: Next.js app directory structure.
• Component-Driven UI: granular React components.
• Context API: global cross-cutting concerns (theme, notation).
• Static Data Modules: no database, pure in-repo data.
• SSR/SSG: pages pre-rendered, static export ready.