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
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
๐ Links
๐ฆ Built with Fox Framework
Modern, Fast, Production-Ready