A Full-Stack Web Application for Creating a Digital Forest Map
Pin-a-Tree enables users to upload tree photos, share their planting stories, and create a collaborative map of environmental impact. Currently featuring complete user authentication, tree management, and an interactive map interface.
The Pin-a-Tree application is fully functional with both frontend and backend implemented. Users can register, login, add trees with photos and location data, and view all trees on an interactive map.
-
User Authentication & Authorization
- User registration and login
- JWT-based authentication
- Protected routes and API endpoints
- Persistent login sessions
-
Tree Management
- Upload tree photos with EXIF data extraction
- Add tree metadata (species, planting date, description)
- Automatic and manual location pinning
- View personal and community trees
-
Interactive Mapping
- Leaflet-powered map interface
- Tree location markers with popup details
- Real-time tree display from database
- Mobile-responsive map controls
-
Full-Stack Architecture
- RESTful API with proper error handling
- PostgreSQL database with Prisma ORM
- Image upload and processing
- CORS-enabled cross-origin requests
- Vue 3 with Composition API
- Vite for fast development and building
- Pinia for state management
- Vue Router for navigation and route guards
- Leaflet for interactive maps
- Axios for HTTP requests
- SASS/SCSS with BEM methodology
- Node.js with Express.js
- TypeScript for type safety
- Prisma ORM with PostgreSQL database
- JWT for authentication
- Multer for file uploads
- Sharp for image processing
- Joi for request validation
- PostgreSQL database
- Docker support (configured)
- Environment variables for configuration
- TSX for TypeScript execution
- Node.js 18+ and npm
- PostgreSQL database
- Git
-
Clone the repository
git clone https://github.com/azorica/pin-a-tree.git cd pin-a-tree -
Install frontend dependencies
npm install
-
Install backend dependencies
cd backend npm install -
Set up the database
# Create .env file in backend directory cp .env.example .env # Edit .env with your database credentials # DATABASE_URL="postgresql://username:password@localhost:5432/pin_a_tree" # JWT_SECRET="your-secret-key" # Generate Prisma client and push schema npm run db:generate npm run db:push
-
Start the development servers
Backend (in
backend/directory):npm run dev # Server runs on http://localhost:3001Frontend (in root directory):
npm run dev # App runs on http://localhost:5173 -
Access the application
- Frontend: http://localhost:5173
- Backend API: http://localhost:3001/api
- API Health Check: http://localhost:3001/api/health
pin-a-tree/
โโโ src/ # Frontend Vue.js application
โ โโโ components/ # Reusable Vue components
โ โโโ views/ # Page components
โ โโโ stores/ # Pinia state management
โ โโโ services/ # API service functions
โ โโโ router/ # Vue Router configuration
โ โโโ styles/ # SCSS stylesheets
โ โโโ composables/ # Vue composition functions
โโโ backend/ # Node.js backend API
โ โโโ src/ # TypeScript source code
โ โ โโโ routes/ # API route handlers
โ โ โโโ middleware/ # Express middleware
โ โ โโโ index.ts # Main server file
โ โโโ prisma/ # Database schema and migrations
โ โโโ uploads/ # File upload storage
โโโ docs/ # Project documentation
โโโ context-rules/ # Development guidelines
โโโ public/ # Static frontend assets
โโโ scripts/ # Setup and utility scripts
POST /api/auth/register- User registrationPOST /api/auth/login- User loginGET /api/auth/profile- Get user profile (protected)
GET /api/trees- Get all treesPOST /api/trees- Create new tree (protected)GET /api/trees/:id- Get specific treePUT /api/trees/:id- Update tree (protected)DELETE /api/trees/:id- Delete tree (protected)
GET /api/health- Health check endpointPOST /api/upload- Upload tree image (protected)
The application follows a comprehensive design system with:
- Color Palette: Green-focused environmental theme
- Typography: Inter and Poppins font families
- Components: Accessible, reusable UI components
- Layout: Responsive design with mobile-first approach
- Navigation: Intuitive user flows with proper routing
See /docs/UI_UX_doc.md for complete design specifications.
/docs/PRD.mdโ Product Requirements Document/docs/Implementation.mdโ Implementation roadmap/docs/architecture.mdโ System architecture/docs/tech-stack.mdโ Technology decisions/docs/UI_UX_doc.mdโ Design system/docs/Bug_tracking.mdโ Known issues and fixes
/context-rules/โ Code standards and best practices/docs/frontend-integration.mdโ Frontend/backend integration/docs/backend-implementation.mdโ Backend architecture
- Fork the repository
- Read the documentation in
/docs/and/context-rules/ - Follow the style guide and coding standards
- Create feature branches from
main - Write tests for new functionality
- Submit pull requests with detailed descriptions
- User authentication and authorization
- Tree CRUD operations with image upload
- Interactive map with tree markers
- Responsive UI with modern design
- RESTful API with proper error handling
- Database schema and ORM integration
- Enhanced tree filtering and search
- User profiles and statistics
- Tree achievement system
- Social features and tree sharing
- Advanced map features (clustering, filters)
- Mobile app development
- Performance optimizations
- Community challenges and events
- Environmental impact metrics
- Integration with tree-planting organizations
- Geolocation-based tree recommendations
- AI-powered tree species identification
For questions, bug reports, or feature requests:
- Issues: Use GitHub Issues for bug reports
- Documentation: Check
/docs/for detailed guides - Code Standards: Review
/context-rules/for guidelines
This project is licensed under the MIT License. See LICENSE file for details.
๐ณ Join us in creating a digital forest that celebrates environmental action! ๐
- Read this README for repo info and onboarding.
- Start with
/docs/PRD.mdfor product requirements and project generation. - Review
/docs/for detailed requirements, architecture, and plans. - Check
/context-rules/for coding standards and best practices. - If using AI agents, follow the prompts and workflow in
.cursor/rules/. - See
/docs/Bug_tracking.mdfor known issues and bug reporting.
To generate the project from scratch, an AI agent (or a well-trained human) should:
- Read
/docs/PRD.mdfor the product vision, user stories, and high-level requirements. - Consult
/docs/Implementation.mdfor the staged implementation plan and initial setup. - Review
/docs/architecture.mdfor the intended folder structure, state management, and integration rules. - Check
/docs/tech-stack.mdfor the frameworks, libraries, and tools to use. - Reference
/docs/project_structure.mdfor the up-to-date file/folder map. - Follow
/docs/UI_UX_doc.mdfor design system, branding, and user flows. - Apply all rules in
/context-rules/for code style, best practices, and AI collaboration. - Use
.cursor/rules/for agent prompts and workflow. - Log and resolve bugs in
/docs/Bug_tracking.mdas the project evolves.
This ensures a consistent, context-driven, and high-quality build process for both humans and AI.
The goal of Pin-a-Tree is to create a digital forest โ a living, growing map that celebrates the positive environmental actions of individuals and communities. It promotes environmental education, community engagement, and a sense of connection to nature.
-
Upload a Tree Photo
Take or upload a photo of a tree you planted or admire. -
Provide Tree Info
Add basic details (e.g. tree name, species, date planted โ more TBA). -
Auto-detect Location
The app extracts the GPS coordinates from the photoโs metadata (EXIF). If missing, users can manually pin the location. -
Pin to Map
The tree appears on a collaborative Google Map with your photo and data. -
View Othersโ Trees
Browse trees pinned by other users and explore a global map of green activity.
- Eco-conscious individuals
- Schools & environmental educators
- Community tree-planting initiatives
- NGOs and sustainability programs
- Frontend: Vue 3 + Vite + Composition API + Pinia
- Map: Google Maps API
- Image Handling: EXIF data extraction
- Backend: To be determined (e.g. Firebase, Supabase, or Node backend)
Weโll define:
- Required tree metadata
- Folder & component structure
- Context constraints
- Feature prompts
Stay tuned ๐