Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

6 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🌾 Terra Platform

Real-time agricultural analytics platform for Central Asian farms

Next.js TypeScript PostgreSQL Prisma TailwindCSS License


πŸ“– Overview

Terra Platform is a production-grade web application that provides real-time analytics and monitoring for agricultural enterprises across Kazakhstan and Central Asia.

Farmers and agro-managers get a unified dashboard to track:

  • 🌑️ Soil temperature & moisture sensors
  • 🌦️ Live weather feeds per field zone
  • πŸ“ˆ Yield prediction models (ML-based)
  • πŸ—ΊοΈ Interactive field map (Leaflet.js)
  • πŸ“Š Historical trend charts (Recharts)

✨ Features

  • Real-time data β€” WebSocket-powered live sensor feeds
  • Role-based access β€” Farm owner / Field manager / Analyst tiers
  • Multi-farm support β€” Manage hundreds of fields from one dashboard
  • Mobile-first β€” Fully responsive, works on any device
  • Export β€” CSV/PDF reports for any date range
  • Internationalization β€” Russian, Kazakh, English (next-intl)

πŸ›  Tech Stack

Layer Technology
Framework Next.js 14 (App Router)
Language TypeScript 5
Styling TailwindCSS + shadcn/ui
State Zustand + React Query
Database PostgreSQL 16
ORM Prisma
Auth NextAuth.js (JWT)
Charts Recharts
Maps Leaflet.js
Realtime WebSockets (ws)
Deploy Vercel + Supabase

πŸš€ Getting Started

# Clone the repo
git clone https://github.com/wpalish/terra-platform.git
cd terra-platform

# Install dependencies
npm install

# Set up environment variables
cp .env.example .env.local

# Run database migrations
npx prisma migrate dev

# Start development server
npm run dev

Open http://localhost:3000 in your browser.

βš™οΈ Environment Variables

DATABASE_URL=postgresql://...
NEXTAUTH_SECRET=your-secret
NEXTAUTH_URL=http://localhost:3000
WEATHER_API_KEY=your-key

πŸ“ Project Structure

terra-platform/
β”œβ”€β”€ app/                  # Next.js App Router
β”‚   β”œβ”€β”€ (auth)/           # Auth routes
β”‚   β”œβ”€β”€ dashboard/        # Main dashboard
β”‚   β”œβ”€β”€ fields/           # Field management
β”‚   └── api/              # API routes
β”œβ”€β”€ components/
β”‚   β”œβ”€β”€ charts/           # Recharts components
β”‚   β”œβ”€β”€ maps/             # Leaflet map components
β”‚   └── ui/               # shadcn/ui primitives
β”œβ”€β”€ lib/
β”‚   β”œβ”€β”€ prisma.ts         # DB client
β”‚   β”œβ”€β”€ auth.ts           # NextAuth config
β”‚   └── websocket.ts      # WS client
β”œβ”€β”€ prisma/
β”‚   └── schema.prisma     # DB schema
└── public/

πŸ—„ Database Schema

model Farm {
  id       String   @id @default(cuid())
  name     String
  location String
  fields   Field[]
  owner    User     @relation(fields: [ownerId], references: [id])
  ownerId  String
}

model Field {
  id        String   @id @default(cuid())
  name      String
  area      Float    // hectares
  crop      String
  sensors   Sensor[]
  farm      Farm     @relation(fields: [farmId], references: [id])
  farmId    String
}

model SensorReading {
  id          String   @id @default(cuid())
  sensorId    String
  temperature Float
  moisture    Float
  timestamp   DateTime @default(now())
}

πŸ“„ License

MIT Β© ΠΠ»ΠΈΡˆΠ΅Ρ€ Нурсаин


Built with ❀️ in Astana, Kazakhstan πŸ‡°πŸ‡Ώ

About

🌾 Real-time agricultural analytics platform for Central Asian farms β€” Next.js, PostgreSQL, Prisma

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages