A hybrid community content management platform with social network features, focused on plants and calm places.
Dirty Roots is a multimodal platform that combines:
- Administrative CMS for content management
- Niche social network focused on plants
- Installable PWA with offline capabilities
- Marketplace with discount system
- Geospatial directory of calm places
- Embeddable widgets for external sites
- Frontend: Next.js 16.0.7 + React 19.2.0 + TypeScript
- Backend: Firebase (Firestore + Authentication + Admin SDK)
- PWA: next-pwa + Service Worker
- Maps: Leaflet + geofire-common
- Forms: react-hook-form + Zod
- Desktop: Electron 39.1.2
The system implements four access levels:
| Level | Component | Authentication | Access |
|---|---|---|---|
| Anonymous | None | signInAnonymously() |
Public widgets |
| User | UserProtectedRoute |
Email/Password | Community |
| Admin | ProtectedRoute |
Email/Password | Content CRUD |
| Owner | OwnerRoute |
Email + Role check | Admin management |
pwa/
βββ app/
β βββ page.tsx # Admin Console
β βββ auth/page.tsx # Admin login
β βββ user-auth/page.tsx # User login/registration
β βββ community/
β β βββ herbarium/ # Plant gallery
β β βββ profile/ # User profiles
β β βββ questions/ # Community Q&A
β βββ brands/
β β βββ page.tsx # Brand management
β β βββ embed/page.tsx # Public widget
β βββ embed/map/ # Embeddable map
β βββ [other modules]/
βββ src/
β βββ lib/
β β βββ firestore.ts # Centralized data layer
β β βββ firebase.ts # Firebase config
β βββ components/
β βββ ProtectedRoute.tsx # Admin guard
β βββ UserProtectedRoute.tsx # User guard
β βββ OwnerRoute.tsx # Owner guard
βββ public/
βββ manifest.json # PWA config
βββ sw.js # Service Worker
- Node.js 18+
- Firebase account
- Environment variables configured
# Clone repository
git clone https://github.com/madgIitch/Dirty-Roots.git
cd Dirty-Roots/pwa
# Install dependencies
npm install
# Configure Firebase
# Copy .env.example to .env.local
# Add Firebase credentials
# Run development
npm run dev
# Production build
npm run build
npm startCentralized panel with access to:
- πΊοΈ Places: Calm places management
- π οΈ Community Admin: Content moderation
- ποΈ Live Sessions: Live sessions
- ποΈ Shop: Product management
- πΏ Seasonal Toolkit: Seasonal guides
- π·οΈ Brands: Partner brands
- π Discount Tiers: Discount levels
- π₯ Admins Console: Administrator management
Social network for sharing plant photos with:
- 13 thematic categories (New Leaf, Comeback Story, etc.)
- Like and comment system
- User profiles with progress
- Invitation and reward system
Public components for external integration:
/brands/embed- Brand carousel/embed/map- Places map/live/embed- Live sessions- Automatic anonymous authentication
Installable application with:
- Standalone mode
- Portrait orientation
- Service Worker for offline
- 512x512 icons
- Direct shortcuts to Herbarium
The centralized data layer manages 13+ collections:
| Collection | Use | Key Functions |
|---|---|---|
places |
Calm places | addPlace(), listPlacesNear() |
plantPhotos |
Community gallery | addPlantPhoto(), addLikeToPhoto() |
userProfiles |
User profiles | createUserProfile(), updateUserProfile() |
brands |
Partner brands | addBrand(), listBrands() |
liveSessions |
Live sessions | addLiveSession(), addSeatReservation() |
discountTiers |
Discount levels | addDiscountTier(), checkDiscountEligibility() |
Security rules implement:
- Public reading for specific collections
- Writing only for authenticated users
- Role validation for admin operations
- User profile protection
npm run build
npm startnpm run electron-build
# Generates:
# - Windows: NSIS installer
# - macOS: DMG
# - Linux: AppImageNEXT_PUBLIC_FIREBASE_API_KEY=
NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=
NEXT_PUBLIC_FIREBASE_PROJECT_ID=
NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET=
NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID=
NEXT_PUBLIC_FIREBASE_APP_ID=- Background:
#0B0B0B(dark) - Primary:
#A4CB3E(lime green) - Accent:
#FF60A8(pink) - Text:
#F5F5F5(white) - Secondary:
#B6B9BF(gray)
- Navigate to
/auth - Enter email/password
- Verify
!user.isAnonymous - Redirect to
/
- Navigate to
/user-auth - Complete form (optional invite code)
- Create Firebase account
- Process invitation if applicable
- Redirect to
/community/herbarium
Viral mechanism with:
- Unique link generation
- Server-side processing via
/api/invitations/process - Automatic inviter progress updates
- Progressive discount system
| Script | Command | Purpose |
|---|---|---|
dev |
next dev |
Development server |
build |
next build |
Production build |
start |
next start |
Production server |
electron-dev |
electron . |
Electron development |
electron-build |
Multi-step | Build desktop apps |
- Project uses TypeScript for type safety
- Image compression automatic for uploads
- Geohashing for efficient spatial searches
- Soft deletion instead of hard delete
- Server timestamps for consistency
- Fork repository
- Create feature branch
- Descriptive commits
- Pull request with detailed description
Dirty Roots - Building community around plants and tranquility πΏ