How skolaczk/next-starter works
Main Components
• Frontend Layer: Represented by the Next.js App (found in the src/app directory), UI components (in src/components and its subdirectories), and styling (in src/styles). This layer includes the pages, layouts, and components that make up the user interface.
• Server Actions & Utilities: The src/actions directory contains server actions (e.g., hello-action.ts) that likely encapsulate business logic. Likewise, the src/lib folder holds important utilities such as database configurations (prisma.ts), Stripe integration (stripe.ts), and other helper functions.
• Database: The prisma directory holds the Prisma schema (schema.prisma) and its migrations, which define the data models and database evolution.
• Testing: With both unit and end-to-end tests set up in src/__tests__/unit and src/__tests__/e2e, include a component that represents the testing framework infrastructure (Jest and Playwright configuration files).
• Configuration & Tooling: Top-level config files (e.g., next.config.js, tailwind.config.ts, .eslintrc.js, .prettierrc.js) indicate the development and deployment pipeline. GitHub workflows in .github/workflows capture CI/CD aspects.
• Internationalization (i18n): The src/messages directory (and project.inlang config) suggest built-in support for multilingual support.
• Authentication & Authorization: Although part of the API layer, note that next-auth is a critical integration for handling user authentication.
Relationships and Interactions
• The Frontend interacts with the API endpoints for authentication and Stripe payments.
• Components from the Frontend layer consume data and services provided by server actions and utilities from the src/lib directory.
• Database operations are abstracted via Prisma, connecting the API layer’s business logic to the underlying database.
• Testing layers interact with both the frontend (React Testing Library and unit tests) and the API logic (Playwright for e2e tests) to verify system functionality.
• Deployment and CI/CD pipelines (GitHub actions, Husky, Commitlint) assure quality and consistency before code integration.
Architectural Patterns & Technologies
• Next.js App Router is utilized to separate routes, enable server-side processing, and further isolate API endpoints.
• Separation of concerns is clearly visible: UI components, server actions, database models, and utilities are all organized in their own directories.
• Use of industry-standard tools:
• Next.js, React, and Typescript for the frontend.
• Prisma and a dedicated migration folder for database operations.
• Stripe for payment processing and next-auth for authentication.
• TailwindCSS and Shadcn/ui for styling and a customizable interface.
• Standard testing frameworks (Jest, Playwright) for automated testing.
• Environment management with T3-env, ESLint, Prettier, and Husky ensures rapid and consistent development.
Essential Elements
• A block for the Frontend, subdividing into pages, components, and styling.
• A block for the API Layer showing separate endpoints for authentication and payments.
• A Database block showing the Prisma ORM and how migrations are applied.
• A testing block explaining how unit and e2e tests are set up.
• Additional blocks or notes for configuration and CI/CD that connect to both the development workflow and deployment pipeline.