Skip to content

Lightnet/minimal_module_js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

83 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

minimal_module_js

License: MIT

Packages:

  • vanjs 1.5.5
  • uuid 11.1.0
  • better-sqlite3 11.9.1
  • nanoid 5.1.5
  • hono 4.7.7
  • @hono/node-server 1.14.1
  • socket.io 4.8.1
  • dotenv 16.5.0
  • jsonwebtoken 9.0.2

Status

  • Unstable: Work in progress.
  • Focus Areas:
    • Authentication, groups, and permissions.
    • Testing framework for REST API (forum functionality).
    • Database failover: SQLite as fallback for PostgreSQL.

Information:

Work in progress. Using minimal packages in vanilla javascript, type module and import.

Project Goals

  • Build a simple, reactive forum and messaging system with minimal bandwidth usage.
  • Prioritize security (e.g., flood/spam protection) and simplicity for testing builds.
  • Support modular plugins (future consideration).
  • Ensure database reliability with SQLite as a fallback for PostgreSQL.

Testing Framework

  • Purpose: Validate core forum functionality (boards, topics, comments) for CRUD operations.
  • Current Tests:
    • Notify module tests.
  • Planned:
    • Full REST API tests for forum, authentication, and permissions.
    • Automated scripts to simulate user interactions.

Audit Logging

Simple audit logging inspired by the Grok 3.0 AI model. Logs user actions like group creation.

Example:

import { logAudit } from '../../utils/audit.js';
//...
logAudit(user.id, 'create_group', {
  group_id: newGroup.id, 
  name,
  description
});

Development

  • Scripts:
    • npm start: Start the Hono server.
    • npm test: Run the testing framework (WIP).
  • Directory Structure:
    • src/: Core application logic.
    • public/: Static assets (CSS, JS, images).
    • utils/: Helper functions (audit, backup, etc.).

File Size:

  • node_modules 49.0 MB
  • public 288 KB
  • src 192 KB

Module:

  • notify
    • css
      • animation slide
    • context
      • timeToDelete 600
      • timeToClose 1000 * 10
      • animToClose = timeToClose - timeToDelete;
    • NotifyContainer (notice message html)
    • NotifyManager (handle messages element ancher)
    • notify (set variable args to push message notice)
  • audit logs
    • logAudit
    • layout
    • backup
  • theme
    • light
    • dark
    • toggle theme
    • check theme
    • custom color
  • Message
    • sent message
    • delete message
    • blacklist alias
  • Auth
    • Account (simple username)
    • Sign in
    • Sign up
    • Recovery
  • Blog
  • Novels
  • test
    • notify test
  • Book
    • Table of content
    • Next Page
    • Previst Page
    • Create book
    • Edit book
    • Books
    • Pages
  • backup
    • layout
    • save
    • save table name
    • load / restore
  • report
    • create
    • update
    • delete
    • forum
    • access
  • ticket
    • create
    • update
    • delete
    • access

Page Admin

  • Server status
  • Database
  • Loggings
    • simple audit logs
  • Accounts
    • layout
  • Groups
    • layout
  • Permissions
    • layout
  • Novels
  • Monitor
  • Tickets
    • layout
  • Report
    • layout

Forum

  • groups
    • members
    • add
    • delete
    • update
  • permission
    • members
    • add
    • delete
    • update
  • settings (n/a)
    • cookies
    • theme
  • Forum
    • create
    • update
    • delete
  • Board
    • nav menu
    • create
    • update
    • delete
    • get forum id by boards
  • Topic
    • nav menu
    • create
    • update
    • delete
    • report
    • get board id by topics
  • Comment
    • nav menu
    • create
    • update
    • delete
    • report
    • get topic id by comments
    • Nav Menu

Images:

Desktop Mobile

Credits:

Roadmap

  • Complete authentication (recovery, advanced permissions).
  • Implement full database failover PostgreSQL (just idea for low small group of people using it.)
  • Finish testing framework for REST API.
  • Add settings (cookies, themes) and reporting features.
  • Explore plugins/mods for extensibility.

About

simple module build to keep it simple. Forum.

Resources

Stars

Watchers

Forks