This guide will help you set up Zenorizon for local development.
- Node.js (v18.17.0 or higher)
- pnpm (v9.14.2 or higher) - Package manager
- PostgreSQL (v14 or higher) - Database
- Git - Version control
- VS Code with extensions:
- TypeScript and JavaScript Language Features
- Tailwind CSS IntelliSense
- Prisma
- ESLint
- Postman or Insomnia for API testing
- Prisma Studio for database management
git clone https://github.com/kartikver15gr8/Zenorizon.git
cd Zenorizonpnpm installcp .env.example .envEdit .env with your values:
# Database
DATABASE_URL="postgresql://username:password@localhost:5432/zenorizon"
# NextAuth.js
NEXTAUTH_URL="http://localhost:3000"
NEXTAUTH_SECRET="your-secret-key-here"
# OAuth Providers
GITHUB_ID="your-github-oauth-app-id"
GITHUB_SECRET="your-github-oauth-app-secret"
GOOGLE_CLIENT_ID="your-google-oauth-client-id"
GOOGLE_CLIENT_SECRET="your-google-oauth-client-secret"
# Redis (for rate limiting)
UPSTASH_REDIS_REST_TOKEN="your-upstash-token"
UPSTASH_REDIS_REST_URL="your-upstash-url"
# Email (optional for development)
RESEND_API_KEY="your-resend-api-key"# Generate Prisma client
pnpm prisma generate
# Run database migrations
pnpm prisma db push
# (Optional) Seed database with sample data
pnpm prisma db seedpnpm devVisit http://localhost:3000 to see the application.
-
Install PostgreSQL:
- macOS:
brew install postgresql - Ubuntu:
sudo apt install postgresql postgresql-contrib - Windows: Download from postgresql.org
- macOS:
-
Start PostgreSQL service:
# macOS brew services start postgresql # Ubuntu sudo systemctl start postgresql
-
Create database:
createdb zenorizon
docker run --name zenorizon-postgres \
-e POSTGRES_DB=zenorizon \
-e POSTGRES_USER=postgres \
-e POSTGRES_PASSWORD=password \
-p 5432:5432 \
-d postgres:14Use services like:
- Supabase (recommended for beginners)
- Railway
- PlanetScale
- Neon
- Go to GitHub Developer Settings
- Click "New OAuth App"
- Fill in:
- Application name: Zenorizon Local
- Homepage URL:
http://localhost:3000 - Authorization callback URL:
http://localhost:3000/api/auth/callback/github
- Copy Client ID and Client Secret to
.env
- Go to Google Cloud Console
- Create a new project or select existing
- Enable Google+ API
- Go to "Credentials" → "Create Credentials" → "OAuth 2.0 Client IDs"
- Configure:
- Application type: Web application
- Authorized redirect URIs:
http://localhost:3000/api/auth/callback/google
- Copy Client ID and Client Secret to
.env
- Sign up at Upstash
- Create a Redis database
- Copy REST URL and Token to
.env
# macOS
brew install redis
brew services start redis
# Ubuntu
sudo apt install redis-server
sudo systemctl start rediszenorizon/
├── app/ # Next.js 15 App Router
│ ├── api/ # API routes (RESTful endpoints)
│ │ ├── auth/ # NextAuth.js authentication
│ │ ├── issues/ # Issue management APIs
│ │ ├── user/ # User profile APIs
│ │ ├── waitlist/ # Email waitlist API
│ │ └── workflow/ # Project management APIs
│ ├── auth/ # Authentication pages
│ ├── profile/ # User profile pages
│ ├── workflow/ # Main application (dashboard)
│ ├── globals.css # Global styles
│ ├── layout.tsx # Root layout with providers
│ └── page.tsx # Landing page
├── components/ # React components
│ ├── auth/ # Auth-related components
│ ├── landing/ # Landing page components
│ ├── profilesection/ # Profile management
│ ├── ui/ # Reusable UI components
│ └── workflow/ # Dashboard components
├── lib/ # Core utilities
│ ├── auth.ts # NextAuth configuration
│ ├── auth-utils.ts # Authorization helpers
│ ├── api-responses.ts # Standardized API responses
│ ├── custom-toast.tsx # Toast notification system
│ ├── icons.ts # SVG icon definitions
│ ├── svg-icon.tsx # SVG rendering component
│ └── validation-schemas.ts # Zod validation schemas
├── prisma/ # Database
│ ├── schema.prisma # Database schema
│ └── migrations/ # Database migrations
├── utils/ # Utility functions
│ ├── types.ts # TypeScript type definitions
│ └── constants.ts # Application constants
└── public/ # Static assets
├── assets/ # Images, icons
└── banner/ # Banner images
- User: Authentication and profile data
- Project: Project management with status, priority, health
- Issue: Task/issue tracking within projects
- Account/Session: NextAuth.js authentication tables
- WaitListEmails: Pre-launch email collection
- User → Projects (creator, many-to-many members)
- Project → Issues (one-to-many)
- User → Issues (assignee)
// All protected routes use this pattern
import { requireAuth } from '@/lib/auth-utils';
export async function POST(request: NextRequest) {
const user = await requireAuth(); // Throws if not authenticated
// Your logic here
}import { canAccessProject } from '@/lib/auth-utils';
const hasAccess = await canAccessProject(user.id, projectId);
if (!hasAccess) {
return ApiResponses.forbidden();
}import { validateRequestBody, createProjectSchema } from '@/lib/validation-schemas';
const validation = validateRequestBody(createProjectSchema, body);
if (!validation.success) {
return ApiResponses.validationError(validation.errors);
}# Development
pnpm dev # Start development server
pnpm build # Build for production
pnpm start # Start production server
pnpm lint # Run ESLint
# Database
pnpm prisma studio # Open Prisma Studio (database GUI)
pnpm prisma generate # Generate Prisma client
pnpm prisma db push # Push schema changes to database
pnpm prisma migrate dev # Create and apply migration
# Utilities
pnpm type-check # Run TypeScript type checking# Check if PostgreSQL is running
pg_isready
# Reset database
pnpm prisma db push --force-reset- Ensure callback URLs match exactly
- Check that OAuth apps are not in development mode restrictions
- Verify environment variables are loaded correctly
# Clear Next.js cache
rm -rf .next
# Reinstall dependencies
rm -rf node_modules pnpm-lock.yaml
pnpm install# Kill process on port 3000
lsof -ti:3000 | xargs kill -9
# Or use different port
pnpm dev -- -p 3001- Explore the codebase - Start with
app/page.tsxandapp/workflow/page.tsx - Check out the API routes - Look at
app/api/workflow/getprojects/route.ts - Understand the auth system - Review
lib/auth-utils.ts - Try creating a project - Test the full workflow
- Read the contributing guide - See
CONTRIBUTING.md
- GitHub Issues: Report bugs or ask questions
- Documentation: Check
CONTRIBUTING.mdfor development guidelines - Code Comments: Most complex functions are well-documented
Happy coding! 🚀