Skip to content

TerraSolstice/app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

TerraSolstice

A comprehensive platform for sustainable energy solutions, combining geospatial technology, blockchain integration, and modern web development to create the future of energy management.

🌟 Overview

TerraSolstice is a full-stack application that provides:

  • Energy Management: Solar panels, smart grids, and energy storage solutions
  • Geospatial Platform: Advanced mapping and analytics for energy infrastructure
  • Blockchain Integration: Decentralized energy trading and asset tokenization
  • Monitoring Systems: Real-time device monitoring and analytics
  • Business Platform: Blog, case studies, careers, and partner management

πŸš€ Tech Stack

Frontend

  • Framework: Next.js 15 with App Router
  • Styling: Tailwind CSS with shadcn/ui components
  • State Management: React Context + Zustand
  • Authentication: Supabase Auth with wallet integration
  • Blockchain: Solana Web3.js integration

Backend

  • API: Next.js API Routes
  • Database: Supabase (PostgreSQL)
  • Authentication: Multi-provider (Email, OAuth, Wallet)
  • Storage: Supabase Storage
  • Email: Resend
  • Rate Limiting: Upstash Redis

Blockchain

  • Platform: Solana
  • Framework: Anchor
  • Language: Rust
  • Wallets: Phantom, Solflare, MetaMask

DevOps

  • Deployment: Vercel
  • Database: Supabase Cloud
  • Monitoring: Vercel Analytics + Custom metrics
  • Testing: Jest + React Testing Library

πŸ“ Project Structure

β”œβ”€β”€ app/                    # Next.js app directory
β”‚   β”œβ”€β”€ api/               # API routes
β”‚   β”œβ”€β”€ (auth)/           # Authentication pages
β”‚   β”œβ”€β”€ (dashboard)/      # Protected dashboard
β”‚   └── ...               # Public pages
β”œβ”€β”€ components/            # Reusable components
β”‚   β”œβ”€β”€ ui/               # UI components (shadcn/ui)
β”‚   β”œβ”€β”€ app/              # App-specific components
β”‚   └── auth/             # Authentication components
β”œβ”€β”€ lib/                  # Utility libraries
β”œβ”€β”€ hooks/                # Custom React hooks
β”œβ”€β”€ packages/             # Shared packages
β”‚   └── shared/          # Shared types and utilities
β”œβ”€β”€ blockchain/           # Solana programs
β”‚   β”œβ”€β”€ programs/        # Smart contracts
β”‚   └── tests/          # Blockchain tests
β”œβ”€β”€ supabase/            # Database migrations and config
└── public/              # Static assets

πŸ›  Development Setup

Prerequisites

  • Node.js 18+
  • pnpm package manager
  • Supabase account
  • Solana CLI (for blockchain features)
  • Rust toolchain (for Solana development)

Installation

  1. Clone the repository
git clone <repository-url>
cd terrasolstice-app
  1. Install dependencies
pnpm install
  1. Set up environment variables
cp .env.example .env.local
# Edit .env.local with your configuration
  1. Set up Supabase
# Initialize Supabase
npx supabase init

# Start local instance
npx supabase start

# Run migrations
npx supabase db push

# Seed database
npx supabase db reset --seed
  1. Set up blockchain (optional)
cd blockchain
anchor build
anchor deploy --provider.cluster devnet
  1. Start development server
pnpm dev

πŸ”§ Environment Variables

Create a .env.local file with the following variables:

# Supabase
NEXT_PUBLIC_SUPABASE_URL=your_supabase_url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key
SUPABASE_SERVICE_ROLE_KEY=your_service_role_key

# Solana
NEXT_PUBLIC_SOLANA_RPC_URL=https://api.devnet.solana.com
NEXT_PUBLIC_SOLANA_NETWORK=devnet

# External Services
RESEND_API_KEY=your_resend_api_key
UPSTASH_REDIS_REST_URL=your_redis_url
UPSTASH_REDIS_REST_TOKEN=your_redis_token

# Optional
STRIPE_SECRET_KEY=your_stripe_secret_key
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=your_stripe_publishable_key

πŸ§ͺ Testing

# Run all tests
pnpm test

# Run tests in watch mode
pnpm test:watch

# Run with coverage
pnpm test:coverage

# Run blockchain tests
cd blockchain && anchor test

πŸ“Š Features

Authentication System

  • Email/password authentication
  • Google OAuth integration
  • Blockchain wallet authentication (Phantom, Solflare, MetaMask)
  • Demo mode for exploration
  • Protected routes and role-based access

Content Management

  • Blog System: Create, edit, and manage blog posts
  • Product Catalog: Solar panels, smart grids, energy storage
  • Case Studies: Customer success stories
  • Career Portal: Job listings and applications
  • Documentation: Technical guides and API docs

Geospatial Platform

  • Extensions: Modular geospatial tools and plugins
  • Expressions: Data processing and analysis tools
  • Expansions: Platform capabilities and integrations
  • Mapping: Interactive maps and spatial analysis

Blockchain Features

  • Wallet Integration: Multi-wallet support
  • Energy Trading: Peer-to-peer energy transactions
  • Asset Tokenization: NFT-based energy certificates
  • Smart Contracts: Automated energy management
  • Transaction History: Comprehensive blockchain tracking

Monitoring & Analytics

  • Device Management: IoT device registration and control
  • Real-time Metrics: Energy production and consumption
  • Performance Analytics: System optimization insights
  • Alert System: Automated notifications and warnings

πŸš€ Deployment

Vercel Deployment

  1. Connect to Vercel
vercel link
  1. Set environment variables in Vercel dashboard

  2. Deploy

vercel deploy --prod

Database Setup for Production

  1. Create Supabase project
  2. Run migrations
npx supabase db push --project-ref your-project-ref
  1. Set up Row Level Security policies
  2. Configure authentication providers

πŸ“ˆ Performance & Monitoring

  • Core Web Vitals: Optimized for performance
  • Error Tracking: Comprehensive error monitoring
  • Analytics: User behavior and system metrics
  • Rate Limiting: API protection and abuse prevention
  • Caching: Optimized data fetching and storage

πŸ”’ Security

  • Authentication: Multi-factor authentication support
  • Authorization: Role-based access control
  • Data Protection: Encrypted data at rest and in transit
  • API Security: Rate limiting and input validation
  • Blockchain Security: Secure wallet integrations

πŸ“š Documentation

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ†˜ Support

πŸ™ Acknowledgments


TerraSolstice - Powering the future with sustainable energy and cutting-edge technology.

Built with ❀️ by the TerraSolstice team.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published