How xxthunderblastxx/neoshare works
Main System Components
a. Frontend Layer:
• Located in /cmd/web
• Uses HTMX, HyperScript, and TailwindCSS
• Components include authentication, dashboard, and file management views
b. Backend Layer:
• Core API service in /cmd/api
• Multiple internal packages for business logic
• Authentication handling
• File management services
c. External Services:
• S3-compatible storage
• OIDC/Auth0 authentication
• PostgreSQL database
Architectural Pattern
The project follows a clean architecture pattern with clear separation of concerns:
• Handlers (HTTP/Web Interface)
• Services (Business Logic)
• Repositories (Data Access)
• Models (Domain Objects)
[Client Browser] ←→ [Frontend Layer (HTMX/Hyperscript)]
• ↓
[Backend API Layer]
• ↙ ↓ ↘
[Auth0] [S3] [PostgreSQL]
Client Layer
• Web Browser
• HTMX/HyperScript interactions
• TailwindCSS/DaisyUI styling
Frontend Components
• Authentication views
• Dashboard interface
• File management UI
• Template components
Backend Services
• API endpoints
• Authentication middleware
• Rate limiting
• Session management
• File service
• S3 service
External Services
• S3 Storage
• Auth0/OIDC Provider
• PostgreSQL Database
• Blue: Frontend components
• Green: Backend services
• Yellow: External services
• Red: Security/Authentication components
• Gray: Database/Storage
Relationships to Highlight:
Client-Server Communication
• HTMX requests
• File upload/download flows
• Authentication flows
Backend Interactions
• Database queries
• S3 storage operations
• Authentication verification
Data Flow
• File upload path
• File download path
• User authentication flow
Special Considerations:
Security Layer
• Middleware placement
• Rate limiting
• Token verification
Storage Flow
• File upload to S3
• Database metadata storage
• Direct download links
Authentication Flow
• OIDC authentication
• Callback handling
• Session management
Level of Detail:
• Keep high-level components visible
• Important middleware
• Primary data flows