NIGHT CODE

Powerful code-server environments for developers and teams

Experience seamless development with our cloud-based code environments. Perfect for remote teams, educational institutions, and individual developers.

NIGHT FRAMEWORK

NIGHT is a lightweight, flexible PHP framework designed for rapid application development with a focus on API creation, resource management, and asynchronous processing. This framework provides a simple yet powerful structure for building web applications and APIs with minimal configuration.

Core Features

Discover what makes NIGHT Framework powerful and efficient

Routing System

Class-based routing system that maps URLs directly to classes and methods with minimal configuration.

API-First Design

Built-in support for JSON API responses with standardized formatting and error handling.

Database Operations

Simple PDO wrapper for database operations with support for CRUD operations and multiple connections.

Dynamic Content

Load HTML, CSS, and JavaScript content dynamically from resources for modular application development.

Storage Module

Simple file upload and storage management with support for various upload methods.

Queue Processing

Asynchronous processing of tasks like emails, notifications, and SMS messages.

Getting Started

Start building with NIGHT Framework in minutes

Tech Stack Ready-to-Go

  • Docker
  • PHP 7.4 or higher
  • MySQL/MariaDB database
  • Apache web server with mod_rewrite enabled

Installation

  1. Clone the repository to your web server directory
  2. Create a configuration file .config.json in the project's root directory
  3. Set up your database connection in the configuration file
  4. Use docker to speed up the server setup
{
  "dbstring": "mysql:host=localhost;dbname=yourdb;charset=utf8",
  "dbuser": "username",
  "dbpass": "password",
  "DEVELOPMENT": true
}

Documentation

Comprehensive guides to help you build with NIGHT Framework

Routing System

The framework uses a simple routing system based on class and function parameters in the URL:

https://yourdomain.com/{class}/{function}?param1=value1¶m2=value2

For example:

  • https://site.com/ calls the index() method of the site class
  • https://site.com/page calls the index() method of the page class
  • https://site.com/app/api calls the api() method of the app class

API Development

NIGHT makes it easy to create APIs using the openapi trait:

class api {
    use \openapi;

    public static function string($data=[]) { 
        return 'Hello World'; 
        // Returns {"result":"Hello World"}
    }

    public static function array($data=[]) { 
        return ["name" => "John", "age" => 30]; 
        // Returns {"result":2,"data":{"name":"John","age":30}}
    }
}

Contact Us

Get in touch with our team for support or inquiries