How lukaprsina/jknm works
Project’s Purpose & Main Technologies
• The README (“Jamarski klub Novo mesto”) and file structure indicate this is a website. The heavy use of Next.js (with a “src/app” folder, API routes, and Next.js configuration files like next.config.mjs) confirms it is a modern full-stack web application.
• Notice the use of MDX pages (e.g., src/app/(static)/klub/page.mdx and similar in other subdirectories), which means static content is mixed with dynamic content.
• The presence of “drizzle” directories (with SQL migration files and schemas) indicates a relational database managed via Drizzle ORM.
• There are integrations with external services: AWS S3 (in components/aws-s3 and s3-publish scripts), Backblaze B2 (upload_file_to_b2 API endpoint), and Supabase (api/wake_supabase).
• A rich UI component library, along with Tailwind CSS and various ESLint/Prettier configurations, rounds out modern front-end techniques.
Main Components
a. Frontend (Client/Presentation Layer):
• Next.js Application pages: Represented mainly by the “src/app” folder that contains different page groups (static pages for klub, publiciranje, raziskovanje, etc., as well as dynamic pages like novica and avtorji).
• MDX-based static content, responsive layouts, and UI components housed in “src/components” (with dedicated sections for articles, the shell, UI elements, and navigation).
• Client-side utilities and hooks (“src/hooks”) that manage interactions such as infinite scrolling, notifications, or editor mutations.
b. Backend (Server/API Layer):
• API endpoints in “src/app/api”: including authentication ([...nextauth] routes), sending messages, file upload to B2, and waking up Supabase.
• Server-side logic located in “src/server”: managing article operations (create-draft, delete, publish, etc.), author management, and database queries.
• Middleware (src/middleware.ts) for request handling.
• Conversion logic (under src/app/converter) that includes server and client converter files, image generation, and data parsing.
c. Database Layer:
• Relational database schema/migrations managed by tools in the “drizzle” folder (drizzle/schema.ts, relations.ts) that hints at a SQL-based setup.
• The “src/server/db” directory which handles database operations and state caching.
d. External Integrations:
• AWS S3: Evident through components in “src/components/aws-s3” and s3-publish scripts inside “src/lib”.
• Backblaze B2: Via the “src/app/api/upload_file_to_b2” endpoint for file uploads.
• Supabase: An integration indicated in “src/app/api/wake_supabase”.
e. Supporting Tools & Scripts:
• Utility scripts in the “scripts” directory for tasks like renaming, generating TOC, and image manipulation.
• Development tools and config files (e.g., ESLint, Prettier, Tailwind CSS, and the Vercel deployment descriptor).
Establishing Relationships and Interactions
• Demonstrate that the backend server interacts with the Database via Drizzle ORM and SQL migrations. Indicate how articles or authors are queried and updated.
• Connections from the backend to external services (AWS S3 for file storage, Backblaze B2 for file uploads, and Supabase for additional functionality).
• Out the conversion tools – showing how the converter components process and manipulate data/images before being rendered or stored.
Architectural Patterns & Design Principles
• Separation of concerns: Distinguish between frontend presentation, backend logic, and data persistence.
• Full-stack integration: The Next.js paradigm that blends client and server code in a single repository.
• Modular design: Components are divided logically (e.g., UI vs. API vs. server operations) and externalized via scripts and utilities.
• Use of server components and API routing to ensure that both static and dynamic content are handled appropriately.
• Demonstration of how middleware or context providers (e.g., editor context, shell context) integrate into the app.
Specific Elements
• Use clear labels for each component: “Next.js Pages & Components”, “API Endpoints (auth, file upload, wake_supabase)”, “Server-side Article & Author Management”, “Database (Drizzle ORM)”, “AWS S3 & Backblaze B2 Storage”, and “Utility/Conversion Scripts”.
• From client browsers to the Next.js application.
• From API/server services to the Database and external services.
• Below that, represent the Next.js application layer that includes both static (MDX pages and UI components) and dynamic routes.
• On a parallel track, detail the API endpoints and server logic – from authentication, sending data, and conversion tasks.
• Link the server layer to the Database (show the Drizzle ORM and SQL migrations) and external services (AWS S3, Backblaze B2, Supabase).
• Finally, include utility scripts and development tools as side components that feed into the build and deployment process.