How majibrin/btc-auth-dashboard works
This is a BTC dashboard with account registration and login, role-based admin user management, and Bitcoin price display. Users enter through the React app, register or log in through the authentication API, then reach the dashboard or admin view; the dashboard fetches BTC prices, while admins can retrieve user records. The backend stores account and login metadata in MongoDB and enriches signup/login details with IP and user-agent information. Source coverage is based on the supplied excerpts and index; unsampled subsystems and unshown wiring are omitted.
Main entry points: auth.js Auth and data routes · App.jsx App routes · Register.jsx Registration · Login.jsx Login
Components 15
Web app
- React entry
frontend/src/main.jsx - App routes
frontend/src/App.jsx - Registration
frontend/src/pages/Register.jsx - Login
frontend/src/pages/Login.jsx - BTC dashboard
frontend/src/pages/Dashboard.jsx - Admin panel
frontend/src/pages/Admin.jsx - API base config
frontend/src/config/api.js
Backend API
- Express server
backend/server.js - Auth and data routes
backend/routes/auth.js
Identity data
- User schema
backend/models/User.js - Request metadata
backend/utils/helpers.js
External services
- MongoDB
- BTC price providers
- Geo-IP fallback
Other components
- Visitor
Connections 20
- Visitor → React entry: opens app
frontend/src/main.jsx - React entry → App routes: renders
frontend/src/main.jsx - App routes → Registration: routes to
frontend/src/App.jsx - App routes → Login: routes to
frontend/src/App.jsx - App routes → BTC dashboard: routes to
frontend/src/App.jsx - App routes → Admin panel: routes to
frontend/src/App.jsx - Registration → API base config: reads base URL
frontend/src/pages/Register.jsx - Login → API base config: reads base URL
frontend/src/pages/Login.jsx - Admin panel → API base config: reads base URL
frontend/src/pages/Admin.jsx - Registration → Auth and data routes: posts registration
frontend/src/pages/Register.jsx - Login → Auth and data routes: posts login
frontend/src/pages/Login.jsx - Admin panel → Auth and data routes: fetches users
frontend/src/pages/Admin.jsx - BTC dashboard → Auth and data routes: fetches BTC price
frontend/src/pages/Dashboard.jsx - Express server → Auth and data routes: mounts routes
backend/server.js - Express server → MongoDB: connects to
backend/server.js - Auth and data routes → User schema: queries and saves
backend/routes/auth.js - Auth and data routes → Request metadata: parses request info
backend/routes/auth.js - Auth and data routes → BTC price providers: requests BTC prices
backend/routes/auth.js - User schema → MongoDB: persists user data
backend/models/User.js - Request metadata → Geo-IP fallback: uses fallback lookup
backend/utils/helpers.js