Terra-X is a Next.js application for mining and exploration workflows. It combines project-based data management with geological AI chat, map-based AOI work, file parsing, reports, and lightweight 3D visualization.
- AI chat
- Geological reasoning workflow powered by Google Gemini
- Project workspaces
- Projects, chats, files, reports, AOIs, and team members
- File handling
- Upload and parse CSV, PDF, and selected technical data files
- Spatial workflow
- Mapbox-powered map views and AOI drawing
- 3D workflow
- Drillhole-oriented visualization using Three.js and React Three Fiber
- Reporting
- Markdown-based reports and export flows
- Framework
- Next.js 14 App Router
- Language
- TypeScript
- Database/Auth/Storage
- Supabase
- AI
- Google Gemini
- Mapping
- Mapbox GL
- 3D
- Three.js + React Three Fiber
- Styling
- Tailwind CSS
- Node.js
- 18+
- Accounts/services
- Supabase project
- Google Gemini API key
- Mapbox access token
- Install dependencies
npm install- Copy the env template
cp .env.example .env.local-
Fill in the required values in
.env.local -
Set up Supabase using the SQL files in
lib/supabase/ -
Start the app
npm run dev- Open
http://localhost:3000
For the full setup flow, see SETUP.md.
The app currently uses these variables:
NEXT_PUBLIC_SUPABASE_URL=
NEXT_PUBLIC_SUPABASE_ANON_KEY=
SUPABASE_SERVICE_ROLE_KEY=
NEXT_PUBLIC_MAPBOX_TOKEN=
GEMINI_API_KEY=The canonical public database setup lives in:
lib/supabase/schema_step1.sqllib/supabase/schema_step2.sqllib/supabase/schema_step3.sqllib/supabase/schema_step4.sqllib/supabase/schema_step5.sqllib/supabase/schema_step6.sqllib/supabase/schema_step7.sql
If you are preparing this repo for public release, keep those files. They are the cleanest setup path for a new user.
- Storage bucket
- The app expects a private Supabase Storage bucket named
project-files
- The app expects a private Supabase Storage bucket named
- Invites
- Team invites require
SUPABASE_SERVICE_ROLE_KEYon the server
- Team invites require
- Public insert tables
- The schema includes public insert flows for lead/request capture tables; consider adding rate limiting or bot protection before production use
TerraX-public/
├── app/
├── components/
├── lib/
│ └── supabase/
├── public/
├── types/
├── .env.example
├── README.md
└── SETUP.md
This app can be deployed anywhere that supports a standard Next.js server build.
- Do not commit
- real
.envfiles - service role keys
- database passwords
- real
This project is open source and available under the MIT License.
Copyright (c) 2026 4Point AI.
See LICENSE for the full text.