Noble-system

byMuhammad Shahzad Gull

3D Build You are an Elite Full-Stack Cybersecurity Architect and Systems Engineer operating at absolute peak capacity. We are building a complete, 100% production-ready, ultra-secure distributed management network platform named "NexusGrid" from scratch. THE ABSOLUTE DIRECTIVE: You must generate the full, un-truncated, real-working codebase for this entire system across all required layers. Do not use placeholders, shorthand methods, or pseudo-comments like "// implement logic here" or "// rest of the code remains the same". Every single line of code, route handler, state context, token interceptor, UI card, and mathematical mutation logic must be fully written out from start to finish. The system must be meticulously constructed using the following engineering stack: - Frontend Core: React 19, Vite 7, TypeScript - Styling Framework: Tailwind CSS v4 (with beautiful premium dark-mode console aesthetics) - Backend Engine: Express with Node.js & TypeScript - Data Storage Ledger: Local persistent SQLite structure managed via clean transactional code - Live Sync Layer: High-frequency WebSocket communication (Socket.io) for real-time dashboard updates --- ### ARCHITECTURAL BLUEPRINT & SYSTEM REQUIREMENTS #### PHASE 1: THE BACKEND CORE ENGINE (`server/index.ts`) 1. Database Schema & State: Set up local structured tables/entities for: - `Users`: Storing UUID, unique username, secure hashed password, role ('admin' or 'user'), and current wallet balance. - `Ledger Transactions`: Mapping TxID, UserID, type ('deposit' | 'withdrawal'), exact USDT-TRC20 amount, status ('pending' | 'approved' | 'rejected'), and timestamp. - `System Configurations`: Storing live CPM values, network coefficients, active link redirects, and operational feature flags. 2. Authentication Middleware: Implement rigorous cryptographic hashing for registration/login and strict JWT token extraction/verification route-guards. 3. Functional API Endpoints: - `/api/auth/register` & `/api/auth/login`: Issue secure JWT tokens upon successful authorization. - `/api/ledger/withdraw`: Process a withdrawal request, verify the user has sufficient funds, deduct the amount from their active balance, and push it to the ledger as 'pending'. - `/api/admin/config` (GET/PUT): Restrict to 'admin' role; securely read and overwrite the global system CPM and configuration states. - `/api/admin/settle-tx` (POST): Restrict to 'admin' role; update transaction status to 'approved' or 'rejected'. If 'rejected', automatically refund the deducted USDT balance back to the user's live profile instantly. 4. WebSocket Streamer: Initialize a Socket.io server to continuously broadcast live simulated high-frequency network metrics (Node Latency, Throughput MB/s, Traffic Waves) to all connected clients. #### PHASE 2: GLOBAL STATE & REAL-TIME INTERCEPTOR (`src/context/AuthContext.tsx`) 1. Create a global React Context Provider that manages: `user` profile data, `isAuthenticated` flags, active JWT tokens, and real-time synchronized `walletBalance`. 2. Session Continuity: On application mount, read the token from LocalStorage, validate the session, and seamlessly restore the user's active interface state. 3. Client-Side WebSocket Integration: Securely initialize the Socket.io client using the active JWT context to catch live metric streams and trigger instantaneous visual UI refreshes without ever requiring a manual browser reload. #### PHASE 3: THE HIGH-END CONSOLE UTILITY (`src/App.tsx`) Rewrite the root frontend matrix completely to serve as a secure, beautiful, fully responsive dark-themed dashboard operating under strict role route-guards: 1. The Cryptographic Auth Gate: Render an elegant, premium form interface if `isAuthenticated` is false. Handle errors dynamically and toggle cleanly between Login and Registration states. 2. Standard User Dashboard View: - Live Metric Grid: Display gorgeous animated data modules displaying Live Wallet Balance ($), Live Server Latency (ms), and Data Throughput. - Crypto Transaction Panes: A Deposit section with a simulated USDT-TRC20 address hash featuring a working "Copy to Clipboard" action button, and a fully wired Withdrawal request form that pipes data straight to the backend ledger. - Live Activity Feed: An auto-scrolling terminal log rendering ongoing system actions dynamically. 3. The Secret Admin Override Panel (Shadow Control Hub): - Enforce rigorous role evaluation: This panel must remain completely hidden and structurally un-rendered unless `user.role === 'admin'`. - Global Parameter Overwrite Form: Create fully interactive text inputs and toggle parameters tied directly to `/api/admin/config`. Saving changes must instantly mutate global CPM variables across the entire eco-system. - Financial Ledger Approval Board: Render a complete management table pulling all 'pending' requests from the ledger. Each row must feature fully functional "Approve" and "Reject" buttons that instantly dispatch API calls to `/api/admin/settle-tx` and modify user data in real-time. --- ### INSTRUCTIONS FOR OUTPUT PRODUCTION Generate the complete, robust, ready-to-copy code blocks for these files in your response: 1. `server/index.ts` (Complete Backend Engine + WebSockets + APIs + Persistent SQLite/Ledger Logic) 2. `src/context/AuthContext.tsx` (Complete React Context + Token Storage + WebSocket Listener) 3. `src/App.tsx` (Complete UI Matrix + Premium Dark Theme + Auth Gate + User Console + Guarded Shadow Admin Ledger) Do not truncate. Do not skip logic. Deliver the entire functional platform code blocks right now.

HomeLoginRegisterWithdrawAdminPanel
Home

Comments (0)

No comments yet. Be the first!

System Requirements

System Requirement Document
Page 1 of 4

Noble-system System Requirements Document

1. Introduction

The Noble-system is a comprehensive, ultra-secure distributed management network platform designed to provide a robust and efficient environment for managing transactions and configurations. This document outlines the system requirements for the Noble-system, ensuring that all functionalities are clearly defined and implemented.

2. System Overview

Noble-system is designed to be a secure, real-time management platform that facilitates user transactions and administrative configurations. It leverages a modern tech stack to ensure high performance, security, and scalability. The system includes a backend core engine, a global state management system, and a high-end console utility for user interaction.

3. Functional Requirements

  • As a User, I should be able to register and login securely using JWT tokens.
  • As a User, I should be able to view my live wallet balance and transaction history.
  • As a User, I should be able to request withdrawals and have them processed securely.
  • As an Admin, I should be able to access and modify system configurations.
  • As an Admin, I should be able to approve or reject user transactions.
  • As a User, I should be able to view live server metrics such as latency and throughput.
  • As an Admin, I should have access to a hidden control hub for managing system parameters.
Page 2 of 4

4. User Personas

  • User: A registered individual who can manage their wallet, view transactions, and request withdrawals.
  • Admin: A privileged user with access to system configurations and transaction approvals.

5. Core User Flows

  • User registers -> receives JWT token -> logs in -> views dashboard -> requests withdrawal -> admin approves/rejects -> user notified.
  • Admin logs in -> accesses control hub -> modifies system configurations -> approves/rejects transactions -> changes reflected in real-time.

6. Visuals Colors and Theme

  • primary: #1a202c (Dark Slate)
  • primary_light: #2d3748 (Slate Gray)
  • secondary: #e53e3e (Crimson Red)
  • accent: #38b2ac (Teal)
  • highlight: #f6ad55 (Amber)
  • bg: #f7fafc (White Smoke)
  • surface: rgba(255, 255, 255, 0.8)
  • text: #2d3748 (Charcoal)
  • text_muted: #718096 (Gray)
  • border: rgba(226, 232, 240, 0.5)
Page 3 of 4

7. Signature Design Concept

The homepage of Noble-system will feature an interactive 3D galaxy map where each star represents a feature or section of the platform. Users can click on a star to open a detailed view of that feature, drag to rotate the galaxy, and hover to highlight connections between features. This concept will be implemented using @react-three/fiber and @react-three/drei for a seamless and engaging user experience.

8. Interaction Model & Motion Direction

The landing page will utilize a "parallax" interaction model, providing a layered depth effect as users scroll through the page. This will create a visually rich first impression, with decorative layers moving at different speeds while the main content scrolls naturally. Internal pages will adopt a "static" model for clarity and ease of use.

9. Non-Functional Requirements

  • The system must ensure data security and integrity at all times.
  • The platform should be highly available and scalable to accommodate growing user demands.
  • The user interface must be responsive and accessible across all devices.
Page 4 of 4

10. Tech Stack

  • Frontend: React 19, Vite 7, TypeScript
  • Styling: Tailwind CSS v4
  • Backend: Express with Node.js & TypeScript
  • Database: SQLite
  • Real-time Communication: Socket.io

11. Assumptions and Constraints

  • The system will operate within a secure network environment.
  • Users are assumed to have basic technical proficiency.
  • The platform will adhere to local data protection regulations.

12. Glossary

  • JWT: JSON Web Token, a compact, URL-safe means of representing claims to be transferred between two parties.
  • CPM: Cost Per Mille, a marketing term used to denote the price of 1,000 advertisement impressions.
  • USDT-TRC20: A stablecoin pegged to the US dollar, operating on the TRON blockchain.
Home design preview
Login: Sign In
Dashboard: View Overview
AdminPanel: View Ledger
AdminPanel: Approve Transaction
AdminPanel: Reject Transaction
AdminPanel: View Config
AdminPanel: Modify Config
Dashboard: View Live Metrics
AdminPanel: Manage Users