How hetthie/greenregister works
GreenRegister is a mobile plant-care tracker: users sign in, browse plant-care information, add plants, and record and review care activities. The documented product also includes per-species care intervals and last-activity indicators. The mobile screens and services are represented from the tree and README, but their implementations were not sampled; the sampled backend exposes authentication and basic plant creation/listing, so links to undocumented API behavior are intentionally omitted. The README describes a broader API and data model than the sampled backend confirms.
Main entry points: api.js API client · PlantDetail.js Plant details · Catalog.js Plant catalog · MyPlants.js My plants
Components 20
Mobile app
- Login and register
greenregister-mobile/src/pages/Login.js - Session context
greenregister-mobile/src/context/AuthContext.js - Auth service
greenregister-mobile/src/services/auth.js - API client
greenregister-mobile/src/services/api.js - Plant catalog
greenregister-mobile/src/pages/Catalog.js - Catalog details
greenregister-mobile/src/pages/CatalogDetail.js - My plants
greenregister-mobile/src/pages/MyPlants.js - Plant details
greenregister-mobile/src/pages/PlantDetail.js - Care activity form
greenregister-mobile/src/pages/RegisterActivity.js - Activity history
greenregister-mobile/src/pages/ActivityHistory.js - Home dashboard
greenregister-mobile/src/pages/Home.js
Backend API
- Express server
backend/server.js - Auth routes
backend/src/routes/auth.routes.js - Auth controller
backend/src/controllers/authController.js - Plant routes
backend/src/routes/planta.routes.js - Plant controller
backend/src/controllers/plantaControllers.js - JWT middleware
backend/src/middlewares/authMiddleware.js
Persistence
- Database pool
backend/src/config/db.js - PostgreSQL
Other components
- Plant owner
Connections 27
- Plant owner → Login and register: enters credentials
- Login and register → Auth service: requests auth
- Session context → Auth service: loads session
- Auth service → API client: sends requests
- Plant owner → Plant catalog: browses plants
- Plant catalog → Catalog details: opens details
- Plant owner → My plants: views collection
- My plants → Plant details: opens plant
- Plant details → Care activity form: starts activity
- Plant details → Activity history: opens history
- Plant owner → Home dashboard: views dashboard
- Plant catalog → API client: requests catalog
- Catalog details → API client: requests plant data
- My plants → API client: requests collection
- Plant details → API client: fetches and deletes
- Care activity form → API client: submits activity
- Activity history → API client: requests history
- API client → Express server: sends HTTP requests
- Express server → Auth routes: dispatches auth
- Express server → Plant routes: dispatches plants
- Auth routes → Auth controller: dispatches handlers
- Plant routes → JWT middleware: checks protected routes
- JWT middleware → Plant controller: continues authorized request
- Plant routes → Plant controller: dispatches handlers
- Auth controller → Database pool: queries users
- Plant controller → Database pool: queries plants
- Database pool → PostgreSQL: connects pool