Configuration Guide
This guide covers all configuration options for TamborraData, including environment variables, Next.js configuration, and TypeScript settings.Environment Variables
Overview
TamborraData uses environment variables for configuration. Variables are loaded from.env.local for local development and configured in Vercel for production.
.env.local is ignored by Git and should never be committed. Use .env.example as a template.Required Variables
Your Supabase project URL.Format:
Example:
https://xxxxx.supabase.coExample:
https://abcdefghijk.supabase.coWhere to find: Supabase Dashboard > Settings > API > Project URLYour Supabase anonymous/public API key.Format: JWT token starting with
Example:
eyJ...Example:
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...Where to find: Supabase Dashboard > Settings > API > Project API keys > anon publicEnvironment File Structure
Create.env.local in your project root:
.env.local
Environment Loading
Next.js automatically loads environment variables from:.env.local(local development, highest priority).env.production(production builds).env.development(development builds).env(all environments, lowest priority)
Next.js Configuration
File: next.config.ts
The Next.js configuration file controls framework behavior, redirects, headers, and optimizations.
next.config.ts
Configuration Options Explained
Redirects
Redirects
Purpose: Force non-www domain in production.Behavior:
www.tamborradata.com β tamborradata.comSecurity Headers
Security Headers
Purpose: Enhance security and prevent common attacks.
| Header | Value | Purpose |
|---|---|---|
X-DNS-Prefetch-Control | on | Enable DNS prefetching |
X-XSS-Protection | 1; mode=block | Block XSS attacks |
X-Frame-Options | DENY | Prevent clickjacking |
X-Content-Type-Options | nosniff | Prevent MIME sniffing |
Referrer-Policy | origin-when-cross-origin | Control referrer info |
Strict-Transport-Security | max-age=63072000 | Force HTTPS |
Performance Options
Performance Options
poweredByHeader: falseRemoves
X-Powered-By: Next.js header for security (hides framework).compress: trueEnables gzip/brotli compression for responses.
TypeScript Configuration
File: tsconfig.json
TypeScript configuration for the project.
tsconfig.json
Key Settings
ECMAScript version for compiled JavaScript.
Currently disabled for faster development.
Uses modern bundler resolution (Node16 + extras).
Path aliases for imports.
TailwindCSS Configuration
File: tailwind.config.ts
TamborraData uses TailwindCSS 4 with CSS-first configuration.
TailwindCSS 4 uses
@import in CSS files instead of tailwind.config.ts. The config file is minimal.PostCSS Configuration
postcss.config.mjs
CSS Entry Point
Tailwind is imported via CSS:app/globals.css
ESLint Configuration
File: eslint.config.mjs
Linting rules for code quality.
eslint.config.mjs
Running ESLint
Package Manager Configuration
Using pnpm
The project uses pnpm for package management. Why pnpm?- β‘ Fast: 2-3x faster than npm
- πΎ Efficient: Uses hard links to save disk space
- π Strict: Better dependency resolution
Lock File
pnpm-lock.yaml tracks exact dependency versions.
Common Commands
Dependency Management
Production Dependencies
Key runtime dependencies:| Package | Version | Purpose |
|---|---|---|
next | 16.1.0 | React framework |
react | 19.2.3 | UI library |
@supabase/supabase-js | 2.89.0 | Database client |
@tanstack/react-query | 5.90.12 | Data fetching |
@nivo/bar, @nivo/line | 0.99.0 | Charts |
framer-motion | 12.23.26 | Animations |
@vercel/analytics | 1.6.1 | Analytics |
Development Dependencies
| Package | Version | Purpose |
|---|---|---|
typescript | 5.9.3 | Type checking |
tailwindcss | 4.1.18 | CSS framework |
eslint | 9.39.2 | Code linting |
prettier | 3.7.4 | Code formatting |
Build Configuration
Production Build
- Type-checks TypeScript
- Lints code with ESLint
- Compiles Next.js app
- Generates static pages
- Optimizes assets
Build Output
Build artifacts are stored in.next/:
Environment-Specific Configuration
Development
- Hot Module Replacement (HMR)
- React Query Devtools
- Verbose error messages
- Source maps enabled
Production
- Minified code
- No devtools
- Optimized bundles
- Server-side rendering
Vercel Configuration
Automatic Detection
Vercel automatically detects:- Framework: Next.js
- Build Command:
pnpm build - Output Directory:
.next - Install Command:
pnpm install
Environment Variables in Vercel
Select Environments
Choose which environments to apply:
- β Production
- β Preview
- β Development (optional)
Configuration Troubleshooting
Environment Variables Not Loading
Problem: App canβt connect to Supabase. Solutions:- Verify
.env.localexists and has correct values - Restart dev server after changing
.env.local - Check for typos in variable names
- Ensure no trailing spaces in values
- Variables must start with
NEXT_PUBLIC_to be accessible in browser (Supabase keys donβt need this)
TypeScript Path Alias Errors
Problem:Cannot find module '@/...'
Solution: Ensure tsconfig.json has:
Build Failures
Problem:pnpm build fails.
Solutions:
- Clear build cache:
- Check for TypeScript errors:
- Verify all dependencies installed:
Best Practices
DO:
- Keep
.env.localout of version control - Use different credentials for dev/staging/production
- Regularly update dependencies
- Run
pnpm lintbefore committing - Test builds locally before deploying
- Commit
.env.localor.env.production - Use
service_rolekey in client code - Modify
next.config.tswithout testing - Ignore TypeScript errors
- Skip
pnpm installafter pulling changes
Next Steps
Deployment
Learn how to deploy to production
Mock Data
Understand the synthetic data structure
API Reference
Explore API endpoints
Architecture
Deep dive into system design