JSPM

@foxframework/core

1.0.2
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 12
  • Score
    100M100P100Q40570F
  • License MIT

A modern, production-ready web framework for TypeScript/Node.js with modular routing, integrated template engine, CLI tools, and enterprise features

Package Exports

  • @foxframework/core
  • @foxframework/core/dist/tsfox/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@foxframework/core) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

๐ŸฆŠ Fox Framework

NPM Version License: MIT Build Status TypeScript

A modern, production-ready web framework for TypeScript/Node.js with enterprise features, modular architecture, and integrated DevOps tooling.

๐Ÿš€ Quick Start

Installation

npm install @foxframework/core

Create a New Project

npx tsfox new my-app
cd my-app
npm run dev

Basic Usage

import { FoxFactory } from '@foxframework/core';

const app = FoxFactory.create({
  requests: [
    {
      path: '/',
      method: 'get',
      handler: (req, res) => res.json({ message: 'Hello Fox!' })
    }
  ]
});

app.listen(3000, () => {
  console.log('๐ŸฆŠ Fox Framework running on port 3000');
});

โœจ Features

๐Ÿ—๏ธ Core Framework

  • TypeScript-first with full type safety
  • Modular routing with factory patterns
  • Integrated template engine (Fox + Handlebars)
  • Middleware pipeline with async support
  • Error handling with custom error types

๐Ÿ› ๏ธ Developer Experience

  • CLI tools for project generation
  • Hot reload in development
  • Testing utilities with Jest integration
  • TypeScript decorators support

๐Ÿข Enterprise Features

  • Microservices architecture support
  • Circuit breaker patterns
  • Load balancing algorithms
  • Service discovery and registry
  • Health checks and monitoring

๐Ÿ”’ Security

  • Authentication middleware
  • Authorization with role-based access
  • CSRF protection
  • Security headers middleware
  • Rate limiting

๐Ÿ“Š Observability

  • Structured logging with multiple transports
  • Metrics collection (Prometheus format)
  • Performance monitoring
  • Health check endpoints
  • Request tracing

๐Ÿ—„๏ธ Data & Caching

  • Database abstraction layer
  • Multi-provider caching (Memory, Redis, File)
  • Response caching middleware
  • Cache invalidation strategies

๐Ÿš€ DevOps Ready

  • Docker multi-stage builds
  • Docker Compose for local development
  • CI/CD GitHub Actions workflows
  • Kubernetes deployment manifests
  • Monitoring stack (Prometheus + Grafana)

๐Ÿ“– Documentation

Visit our complete documentation for detailed guides and API reference.

Quick Examples

REST API

import { FoxFactory } from '@foxframework/core';

const app = FoxFactory.create({
  requests: [
    { path: '/users', method: 'get', handler: getAllUsers },
    { path: '/users', method: 'post', handler: createUser },
    { path: '/users/:id', method: 'get', handler: getUser },
    { path: '/users/:id', method: 'put', handler: updateUser },
    { path: '/users/:id', method: 'delete', handler: deleteUser }
  ]
});

With Middleware

import { FoxFactory, authMiddleware, loggingMiddleware } from '@foxframework/core';

const app = FoxFactory.create({
  middleware: [
    loggingMiddleware(),
    authMiddleware({ secret: 'your-jwt-secret' })
  ],
  requests: [
    { path: '/protected', method: 'get', handler: protectedRoute }
  ]
});

๐Ÿ› ๏ธ CLI Commands

# Create new project
npx tsfox new <project-name>

# Generate components
npx tsfox generate controller users
npx tsfox generate service auth
npx tsfox generate middleware validation

# Docker operations  
npx tsfox docker init
npx tsfox docker build
npx tsfox docker deploy

๐Ÿงช Testing

Fox Framework includes comprehensive testing utilities:

import { FoxTestUtils } from '@foxframework/core';

describe('API Tests', () => {
  const { request } = FoxTestUtils.createTestApp(app);
  
  it('should return users', async () => {
    const response = await request.get('/users');
    expect(response.status).toBe(200);
    expect(response.body).toHaveProperty('users');
  });
});

๐Ÿ“ˆ Performance

  • Lightweight: < 50KB gzipped
  • Fast startup: < 100ms cold start
  • High throughput: > 10k req/s
  • Memory efficient: < 50MB baseline
  • Scalable: Horizontal and vertical scaling

๐Ÿค Contributing

We welcome contributions! Please see our Contributing Guide.

Development Setup

git clone https://github.com/lnavarrocarter/fox-framework.git
cd fox-framework
npm install
npm run dev

Running Tests

npm test                    # All tests
npm run test:unit          # Unit tests only  
npm run test:integration   # Integration tests
npm run test:coverage      # With coverage

๐Ÿ“ฆ Ecosystem

  • @foxframework/core - Core framework (this package)
  • @foxframework/cli - Extended CLI tools
  • @foxframework/plugins - Community plugins
  • @foxframework/templates - Project templates

๐Ÿ“„ License

MIT ยฉ Luis Navarro Carter


๐ŸฆŠ Built with Fox Framework
Modern, Fast, Production-Ready