1.0.0 • Published 9 months ago

@codenarration/create-nexanode v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

NexaNode Backend Framework

A modern, TypeScript-based backend framework built on Node.js, designed for creating scalable, maintainable, and type-safe applications with ease.

šŸš€ Core Features

  • Type-Safe Architecture: Built with TypeScript for enhanced developer experience and compile-time safety
  • Decorator-Based Routing: Intuitive API design using decorators for clean and maintainable code
  • Base Classes: Extensible BaseController and BaseRepository for consistent patterns
  • Authentication & Authorization: Built-in JWT authentication with middleware support
  • Database Integration: Seamless TypeORM integration with PostgreSQL
  • Rate Limiting: Configurable request rate limiting to protect your APIs
  • Error Handling: Comprehensive error management system with custom error types
  • Logging: Structured logging system using Winston
  • Middleware Support: Flexible middleware system for request processing
  • Migration Tools: Built-in database migration scripts and utilities

šŸ› ļø Tech Stack

  • Runtime: Node.js
  • Language: TypeScript
  • Web Framework: Express.js
  • Database: PostgreSQL
  • ORM: TypeORM
  • Authentication: JWT
  • Logging: Winston
  • Request Validation: Class Validator & Class Transformer

šŸ“¦ Installation

# Clone the repository
git clone https://github.com/yourusername/nexanode.git

# Install dependencies
npm install

šŸ”§ Configuration

  1. Create a .env file in the root directory
  2. Configure your environment variables:
PORT=3000
NODE_ENV=development
DB_HOST=localhost
DB_PORT=5432
DB_USERNAME=your_username
DB_PASSWORD=your_password
DB_DATABASE=your_database
JWT_SECRET=your_jwt_secret

šŸš€ Quick Start

// Example Controller
import { Controller, Get, Post } from "../decorators/route";
import { BaseController } from "../core/BaseController";

@Controller("/users")
export class UserController extends BaseController {
  @Get("/")
  async getUsers() {
    return { message: "Users retrieved successfully" };
  }

  @Post("/")
  async createUser() {
    return { message: "User created successfully" };
  }
}

šŸ“š Project Structure

src/
ā”œā”€ā”€ config/          # Configuration files
ā”œā”€ā”€ controllers/     # API Controllers
ā”œā”€ā”€ core/           # Framework core classes
ā”œā”€ā”€ decorators/     # TypeScript decorators
ā”œā”€ā”€ entities/       # TypeORM entities
ā”œā”€ā”€ middleware/     # Express middleware
ā”œā”€ā”€ repositories/   # Data access layer
ā”œā”€ā”€ scripts/        # Utility scripts
ā”œā”€ā”€ types/          # TypeScript type definitions
└── utils/          # Helper utilities

šŸ”’ Security Features

  • JWT-based authentication
  • Rate limiting protection
  • Request validation
  • Secure error handling
  • Type-safe operations

šŸ¤ Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

šŸ“ License

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