How ismapereira/green-air works
Green Air is a PHP/MySQL collaborative urban-tree mapping application. The main workflow is user registration/authentication, tree submission with GPS and photo, contribution points and badges, and discovery through the map and personal dashboard. Separate features include rankings, public statistics, collaborative suggestions, weather/air-quality data, notifications, and admin management. Edges reflect only README statements, route declarations, or shown calls; unsampled capabilities are represented at their supported controller or directory paths.
Main entry points: web.php Route table · TreeController.php Tree submissions and CRUD · DashboardController.php User dashboard and APIs · Tree.php Tree records and map queries
Components 25
Web entry
- HTTP front controller
public/index.php - Route table
routes/web.php - Accounts and authentication
app/controllers/AuthController.php - Controller services
app/controllers/Controller.php
Tree mapping
- Tree submissions and CRUD
app/controllers/TreeController.php - Tree records and map queries
app/models/Tree.php - Species and preservation status
app/models/TreeSpecies.php - Image upload handling
app/helpers/UploadHelper.php - Map and tree views
app/views/map/index.php
Community engagement
- Contribution history
app/models/ContributionLog.php - Community suggestions
app/controllers/SuggestionController.php - Suggestion records
app/models/CommunitySuggestion.php - Achievement checks
app/helpers/BadgeChecker.php - Badge records
app/models/Badge.php - User notifications
app/models/Notification.php
Dashboards and insights
- User dashboard and APIs
app/controllers/DashboardController.php - User points and rankings
app/models/User.php - Weather response cache
app/helpers/CacheHelper.php - Ranking pages
app/controllers/RankingController.php - Public statistics
app/controllers/HomeController.php
Administration
- Admin management
app/controllers
Other components
- Visitor or user
- OpenWeather
- MySQL database
config/database.php - PDO model layer
app/models/Model.php
Connections 36
- Visitor or user → HTTP front controller: sends requests
- HTTP front controller → Route table: dispatches via
public/index.php - Route table → Accounts and authentication: routes auth requests
routes/web.php - Route table → Tree submissions and CRUD: routes tree requests
routes/web.php - Route table → User dashboard and APIs: routes dashboard APIs
routes/web.php - Route table → Community suggestions: routes suggestions
routes/web.php - Route table → Ranking pages: routes ranking
routes/web.php - Route table → Public statistics: routes statistics
routes/web.php - Route table → Admin management: routes admin requests
routes/web.php - Tree submissions and CRUD → Tree records and map queries: creates and updates
app/controllers/TreeController.php - Tree submissions and CRUD → Species and preservation status: uses catalog
app/controllers/TreeController.php - Tree submissions and CRUD → Image upload handling: validates uploads
app/controllers/TreeController.php - Tree submissions and CRUD → User points and rankings: awards points
app/controllers/TreeController.php - Tree submissions and CRUD → Contribution history: logs actions
app/controllers/TreeController.php - Tree submissions and CRUD → Achievement checks: checks achievements
app/controllers/TreeController.php - Map and tree views → Tree records and map queries: uses tree data
app/views/map/index.php - Community suggestions → Suggestion records: creates suggestions
app/controllers/SuggestionController.php - Community suggestions → Achievement checks: checks achievements
app/controllers/SuggestionController.php - Achievement checks → Badge records: checks and unlocks
app/helpers/BadgeChecker.php - Achievement checks → User notifications: notifies unlocks
app/helpers/BadgeChecker.php - Accounts and authentication → User points and rankings: registers users
app/controllers/AuthController.php - Accounts and authentication → User notifications: creates welcome notice
app/controllers/AuthController.php - User dashboard and APIs → Tree records and map queries: loads user trees
app/controllers/DashboardController.php - User dashboard and APIs → User points and rankings: loads contributors
app/controllers/DashboardController.php - User dashboard and APIs → Weather response cache: reads and writes
app/controllers/DashboardController.php - User dashboard and APIs → OpenWeather: requests weather data
app/controllers/DashboardController.php - User dashboard and APIs → User notifications: loads and marks read
app/controllers/DashboardController.php - Ranking pages → User points and rankings: loads ranking data
- Public statistics → Tree records and map queries: uses tree statistics
app/controllers/HomeController.php - Admin management → MySQL database: manages records
- Controller services → User notifications: counts unread
app/controllers/Controller.php - Tree submissions and CRUD → Controller services: inherits services
app/controllers/TreeController.php - PDO model layer → MySQL database: queries through PDO
app/models/Model.php - Tree records and map queries → PDO model layer: uses PDO helpers
app/models/Tree.php - User points and rankings → PDO model layer: uses PDO helpers
app/models/User.php - User notifications → PDO model layer: uses PDO helpers
app/models/Notification.php