Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/shravan20/neonode-oss-quick-starter

Node.js/TypeScript starter kit optimized for seamless development and deployment, powered by Neon.tech
https://github.com/shravan20/neonode-oss-quick-starter

database deno javascript nodejs postgres postgresql serverless typescript

Last synced: 4 months ago
JSON representation

Node.js/TypeScript starter kit optimized for seamless development and deployment, powered by Neon.tech

Awesome Lists containing this project

README

        


logo

Neonode Quick Starter

A production-ready, class-based Node.js/TypeScript starter project with Flexible Framework and PostgreSQL as DB, designed for modular and scalable applications.

[![Build Status](https://img.shields.io/github/actions/workflow/status/shravan20/neonode-quick-starter/ci.yml)](https://github.com/shravan20/neonode-quick-starter/actions)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

## Table of Contents

- [x] [**Features**](#features)
- [x] [**Getting Started**](#getting-started)
- Prerequisites
- Installation
- Configuration (Environment Variables)
- [x] [**Project Structure**](#project-structure)
- [ ] [**Usage**]()
- Health Check Endpoint
- Logging
- [ ] **Deployment**
- [x] [**Contributing**](#contributing)

### Features

- [x] **TypeScript**: Fully typed for stronger code reliability.
- [x] **Class-based Architecture**: Organized using classes for controllers, routers, and services.
- [x] **Middleware**: Pre-configured for JSON parsing, URL encoding, etc.
- [x] **Environment Config**: Use DotEnv for storing custom configurations in process.env.
- [ ] **API Documentation**: Integrates with Swagger or similar tools for auto-generated docs.
- [ ] **API Versioning**: Supports versioning for backward compatibility.
- [ ] **Caching**: Implements caching with Valkey/KeyDB support.
- [ ] **Routing**: Separates Web Routes and API Routes for better organization.
- [ ] **Authentication Middleware**: Uses CSRF Tokens for Web routes, JWT for API routes.
- [ ] **Testing**: Comprehensive unit and integration testing with Jest/Mocha.
- [ ] **Database Migration**: Supports tools like Knex or Sequelize for schema management.
- [ ] **Health Monitoring**: Easy integration with tools like Prometheus/Datadog.
- [ ] **Background Queues**: Implements background job processing.
- [x] **Logging Interceptor**: Uses Winston for enhanced log management.
- [ ] **PostgreSQL Queries**: Supports atomic PostgreSQL queries on demand.
- [ ] **Connection Pools**: Customizable backend storage connection pools.
- [ ] **Rate Limiting**: Limits requests per user to prevent abuse.
- [ ] **Global Handlers**: Centralized response and error handling.
- [x] **Graceful Shutdown**: Ensures smooth server shutdown.
- [ ] **Multi-language Support**: Adds i18n for multiple languages.
- [ ] **Task Scheduler**: Supports scheduled tasks with node-cron.
- [ ] **Documentation**:
- [x] README.md
- [x] License.md
- [x] Code of Conduct.md
- [x] Contributing.md
- [ ] Architecture.md
- [x] Security.md
- [ ] Deployment.md
- [ ] Configuration.md
- [ ] Roadmap.md
- [ ] Support.md
- [ ] API_docs.md
- [ ] FAQ.md
- [ ] Acknowledgements.md
- [ ] Changelog.md

### Getting Started

#### Prerequisites

- Node.js (v16.x or higher)
- npm or yarn
- Docker (optional, for containerization)

#### Installation

Configuration: The application uses environment variables for configuration. Create a .env file at the root of the project and add the necessary variables from `.env.template` for successful execution in dev/production env.

Steps to setup the code:

1. Clone the repository

```sh
git clone https://github.com/shravan20/neonode-quick-starter.git
cd neonode-quick-starter
```

2. Install dependencies

```sh
npm install
```

3. Running Locally

```sh
npm run dev
```

This will start the development server with hot-reloading.

4. Running in Production

```sh
npm run build && npm start
```

### Project Structure

```sh
πŸ“‚ src
β”‚
β”œβ”€β”€ πŸ“‚ api # Contains the main application logic (entities and modules)
β”‚ β”œβ”€β”€ πŸ“‚ entities # Data models, types, and schemas (e.g., database entities, DTOs)
β”‚ β”‚ └── user.entity.ts # Example: User entity schema
β”‚ β”‚ └── base.entity.ts # Example: Base entity schema
β”‚ └── πŸ“‚ modules # Application modules, each encapsulated in its own directory
β”‚ β”œβ”€β”€ πŸ“‚ health-check # Health check module
β”‚ β”‚ β”œβ”€β”€ health-check.controller.ts # Handles incoming requests and responses
β”‚ β”‚ β”œβ”€β”€ health-check.repository.ts # Data persistence logic
β”‚ β”‚ β”œβ”€β”€ health-check.router.ts # Routes definition for health check API
β”‚ β”‚ └── health-check.service.ts # Business logic related to health checks
β”‚ └── πŸ“‚ user # User module (example)
β”‚ β”œβ”€β”€ user.controller.ts # Handles user-related requests
β”‚ β”œβ”€β”€ user.repository.ts # User data persistence
β”‚ β”œβ”€β”€ user.router.ts # Routes definition for user API
β”‚ └── user.service.ts # Business logic for user operations
β”œβ”€β”€ app.ts # Application initialization and configuration
β”œβ”€β”€ πŸ“‚ helpers # Utility functions and helpers
β”‚ └── logger.ts # Custom logger setup (e.g., Pino or Winston)
β”œβ”€β”€ πŸ“‚ middlewares # Custom middleware functions (e.g., authentication, error handling)
β”‚ └── auth.middleware.ts # Example: Authentication middleware
β”œβ”€β”€ server.ts # Server startup and configuration (Express.js instance)

```

### Contributing

Contributions are always welcome and encouraged! While I strive to cover as many use cases as possible. If you come across any issues or something that doesn't make sense, feel free to open an issueβ€”I'd be happy to discuss and improve things together.

For further details, refer to [contributing.md](./contributing.md)