A Next.js application for wildlife professionals and sanctuary staff.
- Node.js 18+ and npm
- Supabase CLI
- Docker (for local Supabase)
- Clone the repository
git clone [email protected]:Kalikoze/WildWatch-AI.git
cd wildwatch-ai
- Install dependencies
npm install
- Create environment files:
.env.local
for local development:
NEXT_PUBLIC_SUPABASE_URL=http://localhost:54321
NEXT_PUBLIC_SUPABASE_ANON_KEY=your-local-anon-key
GOOGLE_CLIENT_ID=your-google-client-id
GOOGLE_CLIENT_SECRET=your-google-client-secret
AZURE_CLIENT_ID=your-azure-client-id
AZURE_CLIENT_SECRET=your-azure-client-secret
For staging environment:
NEXT_PUBLIC_SUPABASE_URL=your-staging-supabase-url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your-staging-anon-key
GOOGLE_CLIENT_ID=your-google-client-id
GOOGLE_CLIENT_SECRET=your-google-client-secret
AZURE_CLIENT_ID=your-azure-client-id
AZURE_CLIENT_SECRET=your-azure-client-secret
For production environment:
NEXT_PUBLIC_SUPABASE_URL=your-production-supabase-url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your-production-anon-key
GOOGLE_CLIENT_ID=your-google-client-id
GOOGLE_CLIENT_SECRET=your-google-client-secret
AZURE_CLIENT_ID=your-azure-client-id
AZURE_CLIENT_SECRET=your-azure-client-secret
- Start the local Supabase instance and Next.js development server:
npm run dev:supabase
- Access local services:
- Application: http://localhost:3000
- Supabase Studio: http://localhost:54323
- Email Testing: http://localhost:54324
Quick access commands:
npm run studio:view # Open Supabase Studio
npm run mail:view # Open Email Viewer
Create a new migration:
supabase migration new your_migration_name
Apply migrations locally:
supabase db reset
The project uses three environment-specific configurations:
config.toml
- Local development configurationconfig.staging.toml
- Staging environment configurationconfig.prod.toml
- Production environment configuration
To push database changes:
# First time setup or switching environments:
supabase unlink # If needed to unlink previous project
supabase link --project-ref your-project-ref
# Push to staging
npm run db:push-staging
# For Production
npm run db:push-prod
The application supports:
- Magic Link (Email)
- Google OAuth
- Microsoft OAuth
For local development:
- Magic link emails can be viewed at http://localhost:54324
- OAuth requires configuration in Google Cloud Console and Azure Portal
- Add callback URLs to your OAuth providers:
- Staging Supabase:
https://wibrvvcswedppjkiexjb.supabase.co/auth/v1/callback
- Production Supabase:
https://pepnuvoeeiikxxlomixs.supabase.co/auth/v1/callback
- Staging Supabase:
Note: Project refs are stored in our config files and are visible in Supabase URLs. While these aren't sensitive credentials, all actual secrets (API keys, OAuth credentials, etc.) should be stored in environment variables and never committed to version control.
# Development
npm run dev # Start Next.js development server
npm run dev:supabase # Start Next.js with local Supabase
# Supabase
npm run supabase:start # Start local Supabase
npm run supabase:stop # Stop local Supabase
npm run supabase:status # Check Supabase status
# Database
npm run db:push-staging # Push to staging environment
npm run db:push-prod # Push to production environment
# Testing
npm run test # Run tests
npm run test:ui # Run tests with UI
npm run type-check # Run TypeScript checks
wildwatch-ai/
├── app/ # Next.js application code
├── supabase/ # Supabase configuration
│ ├── migrations/ # Database migrations
│ └── config.toml # Supabase configuration
├── .env.local # Local environment variables
├── .env.staging # Staging environment variables
├── .env.production # Production environment variables
└── package.json # Project dependencies and scripts
- Create a feature branch
- Make your changes
- Test locally
- Push to staging environment for verification
- Create a pull request
The application uses a staged deployment process:
- Local development
- Staging environment for verification
- Production deployment
Ensure all environment variables are properly set in each environment.