Skip to content

Ameriq8/curisjs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

31 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

CurisJS Logo

CurisJS Framework

A high-performance, multi-runtime web framework built on Web Standards

License npm version PRs Welcome


✨ Features

  • πŸš€ Blazing Fast - Optimized radix/trie router with minimal overhead and zero-copy streaming
  • 🌐 Multi-runtime - Works seamlessly on Node.js, Bun, Deno, and Edge runtimes
  • πŸ“¦ Standards-based - Built on Web Request/Response APIs for maximum compatibility
  • πŸ›‘οΈ Type-safe - Full TypeScript support with excellent IDE integration
  • πŸ”§ Simple & Intuitive - Clean API that's easy to learn and use
  • 🎯 Production-ready - Well-tested with predictable performance
  • 🧩 Modular - Use only what you need, tree-shakeable by design

πŸ“¦ Installation

# Using pnpm (recommended)
pnpm add @curisjs/core

# Using npm
npm install @curisjs/core

# Using yarn
yarn add @curisjs/core

πŸš€ Quick Start

Basic Example

import { createApp } from '@curisjs/core';
import { serve } from '@curisjs/core/node';

const app = createApp();

// Define routes
app.get('/', () => new Response('Hello World!'));

app.get('/users/:id', (ctx) => {
  return Response.json({
    userId: ctx.params.id,
  });
});

// Start server
await serve(app, { port: 3000 });
console.log('Server running at http://localhost:3000');

Middleware Example

import { createApp } from '@curisjs/core';
import { cors, logger } from '@curisjs/core/middleware';

const app = createApp();

// Global middleware
app.use(logger());
app.use(cors({ origin: '*' }));

// Custom middleware
app.use(async (ctx, next) => {
  const start = Date.now();
  await next();
  const duration = Date.now() - start;
  console.log(`${ctx.req.method} ${ctx.req.url} - ${duration}ms`);
});

app.get('/api/data', () => Response.json({ message: 'Hello!' }));

Advanced Routing

// Route parameters
app.get('/users/:id', (ctx) => {
  const userId = ctx.params.id;
  return Response.json({ userId });
});

// Multiple parameters
app.get('/posts/:postId/comments/:commentId', (ctx) => {
  return Response.json(ctx.params);
});

// Wildcard routes
app.get('/files/*path', (ctx) => {
  const filePath = ctx.params.path;
  return Response.json({ filePath });
});

// Handle all HTTP methods
app.all('/webhook', (ctx) => {
  return Response.json({ method: ctx.req.method });
});

πŸ—οΈ Project Structure

β”œβ”€β”€ packages/
β”‚   └── core/              # Core framework library
β”œβ”€β”€ template/
β”‚   └── backend/           # Backend application template
β”œβ”€β”€ docs/                  # Documentation
β”œβ”€β”€ assets/                # Project assets (logos, images)
└── README.md             # This file

πŸ› οΈ Development

Prerequisites

  • Node.js >= 18.0.0
  • pnpm >= 8.0.0

Setup

# Clone the repository
git clone https://github.com/Ameriq8/curisjs.git
cd curisjs

# Install dependencies
pnpm install

# Build all packages
pnpm build

# Run tests
pnpm test

πŸ“œ Available Scripts

Command Description
pnpm build Build all packages
pnpm dev Start development mode with watch
pnpm test Run all tests
pnpm test:watch Run tests in watch mode
pnpm test:coverage Generate test coverage report
pnpm lint Lint code with ESLint
pnpm format Format code with Prettier
pnpm format:check Check code formatting
pnpm typecheck Type-check all packages
pnpm clean Clean build artifacts

πŸ“– Documentation

πŸ“š Read the full documentation at https://ameriq8.github.io/curisjs/

For offline access, see the docs directory or visit the core package README.

🎨 Using the Template

Get started quickly with our pre-configured backend template:

# Navigate to the template
cd template/backend

# Install dependencies
pnpm install

# Start development server
pnpm dev

The template includes:

  • βœ… Project structure best practices
  • βœ… Example controllers and routes
  • βœ… Database integration setup
  • βœ… Validation examples
  • βœ… Middleware configuration
  • βœ… Docker support

🌍 Runtime Support

CurisJS works across multiple JavaScript runtimes:

Node.js

import { createApp } from '@curisjs/core';
import { serve } from '@curisjs/core/node';

const app = createApp();
app.get('/', () => new Response('Hello from Node!'));
await serve(app, { port: 3000 });

Bun

import { createApp } from '@curisjs/core';

const app = createApp();
app.get('/', () => new Response('Hello from Bun!'));

export default {
  port: 3000,
  fetch: app.fetch.bind(app),
};

Deno

import { createApp } from '@curisjs/core';

const app = createApp();
app.get('/', () => new Response('Hello from Deno!'));

Deno.serve({ port: 3000 }, app.fetch.bind(app));

🀝 Contributing

Contributions are welcome! We appreciate your help in making CurisJS better.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Please read CONTRIBUTING.md for detailed guidelines.

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ”’ Security

Security is a top priority for CurisJS. If you discover a security vulnerability, please follow our Security Policy.

πŸ’¬ Community & Support

πŸ™ Acknowledgments

CurisJS is built with inspiration from modern web frameworks and the amazing JavaScript community.


Made with ❀️ by Ameriq8

Releases

No releases published

Packages

 
 
 

Contributors