Skip to content

Volt-js/volt.js

Repository files navigation

⚡ Volt.js

Buy Me a Coffee

The End-to-End Typesafe Full-stack TypeScript Framework

Built for Humans and AI

npm version TypeScript License: MIT Documentation


✨ What is Volt.js?

Volt.js is a modern, full-stack TypeScript framework that eliminates the friction between your backend and frontend. Define your API once, get fully-typed clients everywhere—no code generation, no manual synchronization, just pure end-to-end type safety.

Perfect for building scalable APIs, real-time applications, and modern web services.

🚀 Quick Start

Get up and running in seconds:

# Create a new project
npx @volt.js/cli@latest init my-app

# Or add to existing project
npm install @volt.js/core zod

🎯 Key Features

  • 🔒 End-to-End Type Safety - Define once, use everywhere with full TypeScript inference
  • ⚡ Zero Code Generation - No build steps, no schemas to sync
  • 🚀 Performance Optimized - Parallel context building, smart caching, and optimized request processing
  • 🔌 Framework Agnostic - Works with Next.js, Express, Bun, and more
  • 🎛️ Built-in Features - Queues, Real-time, Caching, and Telemetry
  • 🤖 AI-Friendly - Optimized for code agents and AI assistance
  • 📦 Plugin System - Extensible and modular architecture with dependency resolution

📖 Documentation & Resources

🛠️ Development

# Interactive development dashboard
npx @volt.js/cli dev --interactive

# Build your project
npm run build

# Run tests
npm test

🌟 Example

// Define your API
export const userController = volt.controller({
  path: '/users',
  actions: {
    list: volt.query({
      handler: async ({ context }) => {
        return await context.database.user.findMany();
      }
    }),
    create: volt.mutation({
      input: z.object({ name: z.string(), email: z.string().email() }),
      handler: async ({ input, context }) => {
        return await context.database.user.create({ data: input });
      }
    })
  }
});

// Use in your React app with full type safety
const { data: users } = useQuery(client.users.list);
const createUser = useMutation(client.users.create);

⚡ Performance Features

Volt.js 0.3.0 introduces significant performance optimizations:

🚀 Parallel Context Building

  • Context creation and request body parsing execute in parallel
  • 2-3x faster request processing for complex applications
  • Automatic optimization with zero configuration changes

🔄 Smart Plugin Dependency Resolution

  • Intelligent plugin loading order based on dependency graph
  • Plugins execute in optimized batches with parallel processing
  • Built-in fallbacks ensure reliability even when plugins fail

⏱️ Configurable Timeouts & Fallbacks

  • Context creation: 5s timeout with fallback
  • Body parsing: 10s timeout with graceful degradation
  • Plugin operations: 3s timeout per batch
  • Individual plugin proxies: 1s timeout with retry logic

📊 Performance Benchmarks

// Before: Sequential processing
// Context: 50ms + Body: 30ms + Plugins: 40ms = 120ms total

// After: Parallel processing
// Context + Body: max(50ms, 30ms) + Plugins: 40ms = 90ms total
// 🎯 25% improvement in typical scenarios

🤝 Community & Support

📄 License

MIT License - see the LICENSE file for details.


Made with ❤️ by the Volt.js team

voltjs.comGitHubnpm

About

No description, website, or topics provided.

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •