ISN SERVER EMULATOR

OPEN-SOURCE BACKEND PROJECT

Idol Shopping Network (ISN) Server Documentation

Complete clean-room PHP & SQLite backend emulator for the defunct Idol Shopping Network React Native mobile application (Hermes Bytecode Engine).

Project Overview

Idol Shopping Network (ISN) was a Philippine social e-commerce platform launched in 2021 featuring celebrity endorsements and nationwide cash-on-delivery services. The mobile application was built using React Native compiled into Hermes bytecode.

When the original production infrastructure went offline, the mobile client ceased functioning. This open-source server emulator was engineered to reconstruct all expected REST API contracts, property structures, and SQLite schemas, bringing the app back to life for software preservation, research, and offline interoperability.

Clean-Room Implementation: Built 100% from protocol analysis and bytecode decompilation. Contains zero proprietary server binaries and runs on lightweight, modern open-source stacks.

System Architecture

The server is designed with a lightweight, zero-dependency architecture:

Layer Technology Purpose
Runtime PHP 8.2+ / 8.4 (PHP-FPM) High-speed native routing with zero external framework dependencies.
Database SQLite 3 (WAL Mode) High concurrency, ACID transactions, and zero daemon overhead.
Web Server Nginx FastCGI process gateway, reverse proxy, and static asset streaming.
Authentication Argon2id + Salt + Pepper Memory-hard cryptographic security for admin and client users.
Client Target React Native (Hermes v84) Consumes standardized JSON REST endpoints (`/v1/*`).

Installation & Setup

Deploying your own ISN server takes less than 60 seconds.

1. Clone Repository

Terminalbash
git clone https://github.com/ColtonSilvaonKnoxKontor/Idol-Shopping-Network-Server.git
cd Idol-Shopping-Network-Server

2. Configure Environment

Terminalbash
cp .ske.example .ske
chmod 600 .ske

3. Run Automated CLI Installer

Terminalbash
php setup.php

4. Start Built-in Development Server

Terminalbash
php -S 0.0.0.0:8000 index.php

Configuration (.ske)

All secret keys, pepper values, and database paths are loaded from the private .ske (Silva Keys & Environment) configuration file.

.ske Configuration Fileini
# ISN Server Configuration
APP_NAME="Idol Shopping Network Server Emulator"
APP_ENV=production
APP_URL=https://isn.silvasystems.online

# Cryptographic Pepper for Password Hashing
SECURITY_PEPPER="YOUR_CUSTOM_SECRET_PEPPER_HERE"

# Admin Authentication
ADMIN_DEFAULT_PASSWORD=your_secure_admin_password_here
ADMIN_PASSWORD_FILE=

# SQLite Storage Path
DB_PATH=/path/to/your/database.sqlite

Database Engine & WAL Mode

The emulator connects via PHP PDO and configures Write-Ahead Logging (WAL) mode on every request:

Database PRAGMA Optimizationssql
PRAGMA journal_mode = WAL;
PRAGMA synchronous = NORMAL;
PRAGMA foreign_keys = ON;
Concurrency Advantage: Readers never block writers, and writers never block readers. Mobile clients can query feeds and categories simultaneously while orders are submitted.

Database Tables

Table Name Key Columns Description
users id, username, email, password_hash, role, token Registered buyers, merchants, and administrators.
categories id, name, icon_url, image_url, is_active Primary marketplace categories.
sub_categories id, category_id, name, icon, image_url Subcategory hierarchy linked to categories.
products id, category_id, sub_category_id, name, price, stock, is_idol_mall Marketplace items and varieties.
ads id, title, image_url, is_active Homepage promotional carousel banners.
orders id, order_number, user_id, total_amount, status, payment_method Customer checkout orders.

Products & Catalog API

GET /v1/products

Returns the paginated product list for the mobile app home screen.

ParameterTypeDescription
category_idintegerOptional category filter ID.
sub_category_idintegerOptional subcategory filter ID.
searchstringOptional keyword search.
Response Samplejson
{
  "success": true,
  "status": 200,
  "data": {
    "current_page": 1,
    "data": [
      {
        "id": 1,
        "name": "ISN Wireless Noise-Cancelling Headphones Pro",
        "price": 1299.00,
        "discount_price": 999.00,
        "is_idol_mall": 1,
        "latest_variety": { "price": 1299.00, "discounted": 999.00 }
      }
    ]
  }
}

Categories & Subcategories API

GET /v1/categories

Returns all active categories and nested subcategory mappings.

Response Samplejson
{
  "success": true,
  "status": 200,
  "length": 7,
  "data": [
    {
      "id": 1,
      "name": "Electronics & Gadgets",
      "image_url": "https://...",
      "sub_categories": [
        { "id": 1, "name": "Smartphones & Audio" }
      ]
    }
  ]
}

Authentication API

POST /v1/user/login

Authenticates a user and issues a Bearer authentication token.

Request Payloadjson
{
  "username": "buyer",
  "password": "password123"
}

Buyer & Cart API

GET /v1/buyer/get/cart

Retrieves user shopping cart items, subtotal, and shipping fee calculation.

POST /v1/buyer/add/cart

Adds a product variety and quantity to the user cart.

Security & Threat Defense

The emulator includes built-in protection against automated vulnerability scanners:

  • Dotfile & Key Isolation: Direct requests to .ske, .env, .git, or database.sqlite are blocked with HTTP 403 Forbidden.
  • Directory Traversal Shield: Intercepts ../ and LFI attempts.
  • Protected Admin Endpoint: Admin dashboard uses Argon2id with memory-hard hashing and private server-side pepper verification.
  • Registered User Directory: Dedicated portal at /admin/users.php to manage buyer/seller accounts, inspect in-house OTP logs, reset credentials, and generate instant demo profiles.

Custom Error Handlers

The platform features dedicated error handlers modeled after the Wayback Machine archive and featuring our custom Anime Cat Girl Mascot:

Error CodeEndpointMascot Representation
403 Forbidden/error/403.phpAnime Cat Girl Security Officer holding STOP sign.
404 Not Found/error/404.phpAnime Cat Girl Shopping Assistant searching in delivery boxes.
500 Server Error/error/500.phpSystem Maintenance Mascot.

Planned Development

Upcoming features and architecture enhancements designed to complete the full software preservation and emulation experience for the Idol Shopping Network platform:

1. In-House Self-Contained OTP Emulation Engine

Because official telecom carrier SMS gateways (Globe, Smart, Semaphore, Twilio) require paid subscriptions, external credentials, and active internet connectivity, the server emulator will feature a 100% self-contained, in-house OTP engine:

Zero-Cost & Offline Compatible: Eliminates all carrier SMS fees. Anyone running the emulator locally or in a home lab can register and verify accounts without external API dependencies.
Feature / Mechanism Implementation Details Status
Dynamic 6-Digit Generator Generates standard pseudo-random 6-digit numeric codes with 10-minute validity saved in SQLite. Live (v1.1.0)
Universal Sandbox Code (`123456`) Master bypass verification code enabling instant automated testing across all phone numbers. Live (v1.1.0)
Payload Transparency The generated code is returned directly in the JSON response ("otp": "227178") for developer inspection. Live (v1.1.0)
Virtual Credential Generator Generates realistic Philippine telco numbers (Globe, Smart, DITO) with preloaded wallet funds via /v1/auth/quick_demo. Live (v1.1.0)
Planned OTP SQLite Schemasql
CREATE TABLE IF NOT EXISTS otp_verifications (
    id INTEGER PRIMARY KEY AUTOINCREMENT,
    phone TEXT NOT NULL,
    otp_code TEXT NOT NULL,
    is_verified INTEGER DEFAULT 0,
    expires_at DATETIME NOT NULL,
    created_at DATETIME DEFAULT CURRENT_TIMESTAMP
);

2. In-House Customer Support & Live Chat System

Replaced defunct proprietary Intercom SaaS dependencies with a 100% self-hosted, in-house messaging architecture powered by SQLite and real-time polling:

EndpointMethodDescription
/v1/chat/startPOSTInitializes or fetches the active support ticket and triggers greeting from Mascot Assistant.
/v1/chat/messagesGETFetches conversation history for ticket with auto-read status updates.
/v1/chat/sendPOSTSends customer message or admin reply with intelligent automated FAQ assistance.
/v1/chat/statusPOSTUpdates ticket status (open, in_progress, resolved).
/admin/support.phpGETTwo-panel Administrator Live Support Desk for managing customer inquiries.
/chatGETResponsive, mobile-friendly customer chat client featuring the Anime Mascot Assistant.

3. Full Merchant Order & Fulfillment Lifecycle

Expanding the seller control plane to simulate real-time tracking updates, shipping waybill generation, and status progression from pendingpreparingshippeddelivered.

3. Interactive WebSocket Push Emulation

Replicating real-time order status toast notifications on the React Native mobile client using standard server-sent events (SSE) or local WebSocket streams.