How lelecodedev/borrowly works
Borrowly manages item lending across borrower, officer, and admin roles. The main workflow is a borrower browsing inventory and requesting an item, an officer or admin reviewing the request, and the borrower returning the item while staff monitor return status. The frontend routes role-specific pages through authentication and API hooks; the Go backend is organized into handlers, services, repositories, and database access. README features also include catalog/user/category administration, dashboards, activity logs, and officer reports. Backend internals were not excerpted, so their links are shown only as unverified where needed.
Main entry points: App.tsx Role-based routes · main.go HTTP server · repository Data repositories · handler Handlers and services
Components 21
Web application
- Role-based routes
frontend/src/App.tsx - Role guard
frontend/src/guards/AuthGuard.tsx - Authentication state
frontend/src/hooks/api/useAuth.ts - Borrow requests
frontend/src/pages/admin/AdminBorrowRequestPage.tsx - Return views
frontend/src/pages/admin/AdminReturnPage.tsx - Catalog and admin
frontend/src/pages/admin/AdminItemPage.tsx - Role dashboards
frontend/src/pages/admin/AdminDashboard.tsx - Activity log
frontend/src/pages/admin/AdminLogPage.tsx - Borrow queries
frontend/src/hooks/api/useBorrow.ts - Return queries
frontend/src/hooks/api/useReturn.ts - Auth API client
frontend/src/api/authApi.ts - Borrow API client
frontend/src/api/borrowApi.ts - Return API client
frontend/src/api/returnApi.ts
Backend API
- HTTP server
backend/cmd/server/main.go - Handlers and services
backend/internal/handler - Data repositories
backend/internal/repository
Lending operations
- Borrow and return rules
backend/internal/service - Catalog and users
backend/internal/service - Officer reports
backend/internal/service
Persistence
- MySQL database
backend/internal/database/database.go
Other components
- Borrower / staff
Connections 23
- Borrower / staff → Role-based routes: uses
README.md - Role-based routes → Role guard: protects routes
frontend/src/App.tsx - Role guard → Authentication state: checks identity
frontend/src/guards/AuthGuard.tsx - Authentication state → Auth API client: calls
frontend/src/hooks/api/useAuth.ts - Role-based routes → Borrow requests: routes to
frontend/src/App.tsx - Role-based routes → Return views: routes to
frontend/src/App.tsx - Role-based routes → Catalog and admin: routes to
frontend/src/App.tsx - Role-based routes → Role dashboards: routes to
frontend/src/App.tsx - Role-based routes → Activity log: routes to
frontend/src/App.tsx - Borrow requests → Borrow queries: queries
frontend/src/pages/admin/AdminBorrowRequestPage.tsx - Return views → Return queries: queries
frontend/src/pages/admin/AdminReturnPage.tsx - Borrow queries → Borrow API client: calls
frontend/src/hooks/api/useBorrow.ts - Return queries → Return API client: calls
frontend/src/hooks/api/useReturn.ts - Auth API client → HTTP server: HTTP requests
- Borrow API client → HTTP server: HTTP requests
- Return API client → HTTP server: HTTP requests
- HTTP server → Handlers and services: dispatches
- Handlers and services → Borrow and return rules: delegates
- Handlers and services → Catalog and users: delegates
- Borrow and return rules → Data repositories: uses
- Catalog and users → Data repositories: uses
- Officer reports → Data repositories: reads data
- Data repositories → MySQL database: persists data