Web App Development
Node.js Web App Development With Fastify, TypeScript, and Real-Time APIs
We build Node.js web app backends that handle real-time events, high-throughput APIs, and WebSocket connections — with TypeScript throughout and a monolith-first architecture that scales.
Why Node.js Web App Development Requires Event-Loop Discipline
Node.js is the backbone of the JavaScript full-stack ecosystem, but its single-threaded event loop demands a different approach to CPU-intensive work than traditional multi-threaded server runtimes. Most Node.js web app projects we inherit have blocking operations somewhere in the hot path — synchronous JSON parsing on large payloads, sequential database queries in a loop, or image processing that freezes the event loop entirely. These bugs manifest only at scale, which is exactly when they are most damaging. We audit for blocking patterns before every production deployment.
The Node.js API design space has matured significantly since Express.js became the default in 2015. Express is showing its age in 2025 — no built-in TypeScript support, no schema validation, middleware ordering that silently swallows errors. We build Node.js web app APIs on Fastify: 2–3× faster than Express under load, first-class TypeScript support, a plugin system that prevents middleware conflicts, and built-in schema validation via JSON Schema that eliminates a category of API bugs before they reach production.
The microservices vs monolith decision is where most early-stage Node.js projects go wrong. Splitting into microservices before understanding your domain boundaries adds distributed systems complexity — network latency, service discovery, distributed tracing — without the scale benefits that justify it. We build Node.js web apps as well-structured monoliths with clear internal module boundaries that make future service extraction straightforward. We have never had a client who needed to extract a microservice before reaching 100,000 daily active users.
Our Approach to Node.js web app development
Every project follows our 4-step vibe-coding process — AI handles the boilerplate, senior engineers handle the craft. From idea to live product in 3–7 days for MVPs.
Discovery
We map your API surface area: which endpoints exist, which data they serve, what authentication they require, and where real-time updates are needed. We identify any CPU-intensive operations that need Worker Thread offloading and any long-running processes that need a job queue. These discoveries shape the Node.js architecture before any code is written.
Design
We design the API contract — request and response schemas for every endpoint — before writing any code. In TypeScript, the schema becomes the type definition. In Fastify, the schema becomes the validation configuration. The API design document is the single source of truth that frontend development can proceed against even before the API is implemented.
Build
Fastify with TypeScript for the API layer, Supabase PostgreSQL for persistence, BullMQ for job queues requiring background processing, WebSockets via Fastify's socket.io plugin for real-time features, and Zod for request validation with automatic TypeScript type inference. AI generates the endpoint scaffolding; our engineers design the middleware pipeline and error handling strategy.
Launch
Load testing with k6 before go-live: we simulate your expected traffic and 3× your expected traffic to identify bottlenecks. We configure PM2 or Docker for process management, set up structured logging with Pino for production log aggregation, and configure health check endpoints for uptime monitoring. Deployment targets Fly.io, Railway, or Vercel for serverless API routes.
What You Get
Every node.js web app development engagement includes these deliverables — scoped before we start, delivered before we invoice.
- Fastify API with TypeScript, JSON Schema validation, and typed route handlers
- Authentication middleware: JWT validation, session management, and role-based access control
- Database integration with Supabase PostgreSQL and connection pooling via pg library
- WebSocket server for real-time features with connection lifecycle management
- BullMQ job queue for background processing, email sending, and scheduled tasks
- Error handling middleware with structured error responses and Sentry integration
- Request logging via Pino with correlation IDs for distributed tracing
- API documentation via Fastify's built-in OpenAPI/Swagger plugin
- Load test suite with k6 covering expected and peak traffic scenarios
- Docker container configuration for portable deployment across hosting providers
Tech Stack We Use
Node.js web app development at Greta uses Fastify as the API framework — faster than Express, TypeScript-native, and schema-validation-first. We write every route handler and middleware in TypeScript strict mode, with Zod schemas defining the shape of every request and response. Database access goes through the Supabase PostgreSQL client with connection pooling configured for the expected concurrent connection count. For background jobs — email sending, third-party API calls, scheduled reports — we use BullMQ with Redis for reliable job queuing. Real-time features use WebSockets managed by Fastify's socket.io integration, with connection state tracked in Redis for horizontal scalability. Every Node.js app we ship includes structured JSON logging via Pino and Sentry error tracking configured before the first line of production traffic runs.
Case Study
FinTrack — Real-Time Financial Data API
FinTrack required a Node.js API capable of handling real-time balance updates from multiple bank account webhooks simultaneously while serving a responsive dashboard UI. The challenge was preventing any single slow webhook handler from blocking the event loop and causing latency spikes for other users. We used Fastify with async route handlers throughout, offloaded slow database aggregations to a BullMQ job queue, and served real-time updates via Supabase's built-in real-time rather than maintaining custom WebSocket connections. The API handled its first 50 concurrent webhook deliveries in the first week of production without a single event loop stall or timeout error.
Read full case studyPricing Transparency
Node.js web app development is priced by project scope, not by framework. Projects start at $5,000 for API-backed MVPs and run $15,000–$40,000 for full-stack systems with job queues, real-time features, and complex business logic. We typically use Node.js via Next.js API Routes for tightly coupled full-stack apps and standalone Fastify for APIs that need to serve multiple clients or handle high concurrency independently.
MVP
From $5,000
3–7 business days
Full Build
From $15,000
2–4 weeks
All projects include full code ownership, two revision rounds, Vercel deployment, and one week of post-launch support. No hidden fees.
Frequently Asked Questions
Why do you use Fastify instead of Express?
Fastify is 2–3× faster than Express under load, has first-class TypeScript support without additional configuration, validates request schemas before reaching your route handlers, and has a plugin architecture that prevents the middleware ordering bugs that silently break Express applications. We stopped starting new Node.js projects on Express in 2023.
How do you prevent blocking the Node.js event loop?
We audit every route handler for synchronous operations: JSON.parse on large payloads, for loops executing database queries, or fs.readFileSync calls. CPU-intensive work — image processing, PDF generation, large data transformation — is offloaded to Worker Threads or a job queue so the main event loop stays available for request handling.
Should I use Node.js API routes or a separate backend service?
For most web apps, Next.js API Routes or Server Actions are sufficient and simpler to maintain. A separate Node.js service makes sense when you need WebSocket connections, a job queue, high concurrency with fine-grained resource control, or when multiple frontend clients need to share the same API. We help you make this call during discovery.
Can you integrate my Node.js API with third-party webhooks?
Yes. Webhook handlers require idempotent processing — the same event delivered twice should produce the same result — and fast response times — webhook senders typically timeout after 5 seconds. We build webhook handlers that acknowledge receipt immediately, validate the signature, and process the payload asynchronously via a job queue.
How do you handle authentication in a Node.js API?
We implement JWT validation middleware that verifies the token signature and expiry on every protected route. For Supabase-backed apps, we validate Supabase JWTs using the Supabase service role client. For custom auth, we issue JWTs with a configurable expiry and a refresh token rotation pattern that prevents session hijacking.
What hosting do you recommend for Node.js apps?
For standalone Node.js APIs, we recommend Fly.io for persistent server processes that need WebSocket support, Railway for simple deployments with a managed PostgreSQL option, and Vercel for serverless API routes that tolerate cold starts. For containerized apps with complex infrastructure, we configure Docker and deploy to AWS ECS or similar.
Can you build a Node.js microservices architecture?
We can, but we recommend against it for early-stage products. Microservices add distributed systems complexity — service discovery, distributed tracing, inter-service authentication — that is only justified at scale. We build structured monoliths with clear internal modules first and extract services when a specific component demonstrably needs independent scaling.
Do you write tests for Node.js APIs?
We write integration tests for all API endpoints using the Fastify test client, covering happy paths and error cases. We write unit tests for complex business logic functions. We do not mock the database in integration tests — we use a test database with fixtures, because mocking leads to tests that pass while real behavior breaks.
Ready to ship?
Ready to build your Node.js web app?
Start Your ProjectOr reach us directly at hello@greta.agency
Written by the Greta Agency team · Last updated April 2025