Tech Stack
Detalhamento completo do stack serverless utilizado no Portal do The News.Frontend
Core Technologies
Next.js 15
React Framework
- App Router
- Server Components + Actions
- Edge Runtime
- Partial Pre-rendering (PPR)
TypeScript 5.4
Type Safety
- Strict mode
- Server/Client separation
- Database type generation
- API type safety
TailwindCSS 3.4
Utility-First CSS
- JIT compilation
- Design system tokens
- Dark mode
- Container queries
Cloudflare Pages
JAMstack Hosting
- Global edge deployment
- Instant rollbacks
- Branch previews
- Custom domains
Libraries & Tools
Serverless Backend
Next.js Server-Side
- API Routes
- Server Actions
- Middleware
Databases & Storage
Primary Database
Neon PostgreSQL
Serverless PostgreSQL
- Branching for development
- Auto-scaling compute
- Connection pooling
- Read replicas
Edge Storage
Cloudflare D1
SQLite at Edge
- Global distribution
- Zero latency reads
- SQL interface
- Perfect for caching
Cloudflare KV
Key-Value Store
- Global edge storage
- Eventually consistent
- Simple API
- Session storage
Content Management
Sanity.io
Headless CMS
- Real-time API
- Image optimization
- Content relationships
- GROQ query language
Infrastructure
Cloudflare Stack
Edge Computing
Cloudflare Pages
- Global edge deployment
- Instant rollbacks
- Branch previews
- Custom domains + SSL
CDN & Security
Cloudflare CDN
- 330+ locations
- DDoS protection
- Web Application Firewall
- Bot management
External Services
| Service | Purpose | Integration |
|---|---|---|
| Neon | Primary database | Serverless PostgreSQL |
| Sanity.io | Content management | Headless CMS |
| NextAuth.js | Authentication | OAuth + JWT |
| Sentry | Error monitoring | SDK integration |
Database Schema
Drizzle ORM Setup
Schema Definition
Authentication
NextAuth.js Configuration
Development Tools
Local Development
Core Tools
- pnpm: Fast package manager
- wrangler: Cloudflare CLI
- drizzle-kit: Database toolkit
- next: Framework CLI
VSCode Extensions
- Tailwind CSS IntelliSense
- TypeScript Hero
- Cloudflare Workers
- Sanity.io
- Drizzle ORM
- Error Lens
