Getting Started with Ecosyz
Welcome to Ecosyz! This guide will help you get up and running with the Open Idea platform in minutes.
🚀 Prerequisites
Before you begin, ensure you have the following installed:
📦 Quick Setup
1. Clone the Repository
2. Install Dependencies
3. Environment Setup
Required Environment Variables:
# Supabase Configuration
NEXT_PUBLIC_SUPABASE_URL=your_supabase_project_url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key
SUPABASE_SERVICE_ROLE_KEY=your_service_role_key
# Database
DATABASE_URL=your_database_url
DIRECT_URL=your_direct_database_url
# Optional: External APIs
OPENAI_API_KEY=your_openai_key
GOOGLE_SEARCH_API_KEY=your_google_api_key
4. Database Setup
# Generate Prisma client
npx prisma generate
# Push database schema
npx prisma db push
# Optional: Open Prisma Studio
npx prisma studio
5. Start Development Server
Visit http://localhost:3000 to see your app!
🔧 Development Workflow
Code Quality
# Run linting
pnpm lint
# Run type checking
pnpx tsc --noEmit
# Run tests (when available)
pnpm test
Database Management
# View database in browser
npx prisma studio
# Reset database (development only)
npx prisma migrate reset
# Create new migration
npx prisma migrate dev --name your_migration_name
API Testing
# Test authentication
curl -X POST http://localhost:3000/api/auth/signup \
-H "Content-Type: application/json" \
-d '{"email":"test@example.com","password":"test123","name":"Test User"}'
# Test profile API
curl http://localhost:3000/api/profile
🏗️ Project Structure
Ecosyz/
├── app/ # Next.js App Router
│ ├── api/ # API routes
│ ├── auth/ # Authentication pages
│ ├── components/ # React components
│ └── globals.css # Global styles
├── docs/ # Documentation
├── prisma/ # Database schema
├── src/ # Source code
│ ├── lib/ # Utilities and configurations
│ └── types/ # TypeScript types
├── public/ # Static assets
└── tests/ # Test files
🔐 Authentication Setup
Supabase Configuration
- Create Project: Go to Supabase Dashboard
- Get Keys: Copy URL and anon key from project settings
- Enable Auth: Configure authentication providers
- Database: Set up database and run migrations
OAuth Providers (Optional)
Configure in Supabase Dashboard: - GitHub: Add GitHub OAuth app - Google: Add Google OAuth credentials
🚀 Deployment
Vercel (Recommended)
# Install Vercel CLI
npm i -g vercel
# Deploy
vercel
# Add environment variables in Vercel dashboard
Manual Deployment
🐛 Troubleshooting
Common Issues
"Invalid login credentials" - Check Supabase URL and keys - Ensure user exists in Supabase Auth - Verify email confirmation settings
"Database connection failed"
- Check DATABASE_URL in .env.local
- Run npx prisma generate
- Ensure Supabase database is accessible
"Build failed"
- Run pnpm lint
and fix errors
- Check TypeScript errors with pnpx tsc --noEmit
- Clear Next.js cache: rm -rf .next
Getting Help
🎯 Next Steps
- Explore the codebase - Start with
app/page.tsx
- Test authentication - Try signup/signin flow
- Customize UI - Modify components in
app/components/
- Add features - Check the backlog
Happy coding! 🚀