Skip to content

Repository files navigation

MANAV-SHELL-TERMINAL

Hybrid voice-enabled web terminal (PWA)
Converts natural language (voice/text) into shell commands using a hybrid Regex + NLP pipeline. Frontend is a Progressive Web App with local persistence (IndexedDB). Optional Node/Express backend can be hosted on Render for cloud persistence.

Live demo: https://manav-shell.netlify.app/
Zip (uploaded): sandbox:/mnt/data/MANAV-SHELL-TERMINAL-main.zip


Table of Contents


About

MANAV-SHELL-TERMINAL is a lightweight browser-based terminal that accepts voice or text, translates natural language instructions into executable shell commands using a hybrid approach (Regex for the fast path, NLP as fallback), and runs as a PWA for cross-platform usage.


Features

  • Voice-to-text input (Web Speech API)
  • Hybrid Regex + NLP command translation
  • Browser-based command sandbox and execution UI
  • Local persistence via IndexedDB
  • PWA support (manifest + service worker)
  • Optional Node/Express backend for syncing history/settings
  • Lightweight, responsive UI

Tech Stack

  • Frontend: HTML5, CSS3, Vanilla JavaScript
  • PWA: manifest.json, sw.js
  • Backend (optional): Node.js + Express (server.js, app.js)
  • Storage: IndexedDB (client), JSON files or DB for backend
  • Hosting: Netlify (frontend) / Render (backend) recommended

Repo Structure (top-level)

. ├── .gitignore ├── app.js # frontend app logic (may contain backend URL) ├── index.html ├── manifest.json ├── package.json ├── package-lock.json ├── server.js # Express backend (optional) ├── start.bat ├── style.css ├── sw.js # service worker ├── terminal.png └── test-setup.sh

yaml Copy code


Quick Start — Local

  1. Get the code

    • Clone repo:
      git clone https://github.com/dhyanmanav/MANAV-SHELL-TERMINAL.git
      cd MANAV-SHELL-TERMINAL
    • OR extract the uploaded zip:
      unzip /path/to/MANAV-SHELL-TERMINAL-main.zip -d MANAV-SHELL-TERMINAL
      cd MANAV-SHELL-TERMINAL
      
  2. Frontend-only (quick test)

    • Open index.html in a modern browser (Chrome recommended).
    • Use DevTools → Application to inspect service worker & IndexedDB.
  3. Run backend (optional)

    • Install dependencies:
      npm install
    • Start server:
      node server.js
      # or if package.json has a start script:
      npm start
    • Default server listens on process.env.PORT || 3000.
  4. Point frontend to backend

    • If you run backend locally on e.g. http://localhost:3000, update the backend URL variable in app.js (or wherever configured).

Deploy Backend to Render (step-by-step)

Render makes deploying a Node/Express backend straightforward.

  1. Push repo to GitHub (if not already):
    git add .
    git commit -m "Prepare for Render"
    git push origin main

Create new Web Service on Render

Go to https://render.com → Dashboard → New → Web Service.

Connect your GitHub account and select the MANAV-SHELL-TERMINAL repository.

Branch: main (or the branch you use).

Build Command: leave blank for pure Node apps or npm install if needed.

Start Command: if entry file is server.js, use:

nginx Copy code node server.js or set npm start if package.json includes start script.

Environment variables

If your server expects any env vars, set them in Render → Environment → Add Environment Variables (e.g., PORT, DB_URL).

For simple JSON persistence, no DB is required; set a PERSISTENCE_PATH if your server expects it.

CORS

Ensure server.js enables CORS for your frontend origin:

const cors = require('cors'); app.use(cors({ origin: 'https://manav-shell.netlify.app' })); Or set to '*' for initial testing (not recommended for production).

Deploy

Click Create Web Service → Render will build and deploy. Once deployed you'll get a URL like https://your-service.onrender.com.

Configure Frontend (point to Render backend) Open frontend file (likely app.js or a configuration constant).

Find the backend URL placeholder (e.g., BACKEND_URL = '') and set: const BACKEND_URL = 'https://your-service.onrender.com';

Save and redeploy frontend (if hosted on Netlify, push changes and Netlify will redeploy).

Note: If frontend is static and served from Netlify, ensure Netlify site and Render backend are allowed to communicate (CORS allowed on server).

PWA / Offline manifest.json configures app name, icons, start_url, and scope.

sw.js caches essential static assets; verify caching strategy and update logic.

Test PWA:

Chrome DevTools → Application → Service Workers.

Load site → go offline → reload to ensure cached assets serve.

Contributing Fork the repo

Create a feature branch: git checkout -b feat/my-feature

Commit changes: git commit -m "Add feature"

Push: git push origin feat/my-feature

Open a Pull Request

License

MIT License Copyright (c) 2025 dhyanmanav

Contact

Author: dhyanmanav Repo: https://github.com/dhyanmanav/MANAV-SHELL-TERMINAL Demo: https://manav-shell.netlify.app/

About

5TH SEM MINI PROJECT

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages