A real-time collaborative voting and mapping platform built with Next.js 14, TypeScript, and modern web technologies.
- Framework: Next.js 14.2+ with App Router
- Language: TypeScript 5.3+ (strict mode enabled)
- Package Manager: pnpm
- Node Version: 20 LTS
- Styling: Tailwind CSS
- Database: Supabase
- Caching: Upstash Redis
- Maps: Mapbox GL + Deck.gl
- Real-time: Socket.io
- State Management: Zustand
- Animation: Framer Motion
- UI Components: Radix UI
- Logging: Winston
- Monitoring: Sentry
- Node.js 20 LTS
- pnpm (installed globally)
-
Clone the repository
-
Install dependencies:
pnpm install
-
Copy environment variables:
cp .env.example .env.local
-
Update
.env.localwith your actual values (see Environment Variables section) -
Start the development server:
pnpm dev
-
Open http://localhost:3000 in your browser
All required environment variables are documented in .env.example. Key variables include:
- Database: Supabase URL and keys
- Caching: Upstash Redis credentials
- Maps: Mapbox access token
- Security: JWT secrets and hCaptcha keys
- Monitoring: Sentry DSN and auth tokens
- Email: Resend API key
- Media: Cloudinary credentials
pnpm dev- Start development serverpnpm build- Build for productionpnpm start- Start production serverpnpm lint- Run ESLintpnpm type-check- Run TypeScript compiler check
src/
├── app/ # Next.js App Router pages and API routes
│ ├── api/ # API routes
│ ├── globals.css # Global styles
│ ├── layout.tsx # Root layout
│ └── page.tsx # Home page
└── lib/ # Utility libraries
├── db.ts # Database client (Supabase)
└── logger.ts # Winston logger configuration
The application uses Winston for structured logging with the following features:
- Console output: Colorized, human-readable format
- File output: JSON format in
logs/directory - Log levels: error, warn, info, http, debug
- Log rotation: 5MB max file size, 5 files retained
- Environment-based: Debug level in development, info in production
Log files:
logs/all.log- All log levelslogs/error.log- Error level onlylogs/exceptions.log- Uncaught exceptionslogs/rejections.log- Unhandled promise rejections
The project uses strict TypeScript configuration with all strictness flags enabled:
strict: truestrictNullChecks: truenoImplicitAny: truenoUnusedLocals: truenoUnusedParameters: truenoImplicitReturns: true
- ESLint with TypeScript support
- Prettier for code formatting
- Strict TypeScript compilation
- Zero tolerance for TypeScript errors
Test the setup:
- Logger test: Check
logs/directory for log files after running the app - API test: Visit
/api/testto verify logger and API functionality - Type check: Run
pnpm type-checkto ensure no TypeScript errors - Build test: Run
pnpm buildto verify production build
Private project - All rights reserved.