How arkanullahs/booknest works
Main Components
a. Frontend
• React application (located under the frontend folder).
• Major UI components such as AdminDashboard, PublisherDashboard, UserDashboard, Login/Signup, Navbar, Landing page, etc.
• Client-side routing and interactions with the backend through an API.
b. Backend
• Laravel framework (backend folder) structured using controllers, models, middleware, services, and providers.
• Authentication & Authorization: API endpoints for registration and login, JWT middleware for auth, and role-based middleware (admin, publisher, user).
• API endpoints serve functionalities for book search, order management, user profiles, and publisher functionalities.
• Application configuration (config files), migrations for database setup, and service components (JwtService, TestService).
c. Database
• MySQL as the database (as specified in the README).
• Schema managed via migrations found in the backend/database/migrations folder.
d. External & Supporting Services
• JWT authentication mechanism (via a JWT package installed on the backend).
• Possibly other external services such as payment integrations (not specified but common in e‑commerce) or external APIs.
Representing Relationships and Interactions
a. Frontend ⇄ Backend Communication
• Clearly label API endpoints (for authentication, profile management, book searches, order creation, etc.) as defined in the README.
b. Backend Internal Structure
• Within the backend, show a separation of layers:
• Controllers – handling HTTP requests (e.g., AuthController, TestController).
• Middleware – securing routes with JWT and role-based access (e.g., JwtMiddleware, RoleMiddleware).
• Services – encapsulating business logic (e.g., JwtService, TestService).
• Models – representing database entities (e.g., User model).
• Providers & configuration – bootstrapping and managing application initialization.
c. Database Connectivity
Architectural Patterns and Design Principles
a. Separation of Concerns:
• Clearly delimit the frontend (view) from backend (API/business logic and persistence).
• In the backend, isolate authentication, business logic, and infrastructure (database) into separate modules.
b. RESTful API:
c. Middleware for Security:
• JWT authentication mechanism and role-based middleware as key security features.
d. Modular and Scalable:
• How both the frontend (with individual React components for dashboards, pages, etc.) and backend (with different controllers/services) are built to be extensible as new features or microservices are added.