How mynameiskry/noname-forum works
• Frontend (client): Represent the Next.js application. This includes:
• Core pages (authentication and main sections)
• Sub-components like Header, Footer, Sidebar, Post, and others.
• Utility components and hooks.
• Backend (server): Represent the Fastify server.
• Controllers (auth, post, comment, user, category)
• Route definitions split between public and private endpoints (authentication, posts, etc.)
• Middlewares (authentication, isAdmin)
• Utilities (token generation, caching, sending mail)
• Database: Represent the Sqlite3 database accessed via Prisma.
• Schema definition (via Prisma’s schema.prisma)
• External Services: For example, Google OAuth2, email services (Gmail) and possibly OTP verification.
Relationships and interactions
• The Backend handles these HTTP/REST API calls (using Fastify routes) and, when needed, performs business logic via controllers and services.
• That the Backend communicates with the Database through Prisma ORM.
• External integrations (Google OAuth2 for authentication, email services for verification).
Architectural patterns
• The separation of concerns for client and server is clear: a distinct frontend (Next.js app) and backend (Fastify server).
• On the backend, there’s a modular approach using controllers, services, and middleware which resembles a layered architecture.
• The RESTful API routing (public/private routes) demonstrates a clear separation of endpoints.
• The use of Prisma encapsulates the interaction with the database, a best practice for data access abstraction.
Important technologies
• Frontend: Next.js, MUI, Tailwind CSS, and FontAwesome.
• Backend: Node.js with Fastify.
• Database: Sqlite3 managed via Prisma.
• Authentication flows: Implemented using JWT tokens, Google OAuth2, and OTP (indicated by the auth and refresh token routes).