Pocket Naturalist is a gamified, location-based wildlife tracking and park management platform. Built to bridge the gap between software engineering and wildlife conservation, it empowers park visitors to explore responsibly while providing park rangers with powerful geospatial analytics.
Interactive Topographic Maps: Discover nearby trailheads, visitor centers, and active wildlife hotspots. Geofenced Check-Ins: Earn points and unlock digital badges by physically visiting specific park features. Validated backend-side using strict GPS proximity checks.
Wildlife Reporting: Snap a photo and report animal sightings to help fellow hikers and park researchers. Swipeable Discovery Feed: A seamless, touch-friendly UI built with Tailwind CSS to quickly flip through nearby alerts, features, and sightings.
Geospatial Analytics: View heatmaps of visitor traffic, calculate the popularity of specific trails, and track returning vs. new visitors.
Park Configuration: Dynamically draw and update park boundaries (Polygons) and trailheads (Points) directly from the dashboard.
This project is structured as a Monorepo containing a Spring Boot REST API and a cutting-edge Angular 21 front-end.
Framework: Angular 21 (Leveraging strictly Standalone Components and the latest Control Flow syntax) Styling: Tailwind CSS (Custom themes, native scroll-snap carousels) Mapping: Leaflet.js for rendering responsive, interactive topographic maps. Architecture: Strictly separated "Smart" (Container) and "Dumb" (Presentational) components to maximize reusability and maintainability.
Framework: Java 21, Spring Boot 4.x Security: Spring Security with Stateless JWT Authentication and custom Role-Based Access Control (RBAC). A custom @PreAuthorize SpEL implementation ensures Admins can only modify parks they are explicitly assigned to manage. Database: PostgreSQL with the PostGIS extension for native spatial operations.
PostGIS Geofencing: Validating user check-ins isn't done with basic math; it utilizes PostGIS's ST_DWithin function on native Geometry(Point, 4326) columns to execute highly optimized, index-backed proximity searches. Optimized Analytics Schema: Designed a highly normalized database schema featuring a UserParkStat aggregate root to efficiently track daily check-ins (ParkVisit). This makes dashboard analytics queries (e.g., "Peak visitation hours" or "New vs. Returning visitors") lightning fast without complex, expensive table joins.
Prerequisites Java 21+ Node.js v20+ & Angular CLI (v21) Docker (for running the PostGIS database)
-
Database Setup
Spin up the PostGIS database using Docker:
docker run --name pocket-naturalist-db -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=password -e POSTGRES_DB=naturalist_db -p 5432:5432 -d postgis/postgis:15-3.3
-
Run the Spring Boot API
Navigate to the root directory and start the backend:
mvn spring-boot:run
(The API will be available at http://localhost:8080)
-
Run the Angular Front-End
Navigate to the frontend directory, install dependencies, and serve the app:
cd frontend npm install ng serve
(The UI will be available at http://localhost:4200)