How juaneduardo-dev/blogger-app-frontend works
Project’s main components
• Frontend Application: Represented by the Next.js “src/app” folder which houses page routes for authentication (/login, /register, /forgot-password, /reset-password) and proposal-related pages (e.g., mis-propuestas, propuesta, temas). This includes the layout components (Navbar, Footer, session provider, UI components with Chakra UI, Shadcn, and others).
• API Layer: The “src/app/api” directory covers endpoints for authentication (NextAuth routes, forgot-password, register, reset-password), proposal operations (create, edit, delete, retrieve), user operations (get, put, delete), and other endpoints for degrees, publications, and reactions.
• Database Layer: The “prisma/schema.prisma” file indicates use of Prisma as an ORM to interact with the underlying database.
• Static Assets and Public Resources: The “public” directory provides static files like images used in the blog posts and other UI elements.
• Utility and Service Components: Directories like “src/lib”, “src/utils”, “src/context”, “src/hooks”, and “src/types” contain supporting code such as authentication helpers, utility functions, UI state management, and type definitions.
Relationships and interactions
• The Frontend interacts with the API layer. User-triggered actions (login, post proposal, comment, like, etc.) cause HTTP requests to API endpoints managed under “src/app/api”.
• The API endpoints then utilize Prisma (see “src/lib/prisma.ts” and “prisma/schema.prisma”) to perform database operations—reading and writing user data, proposals, interactions, etc.
• UI components interact with context providers (e.g., UserContext) and hooks for state management, offering a responsive and dynamic user experience.
• Static assets from the “public” folder support visual elements and possibly caching in the deployment configuration.
Architectural patterns and design principles
• Separation of Concerns: Clear separation between client-side rendering (React components/pages), server-side API routes, and database logic.
• MVC-like Organization: The Next.js routing structure effectively decouples views (pages) from business logic (API endpoints) and data models (prisma schema).
• Modular Component Design: Use of shared components (layout, UI components, hooks) demonstrates modularity and reuse.
• Secure and Robust Authentication: Dedicated API routes and authentication libraries (NextAuth) indicate attention to secure user sessions and data protection.
Relevant technologies, frameworks, and libraries
• Next.js for full-stack rendering and routing.
• Prisma as the ORM to interface with the database.
• NextAuth (via routes in /api/auth) for authentication.
• UI Libraries such as Chakra UI, Shadcn UI, and custom components for a responsive design.
• Tailwind CSS (tailwind.config.ts) for design/custom styles.
• Components with clear labels (e.g., “Frontend – Next.js Pages”, “API Endpoints – Authentication”, “Database – Prisma Schema”, “Static Assets”).
• Modular design by grouping related components (authentication routes, publication management, UI components) and showing dependencies (e.g., which API endpoints interact with which database models).