How jwbfut/jawbts-website-next works
Overall Structure & Project Purpose
• Project Type: A full-stack web application (frontend built with Next.js) that integrates with back-end API services.
• Main Purposes: User authentication, personalized profile management, and music handling (adding, modifying, playing).
Main Components to Highlight
a. Frontend (Next.js Application)
• App Layer: This includes the primary routing (the “app” directory) which is organized into sections such as:
• Authentication (app/auth): Handles GitHub OAuth callbacks, logout, OTP, refresh token endpoints.
• Navigation (app/nav): Supports different pages such as a root navigation, profiles, and music pages (including add and modify features).
• Global Components: Shared layout (app/layout.tsx and app/nav/layout.tsx), styling (global.css, banner_styles.module.css), and error handling (app/not-found.tsx).
• Components Layer: Contains reusable logic (under components/logic) such as:
• Audio processing (audioFetcher, audioModified)
• Event bus for intra-component communication.
• Server actions logic for handling API calls.
• Utility functions (e.g., asyncUtils, authUtils, and various service-specific utils).
• UI Elements: Components for music lists, music player, navigation bar, and a redirect handler to encapsulate presentation and interactions.
b. Communication & Integration Points
• Back-end API Integration: As mentioned in the README, this project requires connectivity with the Jawbts API Next service. Mark this as an external service that interfaces with the frontend (e.g., for user data, music data, etc.).
• GitHub OAuth2.0 for authentication.
• TailwindCSS for styling.
• MP4Box.js and ffmpeg.wasm for media file processing.
• jose for JWT encryption/decryption.
• node-qrcode for QR code generation.
• Vercel deployment for hosting.
• “Navigation & Profiles” module: This shows how user navigation (app/nav) is structured, with a separate branch for the profiles page.
• “Music Module”: Emphasize components under app/nav/music; include the add, modify and main music pages. Complement this with corresponding UI components (e.g., musicPlayer.jsx, musicListModifer.tsx) and the logic layers which handle audio processing.
• “Core Layout & Global Styling”: Indicate that the app uses Next.js page layouts with app/layout.tsx and app/nav/layout.tsx for consistent styling and routing. This layer ensures a unified look and feel.