How krnsa/aura works
Project Type and Purpose
• This is a full-stack social media and e-commerce platform.
• The frontend is built on vanilla HTML, CSS, and JavaScript (using ES Modules) and operates as a Multi-Page Application (MPA).
• The backend uses Node.js with a REST API and integrates with Supabase for the database (PostgreSQL), authentication, and storage.
• It uses JWT-based authentication to secure user management, post management, and notifications.
Main Components
• Frontend Application
• Components: HTML pages (index.html, profile.html, etc.), CSS and JavaScript modules (e.g., login.js, profile.js, shop.js).
• Special aspects: Hot-reload capability provided through the frontend-server.js using WebSocket.
• Backend Application
• Components: The Node.js server (server.js), API endpoints (files in backend/src/api such as createPost.js, deletePost.js, getPosts.js, etc.), authentication (backend/src/auth/auth.js), and business logic/implementations for posts and notifications.
• Routing: The router defined in backend/src/router.js that ties the REST API together.
• External Integration – Supabase
• Components: Database operations, authentication services, and storage (files in backend/src/supabase/supabaseClient.js).
• Role: Acts as the data store and authentication provider.
Relationships and Interactions
• Backend validates user requests (using JWT authentication) and performs business logic steps such as creating posts, deleting posts, and managing notifications.
• Optionally, illustrate the Hot-Reload connection between the frontend (via frontend-server.js) and the browser, using WebSocket connections to show real-time updates during development.
Architectural Patterns and Design Principles
• Separation of Concerns: Clearly distinguish between frontend and backend responsibilities.
• Modularization: Show how the backend code is organized into API endpoints, authentication modules, and implementations, while the frontend splits functionality across different pages and JS modules.
• RESTful Design: Highlight the API endpoints and their RESTful nature.
• Integration with Third-Party Services: Emphasize the Supabase integration for handling persistent data and storage.
Technologies, Frameworks, and Libraries
• Frontend: HTML, CSS, JavaScript with ES Modules, and the Fetch API.
• Backend: Node.js, Express-like routing (custom router in this case), nodemon for hot reload.
• External: Supabase for database, auth, and storage; JWT for authentication.
• Deployment: Frontend is deployed on Vercel; backend can be hosted on platforms like Railway or Heroku.