neura-js-framework
v0.1.0
Published
A modern JavaScript framework for server-side rendering and static site generation
Maintainers
Readme
NEURA JS
A modern JavaScript framework for server-side rendering and static site generation, built with React and TypeScript.
Features
- 🚀 File-based Routing: Automatically map files in a
/pagesdirectory to routes - 🔌 API Routes: Support backend API functions inside
/apidirectory - 🔄 Middleware Support: Allow custom middleware for handling requests
- 📦 Static Site Generation (SSG): Pre-generate static HTML at build time
- 🖥️ Server-side Rendering (SSR): Render React components on the server
- 📦 Automatic Code Splitting: Optimize bundle size
- ⚡ Hot Module Replacement (HMR): Auto-reload changes in development
- 🌐 Edge Function Support: Work on serverless environments
Getting Started
Create a new NEURA JS project:
npx neura-js create my-app
cd my-app
npm install
npm run devProject Structure
/my-app/
├── /pages/ # File-based routing
├── /api/ # API routes
├── /middleware/ # Middleware support
├── /public/ # Static assets
├── /components/ # UI Components
├── index.ts # Framework entry point
├── server.ts # Custom server
├── router.ts # Custom router
├── package.json # Dependencies
└── vite.config.ts # Bundler configBasic Example
Create a new page:
// pages/index.tsx
import React from 'react';
export default function Home() {
return (
<div>
<h1>Welcome to NEURA JS</h1>
</div>
);
}Create an API route:
// pages/api/hello.ts
export default function handler(req, res) {
res.status(200).json({ message: 'Hello from NEURA JS!' });
}Add middleware:
// middleware/auth.ts
export default function authMiddleware(req, res, next) {
// Add your authentication logic here
next();
}Available Commands
neura dev- Start development serverneura build- Build for productionneura start- Start production server
Documentation
Visit NEURA JS Documentation to learn more about:
- Routing
- API Routes
- Middleware
- Static Site Generation
- Server-side Rendering
- Deployment
- And more!
Contributing
We welcome contributions! Please see our Contributing Guide for details.
License
MIT
