How dhecaptain/trashcash works
TrashCash is a React frontend for coordinating waste collection and related payments among vendors, cleaners, and government users. The visible route flow starts at the app shell, which routes visitors to public information or role-oriented account and operations pages; protected routes gate the dashboard, bin reporting, and payments. The sampled authentication context uses mock users and browser storage, and the theme context persists display preference. The README is a generic Vite template, and unsampled page implementations limit evidence about how collection work is actually dispatched or completed.
Main entry points: App.tsx Router and providers · ProtectedRoute.tsx Protected route · AuthContext.tsx Authentication state · Navbar.tsx Navigation
Components 19
Application shell
- React entry
src/main.tsx - Router and providers
src/App.tsx - Navigation
src/components/Navbar.tsx - Footer links
src/components/Footer.tsx
Public information
- Home
src/pages/HomePage.tsx - Platform overview
src/pages/AboutPage.tsx - Business information
src/pages/BusinessPage.tsx - Cleaner information
src/pages/CleanersPage.tsx
Access and preferences
- Login
src/pages/LoginPage.tsx - Signup
src/pages/SignupPage.tsx - Authentication state
src/context/AuthContext.tsx - Theme preference
src/context/ThemeContext.tsx
Waste operations
- Protected route
src/components/ProtectedRoute.tsx - Dashboard
src/pages/DashboardPage.tsx - Report full bin
src/pages/ReportBinPage.tsx - Payments and wallet
src/pages/PaymentsPage.tsx - Waste domain types
src/types/index.ts
Other components
- Visitor or user
- Browser local storage
Connections 24
- Visitor or user → React entry: opens app
- React entry → Router and providers: mounts
- Router and providers → Navigation: renders
- Router and providers → Footer links: renders
- Router and providers → Home: routes to
- Router and providers → Platform overview: routes to
- Router and providers → Business information: routes to
- Router and providers → Cleaner information: routes to
- Router and providers → Login: routes to
- Router and providers → Signup: routes to
- Router and providers → Protected route: protects routes
- Protected route → Dashboard: allows access
- Protected route → Report full bin: allows access
- Protected route → Payments and wallet: allows access
- Router and providers → Authentication state: provides state
- Router and providers → Theme preference: provides state
- Navigation → Authentication state: uses auth state
- Navigation → Theme preference: uses theme state
- Authentication state → Browser local storage: reads and writes
- Theme preference → Browser local storage: reads and writes
- Payments and wallet → Authentication state: reads user
- Dashboard → Waste domain types: uses types
- Report full bin → Waste domain types: uses types
- Payments and wallet → Waste domain types: uses types