ndev-stack 0.1.0__tar.gz → 0.3.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- ndev_stack-0.3.0/PKG-INFO +581 -0
- ndev_stack-0.3.0/README.md +560 -0
- ndev_stack-0.3.0/ndev/__init__.py +10 -0
- {ndev_stack-0.1.0 → ndev_stack-0.3.0}/ndev/cli.py +1 -2
- ndev_stack-0.3.0/ndev/common/__init__.py +5 -0
- {ndev_stack-0.1.0 → ndev_stack-0.3.0}/ndev/common/config.py +0 -2
- {ndev_stack-0.1.0 → ndev_stack-0.3.0}/ndev/common/constants.py +1 -0
- {ndev_stack-0.1.0 → ndev_stack-0.3.0}/ndev/common/manifest.py +0 -1
- ndev_stack-0.3.0/ndev/common/modules/__init__.py +23 -0
- ndev_stack-0.3.0/ndev/common/modules/base.py +251 -0
- ndev_stack-0.3.0/ndev/common/modules/builtin/mailpit/manifest.json +16 -0
- ndev_stack-0.3.0/ndev/common/modules/builtin/mailpit/module.py +291 -0
- ndev_stack-0.3.0/ndev/common/modules/builtin/mongodb/manifest.json +19 -0
- ndev_stack-0.3.0/ndev/common/modules/builtin/mongodb/module.py +275 -0
- ndev_stack-0.3.0/ndev/common/modules/builtin/postgres/manifest.json +15 -0
- ndev_stack-0.3.0/ndev/common/modules/builtin/postgres/module.py +313 -0
- ndev_stack-0.3.0/ndev/common/modules/builtin/redis/manifest.json +15 -0
- ndev_stack-0.3.0/ndev/common/modules/builtin/redis/module.py +312 -0
- ndev_stack-0.3.0/ndev/common/modules/manager.py +214 -0
- {ndev_stack-0.1.0 → ndev_stack-0.3.0}/ndev/linux/chroot/manager.py +0 -3
- {ndev_stack-0.1.0 → ndev_stack-0.3.0}/ndev/linux/chroot/packages.py +1 -1
- {ndev_stack-0.1.0 → ndev_stack-0.3.0}/ndev/linux/cli.py +9 -0
- {ndev_stack-0.1.0 → ndev_stack-0.3.0}/ndev/linux/commands/ctl.py +0 -1
- {ndev_stack-0.1.0 → ndev_stack-0.3.0}/ndev/linux/commands/current.py +0 -1
- {ndev_stack-0.1.0 → ndev_stack-0.3.0}/ndev/linux/commands/doctor.py +0 -2
- {ndev_stack-0.1.0 → ndev_stack-0.3.0}/ndev/linux/commands/grok.py +0 -1
- {ndev_stack-0.1.0 → ndev_stack-0.3.0}/ndev/linux/commands/list.py +0 -2
- {ndev_stack-0.1.0 → ndev_stack-0.3.0}/ndev/linux/commands/logs.py +1 -1
- ndev_stack-0.3.0/ndev/linux/commands/modules.py +194 -0
- ndev_stack-0.3.0/ndev/linux/commands/mongodb.py +73 -0
- ndev_stack-0.3.0/ndev/linux/commands/postgres.py +72 -0
- {ndev_stack-0.1.0 → ndev_stack-0.3.0}/ndev/linux/commands/reload.py +0 -1
- ndev_stack-0.3.0/ndev/linux/commands/restart.py +52 -0
- ndev_stack-0.3.0/ndev/linux/commands/start.py +51 -0
- ndev_stack-0.3.0/ndev/linux/commands/status.py +109 -0
- {ndev_stack-0.1.0 → ndev_stack-0.3.0}/ndev/linux/commands/stop.py +21 -11
- {ndev_stack-0.1.0 → ndev_stack-0.3.0}/ndev/linux/commands/update.py +0 -1
- {ndev_stack-0.1.0 → ndev_stack-0.3.0}/ndev/linux/commands/vhost.py +24 -7
- {ndev_stack-0.1.0 → ndev_stack-0.3.0}/ndev/linux/php/extensions.py +0 -1
- {ndev_stack-0.1.0 → ndev_stack-0.3.0}/ndev/linux/php/installer.py +0 -1
- {ndev_stack-0.1.0 → ndev_stack-0.3.0}/ndev/linux/php/resolver.py +0 -1
- {ndev_stack-0.1.0 → ndev_stack-0.3.0}/ndev/linux/php/templates.py +0 -1
- {ndev_stack-0.1.0 → ndev_stack-0.3.0}/ndev/linux/runtime/mailpit.py +1 -3
- {ndev_stack-0.1.0 → ndev_stack-0.3.0}/ndev/linux/runtime/pma.py +3 -2
- {ndev_stack-0.1.0 → ndev_stack-0.3.0}/ndev/linux/runtime/upgrade.py +126 -13
- {ndev_stack-0.1.0 → ndev_stack-0.3.0}/ndev/linux/tui.py +252 -43
- {ndev_stack-0.1.0 → ndev_stack-0.3.0}/ndev/main.py +2 -2
- {ndev_stack-0.1.0 → ndev_stack-0.3.0}/ndev/win/cli.py +535 -56
- {ndev_stack-0.1.0 → ndev_stack-0.3.0}/ndev/win/core/db.py +0 -1
- {ndev_stack-0.1.0 → ndev_stack-0.3.0}/ndev/win/core/elevate.py +0 -1
- {ndev_stack-0.1.0 → ndev_stack-0.3.0}/ndev/win/core/ext.py +0 -1
- {ndev_stack-0.1.0 → ndev_stack-0.3.0}/ndev/win/core/grok.py +0 -1
- {ndev_stack-0.1.0 → ndev_stack-0.3.0}/ndev/win/core/logs.py +6 -1
- {ndev_stack-0.1.0 → ndev_stack-0.3.0}/ndev/win/core/mailpit.py +22 -12
- {ndev_stack-0.1.0 → ndev_stack-0.3.0}/ndev/win/core/paths.py +9 -1
- {ndev_stack-0.1.0 → ndev_stack-0.3.0}/ndev/win/core/php.py +104 -30
- {ndev_stack-0.1.0 → ndev_stack-0.3.0}/ndev/win/core/pma.py +16 -6
- ndev_stack-0.3.0/ndev/win/core/redis_core.py +209 -0
- {ndev_stack-0.1.0 → ndev_stack-0.3.0}/ndev/win/core/services.py +0 -2
- {ndev_stack-0.1.0 → ndev_stack-0.3.0}/ndev/win/core/setup.py +10 -10
- {ndev_stack-0.1.0 → ndev_stack-0.3.0}/ndev/win/core/upgrade.py +202 -26
- {ndev_stack-0.1.0 → ndev_stack-0.3.0}/ndev/win/core/vhost.py +0 -1
- {ndev_stack-0.1.0 → ndev_stack-0.3.0}/ndev/win/tui.py +277 -54
- ndev_stack-0.3.0/ndev_stack.egg-info/PKG-INFO +581 -0
- {ndev_stack-0.1.0 → ndev_stack-0.3.0}/ndev_stack.egg-info/SOURCES.txt +15 -0
- {ndev_stack-0.1.0 → ndev_stack-0.3.0}/pyproject.toml +4 -3
- ndev_stack-0.1.0/PKG-INFO +0 -553
- ndev_stack-0.1.0/README.md +0 -532
- ndev_stack-0.1.0/ndev/__init__.py +0 -8
- ndev_stack-0.1.0/ndev/common/__init__.py +0 -3
- ndev_stack-0.1.0/ndev/linux/commands/restart.py +0 -34
- ndev_stack-0.1.0/ndev/linux/commands/start.py +0 -34
- ndev_stack-0.1.0/ndev/linux/commands/status.py +0 -81
- ndev_stack-0.1.0/ndev_stack.egg-info/PKG-INFO +0 -553
- {ndev_stack-0.1.0 → ndev_stack-0.3.0}/ndev/__main__.py +0 -0
- {ndev_stack-0.1.0 → ndev_stack-0.3.0}/ndev/common/github.py +0 -0
- {ndev_stack-0.1.0 → ndev_stack-0.3.0}/ndev/common/logger.py +0 -0
- {ndev_stack-0.1.0 → ndev_stack-0.3.0}/ndev/common/utils.py +0 -0
- {ndev_stack-0.1.0 → ndev_stack-0.3.0}/ndev/linux/__init__.py +0 -0
- {ndev_stack-0.1.0 → ndev_stack-0.3.0}/ndev/linux/chroot/shell.py +0 -0
- {ndev_stack-0.1.0 → ndev_stack-0.3.0}/ndev/linux/commands/available.py +0 -0
- {ndev_stack-0.1.0 → ndev_stack-0.3.0}/ndev/linux/commands/clean.py +0 -0
- {ndev_stack-0.1.0 → ndev_stack-0.3.0}/ndev/linux/commands/db.py +0 -0
- {ndev_stack-0.1.0 → ndev_stack-0.3.0}/ndev/linux/commands/install.py +0 -0
- {ndev_stack-0.1.0 → ndev_stack-0.3.0}/ndev/linux/commands/mailpit.py +0 -0
- {ndev_stack-0.1.0 → ndev_stack-0.3.0}/ndev/linux/commands/setup.py +0 -0
- {ndev_stack-0.1.0 → ndev_stack-0.3.0}/ndev/linux/commands/uninstall.py +0 -0
- {ndev_stack-0.1.0 → ndev_stack-0.3.0}/ndev/linux/commands/upgrade.py +0 -0
- {ndev_stack-0.1.0 → ndev_stack-0.3.0}/ndev/linux/commands/use.py +0 -0
- {ndev_stack-0.1.0 → ndev_stack-0.3.0}/ndev/linux/php/builder.py +0 -0
- {ndev_stack-0.1.0 → ndev_stack-0.3.0}/ndev/linux/php/downloader.py +0 -0
- {ndev_stack-0.1.0 → ndev_stack-0.3.0}/ndev/linux/runtime/fpm.py +0 -0
- {ndev_stack-0.1.0 → ndev_stack-0.3.0}/ndev/linux/runtime/process.py +0 -0
- {ndev_stack-0.1.0 → ndev_stack-0.3.0}/ndev/linux/runtime/sockets.py +0 -0
- {ndev_stack-0.1.0 → ndev_stack-0.3.0}/ndev/tui.py +0 -0
- {ndev_stack-0.1.0 → ndev_stack-0.3.0}/ndev/win/__init__.py +0 -0
- {ndev_stack-0.1.0 → ndev_stack-0.3.0}/ndev/win/commands/__init__.py +0 -0
- {ndev_stack-0.1.0 → ndev_stack-0.3.0}/ndev/win/core/__init__.py +0 -0
- {ndev_stack-0.1.0 → ndev_stack-0.3.0}/ndev/win/core/fcgi.py +0 -0
- {ndev_stack-0.1.0 → ndev_stack-0.3.0}/ndev/win/core/mkcert.py +0 -0
- {ndev_stack-0.1.0 → ndev_stack-0.3.0}/ndev/win/templates/vhost.conf.tmpl +0 -0
- {ndev_stack-0.1.0 → ndev_stack-0.3.0}/ndev/win/templates/vhost_ssl.conf.tmpl +0 -0
- {ndev_stack-0.1.0 → ndev_stack-0.3.0}/ndev_stack.egg-info/dependency_links.txt +0 -0
- {ndev_stack-0.1.0 → ndev_stack-0.3.0}/ndev_stack.egg-info/entry_points.txt +0 -0
- {ndev_stack-0.1.0 → ndev_stack-0.3.0}/ndev_stack.egg-info/requires.txt +0 -0
- {ndev_stack-0.1.0 → ndev_stack-0.3.0}/ndev_stack.egg-info/top_level.txt +0 -0
- {ndev_stack-0.1.0 → ndev_stack-0.3.0}/setup.cfg +0 -0
|
@@ -0,0 +1,581 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: ndev-stack
|
|
3
|
+
Version: 0.3.0
|
|
4
|
+
Summary: Cross-platform developer stack manager for PHP, FastCGI/PHP-FPM, MariaDB, Redis, PostgreSQL, MongoDB, Nginx, SSL, and Mailpit on Linux and Windows
|
|
5
|
+
Author-email: Ankit Karan <ankit.karan99@gmail.com>
|
|
6
|
+
Project-URL: Homepage, https://github.com/ankitkaran99/ndev
|
|
7
|
+
Project-URL: Repository, https://github.com/ankitkaran99/ndev
|
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
|
9
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
10
|
+
Classifier: Operating System :: Microsoft :: Windows
|
|
11
|
+
Requires-Python: >=3.10
|
|
12
|
+
Description-Content-Type: text/markdown
|
|
13
|
+
Requires-Dist: click>=8.1.0
|
|
14
|
+
Requires-Dist: typer>=0.9.0
|
|
15
|
+
Requires-Dist: rich>=13.0.0
|
|
16
|
+
Requires-Dist: textual>=0.40.0
|
|
17
|
+
Requires-Dist: httpx>=0.24.0
|
|
18
|
+
Requires-Dist: filelock>=3.12.0
|
|
19
|
+
Requires-Dist: packaging>=23.0
|
|
20
|
+
Requires-Dist: jinja2>=3.1.0
|
|
21
|
+
|
|
22
|
+
# ndev
|
|
23
|
+
|
|
24
|
+
<p align="center">
|
|
25
|
+
<h1 align="center">ndev</h1>
|
|
26
|
+
<p align="center"><strong>Universal, Zero-Config Local PHP & Web Development Stack for Windows and Linux.</strong></p>
|
|
27
|
+
</p>
|
|
28
|
+
|
|
29
|
+
<p align="center">
|
|
30
|
+
<a href="https://pypi.org/project/ndev-stack/"><img src="https://img.shields.io/pypi/v/ndev-stack.svg?color=blue" alt="PyPI Version"></a>
|
|
31
|
+
<a href="https://pypi.org/project/ndev-stack/"><img src="https://img.shields.io/pypi/pyversions/ndev-stack.svg" alt="Python Versions"></a>
|
|
32
|
+
<a href="https://github.com/ankitkaran99/ndev/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-MIT-green.svg" alt="License"></a>
|
|
33
|
+
</p>
|
|
34
|
+
|
|
35
|
+
<p align="center">
|
|
36
|
+
<img src="ui.PNG" alt="ndev Interactive Terminal UI Dashboard" width="90%">
|
|
37
|
+
</p>
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
`ndev` is an all-in-one developer environment manager that isolates, orchestrates, and runs multi-version **PHP** runtimes, **Nginx** web server, **MariaDB / MySQL**, **Redis** in-memory store, **phpMyAdmin**, **Mailpit** email sandbox, local **SSL** certificates (`mkcert`), and public HTTP tunnels (`ngrok`) on **Windows 10/11** and **Linux** (Debian/Ubuntu).
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## Key Features
|
|
46
|
+
|
|
47
|
+
- **Multi-Version PHP Environment**:
|
|
48
|
+
- **Windows**: Zero-compilation prebuilt official binaries from `windows.php.net` (PHP 5.6 – 8.5, Thread-Safe & Non-Thread-Safe, x64/x86).
|
|
49
|
+
- **Linux**: Sandboxed, unprivileged source compilation with `bubblewrap` and self-healing multiarch library paths.
|
|
50
|
+
- **Process Orchestration & FastCGI / FPM**:
|
|
51
|
+
- **Windows**: Multi-process `php-cgi.exe` FastCGI worker pools load-balanced through Nginx `upstream` blocks.
|
|
52
|
+
- **Linux**: Native `php-fpm` worker daemons over isolated Unix sockets (`~/.ndev/run/php<ver>.sock`).
|
|
53
|
+
- **Interactive Asynchronous TUI Dashboard (`ndev ui`)**:
|
|
54
|
+
- Full-screen real-time terminal UI built with Textual for live monitoring, batch start/stop/restart, on-the-fly CLI PHP version switching, folder-picker virtual host creator, and live log tailing.
|
|
55
|
+
- **Automated Nginx Virtual Hosts (`ndev vhost`)**:
|
|
56
|
+
- Generates Nginx server blocks with custom FastCGI upstreams, HTTP $\rightarrow$ HTTPS redirects, trusted local SSL certificates, and hosts file mappings.
|
|
57
|
+
- **In-Memory Store (`ndev redis`)**:
|
|
58
|
+
- Native background Redis server management (`6379`) with interactive `redis-cli` terminal integration.
|
|
59
|
+
- **Local Email Sandbox (`ndev mailpit`)**:
|
|
60
|
+
- Embedded zero-dependency SMTP email catcher (`127.0.0.1:1025`) and web inbox (`http://127.0.0.1:8025`).
|
|
61
|
+
- **Database & Web Administration (`ndev db` & `ndev pma`)**:
|
|
62
|
+
- Portable MariaDB server (`3306`) with user/database management CLI tools and local phpMyAdmin (`http://127.0.0.1:8080`).
|
|
63
|
+
- **Single-Command Stack Upgrader (`ndev upgrade`)**:
|
|
64
|
+
- Automated version scanning and non-destructive upgrading for Nginx, MariaDB, Redis, Mailpit, phpMyAdmin, mkcert, and Composer.
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## Architecture & Platform Mapping
|
|
69
|
+
|
|
70
|
+
```text
|
|
71
|
+
ndev/
|
|
72
|
+
├── main.py # Cross-platform dispatcher & runtime detector
|
|
73
|
+
├── common/ # Shared utilities, configs, logger, GitHub API
|
|
74
|
+
├── win/ # Windows native subsystem (FastCGI, Shims, Click CLI, TUI)
|
|
75
|
+
│ ├── core/ # php, services, fcgi, vhost, db, redis_core, mailpit, pma, upgrade
|
|
76
|
+
│ └── templates/ # Nginx virtual host configuration templates
|
|
77
|
+
└── linux/ # Linux native subsystem (PHP-FPM, Typer CLI, TUI, Chroot)
|
|
78
|
+
├── php/ # Source resolver, downloader, extensions, builder
|
|
79
|
+
├── chroot/ # Bubblewrap sandbox manager
|
|
80
|
+
└── runtime/ # FPM, PMA, Mailpit, and systemd daemons
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
| Subsystem | Windows 10/11 (`ndev-win`) | Linux Debian/Ubuntu (`ndev-linux`) |
|
|
84
|
+
| :--- | :--- | :--- |
|
|
85
|
+
| **PHP Distribution** | Precompiled binaries from `windows.php.net` | Compiles from official source via `bubblewrap` sandbox |
|
|
86
|
+
| **Process Model** | Multi-worker `php-cgi.exe` pools via Nginx `upstream` | Native `php-fpm` daemons over Unix domain sockets |
|
|
87
|
+
| **CLI & PATH** | Global batch shims in `%USERPROFILE%\.ndev\shims\` | Symlinks in `~/.local/bin/` |
|
|
88
|
+
| **Privilege Elevation**| Win32 `ShellExecuteExW` (`runas`) only for `hosts` | `sudo` for Nginx and `/etc/hosts` |
|
|
89
|
+
| **Web Server** | Portable Nginx in `%USERPROFILE%\.ndev\nginx\` | System Nginx via `apt install nginx` |
|
|
90
|
+
| **Database** | Portable MariaDB in `%USERPROFILE%\.ndev\mariadb\` | System MariaDB via `apt install mariadb-server` |
|
|
91
|
+
| **In-Memory Cache** | Portable Redis in `%USERPROFILE%\.ndev\redis\` | System Redis via `apt install redis-server` |
|
|
92
|
+
| **Email Sandbox** | Standalone prebuilt Mailpit binary | Standalone prebuilt Mailpit binary |
|
|
93
|
+
| **phpMyAdmin** | Served via PHP CLI server (`http://127.0.0.1:8080`) | Served via PHP CLI server (`http://127.0.0.1:8080`) |
|
|
94
|
+
| **Local SSL** | Standalone `mkcert.exe` in `shims\` | System `mkcert` package via `apt` |
|
|
95
|
+
| **TUI Dashboard** | Asynchronous Textual TUI (`ndev ui`) | Asynchronous Textual TUI (`ndev ui`) |
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
## Directory Structure & Layout
|
|
100
|
+
|
|
101
|
+
### Windows Layout (`%USERPROFILE%\.ndev`)
|
|
102
|
+
```text
|
|
103
|
+
%USERPROFILE%\.ndev\
|
|
104
|
+
├── certs\ # Local SSL certificates and cacert.pem CA bundle
|
|
105
|
+
├── downloads\ # Cached zip downloads
|
|
106
|
+
├── mariadb\ # Portable MariaDB installation & data directory
|
|
107
|
+
│ ├── bin\ # mysqld.exe, mysql.exe, mysqldump.exe
|
|
108
|
+
│ └── data\ # Database storage
|
|
109
|
+
├── nginx\ # Portable Nginx installation
|
|
110
|
+
│ ├── conf\
|
|
111
|
+
│ │ ├── nginx.conf # Main Nginx config (includes ndev-vhosts/*.conf)
|
|
112
|
+
│ │ └── ndev-vhosts\ # Virtual host configurations (*.conf)
|
|
113
|
+
│ ├── logs\ # Nginx access/error logs per virtual host
|
|
114
|
+
│ └── temp\ # FastCGI and proxy client temporary body storage
|
|
115
|
+
├── php\
|
|
116
|
+
│ └── <version>\ # Extracted PHP binaries (php.exe, php-cgi.exe, php.ini, ext/)
|
|
117
|
+
├── pma\ # Standalone phpMyAdmin installation & config.inc.php
|
|
118
|
+
├── redis\ # Portable Redis server and redis-cli binaries
|
|
119
|
+
├── run\ # Active PID and FastCGI worker state files (JSON)
|
|
120
|
+
├── shims\ # Global batch shims for PATH (php, composer, mysql, redis-cli, mailpit, ndev, etc.)
|
|
121
|
+
├── mailpit.db # Persistent message database for Mailpit
|
|
122
|
+
└── config.json # Global configuration (ports, worker counts)
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
### Linux Layout (`~/.ndev`)
|
|
126
|
+
```text
|
|
127
|
+
~/.ndev/
|
|
128
|
+
├── bin/ # Standalone binaries (mailpit)
|
|
129
|
+
├── builds/ # Source tarballs and compilation build directories
|
|
130
|
+
├── cache/ # Download and build cache
|
|
131
|
+
├── certs/ # Local SSL certificates and mkcert root CA
|
|
132
|
+
├── chroot/ # Sandboxed development packages and build root
|
|
133
|
+
├── downloads/ # Downloaded source archives
|
|
134
|
+
├── logs/ # Service and daemon logs (pma.log, mailpit.log, etc.)
|
|
135
|
+
├── php/
|
|
136
|
+
│ └── <version>/ # Compiled PHP installations (bin/, sbin/, etc/php.ini, etc/php-fpm.d/)
|
|
137
|
+
├── phpmyadmin/ # Standalone phpMyAdmin installation & config.inc.php
|
|
138
|
+
├── run/ # Active PID and Unix domain socket files (*.sock, *.pid)
|
|
139
|
+
├── current # Symlink pointing to the currently active PHP version directory
|
|
140
|
+
├── mailpit.db # Persistent message database for Mailpit
|
|
141
|
+
└── config.toml # Global build and runtime configuration
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
---
|
|
145
|
+
|
|
146
|
+
## Installation
|
|
147
|
+
|
|
148
|
+
### Standard Installation via PyPI
|
|
149
|
+
|
|
150
|
+
Install `ndev-stack` using `pip` or `pipx`:
|
|
151
|
+
|
|
152
|
+
```bash
|
|
153
|
+
# Using pip
|
|
154
|
+
pip install ndev-stack
|
|
155
|
+
|
|
156
|
+
# Or using pipx (isolated application environment)
|
|
157
|
+
pipx install ndev-stack
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
> **Note**: The package is published on PyPI as `ndev-stack`, which provides the global commands `ndev`, `ndev-win`, and `ndev-linux`.
|
|
161
|
+
|
|
162
|
+
### Development / Source Installation
|
|
163
|
+
|
|
164
|
+
```bash
|
|
165
|
+
git clone https://github.com/ankitkaran99/ndev.git
|
|
166
|
+
cd ndev
|
|
167
|
+
pip install -e .
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
---
|
|
171
|
+
|
|
172
|
+
## Quick Start Guide
|
|
173
|
+
|
|
174
|
+
### Windows 10 / 11
|
|
175
|
+
|
|
176
|
+
```powershell
|
|
177
|
+
# 1. Install ndev-stack
|
|
178
|
+
pip install ndev-stack
|
|
179
|
+
|
|
180
|
+
# 2. Download and configure portable stack (Nginx, MariaDB, Redis, mkcert, Mailpit, Composer)
|
|
181
|
+
ndev setup
|
|
182
|
+
|
|
183
|
+
# 3. Add shims to user PATH (one-time setup for global CLI access)
|
|
184
|
+
[Environment]::SetEnvironmentVariable("Path", $env:Path + ";$env:USERPROFILE\.ndev\shims", "User")
|
|
185
|
+
$env:Path += ";$env:USERPROFILE\.ndev\shims"
|
|
186
|
+
|
|
187
|
+
# 4. Verify installation & launch interactive dashboard
|
|
188
|
+
ndev doctor
|
|
189
|
+
ndev ui
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
### Linux (Debian / Ubuntu)
|
|
193
|
+
|
|
194
|
+
```bash
|
|
195
|
+
# 1. Install system build dependencies
|
|
196
|
+
sudo apt update
|
|
197
|
+
sudo apt install -y bubblewrap build-essential pkg-config nginx mkcert redis-server default-mysql-client
|
|
198
|
+
mkcert -install
|
|
199
|
+
|
|
200
|
+
# 2. Install ndev-stack
|
|
201
|
+
pip install ndev-stack
|
|
202
|
+
|
|
203
|
+
# 3. Bootstrap runtime environment and shims
|
|
204
|
+
ndev setup
|
|
205
|
+
export PATH="$HOME/.local/bin:$PATH"
|
|
206
|
+
|
|
207
|
+
# 4. Verify installation & launch interactive dashboard
|
|
208
|
+
ndev doctor
|
|
209
|
+
ndev ui
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
---
|
|
213
|
+
|
|
214
|
+
## Quick Command Reference
|
|
215
|
+
|
|
216
|
+
| Command | Action |
|
|
217
|
+
|---|---|
|
|
218
|
+
| `ndev ui` | Launch real-time Textual TUI dashboard (*aliases: `tui`, `dashboard`*) |
|
|
219
|
+
| `ndev available` | List available PHP releases (`--archives` for legacy versions) |
|
|
220
|
+
| `ndev install <ver>` | Install / compile a PHP version (`8.4`, `8.3`, `7.4`, etc.) |
|
|
221
|
+
| `ndev use <ver>` | Switch active CLI PHP version on PATH |
|
|
222
|
+
| `ndev current` | Show active CLI PHP version |
|
|
223
|
+
| `ndev list` | List installed PHP versions and daemon / worker pool status |
|
|
224
|
+
| `ndev start <target>` | Start service or pool (`all`, `nginx`, `mariadb`, `redis`, `pma`, `mailpit`, `<ver>`) |
|
|
225
|
+
| `ndev stop <target>` | Stop service or pool (`all`, `nginx`, `mariadb`, `redis`, `pma`, `mailpit`, `<ver>`) |
|
|
226
|
+
| `ndev restart <target>`| Restart service or pool (`all`, `nginx`, `mariadb`, `redis`, `pma`, `mailpit`, `<ver>`) |
|
|
227
|
+
| `ndev reload nginx` | Reload Nginx configuration without downtime |
|
|
228
|
+
| `ndev status` | View real-time service status dashboard |
|
|
229
|
+
| `ndev ctl` | Interactive terminal service control menu |
|
|
230
|
+
| `ndev vhost` | Interactive virtual host creation wizard with local SSL |
|
|
231
|
+
| `ndev vhost-list` | List all configured virtual hosts |
|
|
232
|
+
| `ndev vhost-remove` | Remove virtual host and clean up hosts file |
|
|
233
|
+
| `ndev db` | Interactive SQL database management wizard |
|
|
234
|
+
| `ndev redis` | Manage Redis server or launch interactive `redis-cli` |
|
|
235
|
+
| `ndev mailpit` | Manage local email sandbox (`install`, `start`, `stop`, `launch`, `open`) |
|
|
236
|
+
| `ndev pma` | Manage phpMyAdmin background service (`http://127.0.0.1:8080`) |
|
|
237
|
+
| `ndev ext` | Manage PECL extensions (`list`, `install`, `enable`, `disable`) |
|
|
238
|
+
| `ndev grok` | Public HTTP tunneling for local virtual hosts via ngrok |
|
|
239
|
+
| `ndev postgres` | Manage PostgreSQL server (`install`, `start`, `stop`, `restart`, `status`) |
|
|
240
|
+
| `ndev mongodb` | Manage MongoDB server (`install`, `start`, `stop`, `restart`, `status`) |
|
|
241
|
+
| `ndev module list` | List all dynamic modules and status in `<userdir>/.ndev/modules/` |
|
|
242
|
+
| `ndev module <action>`| Manage dynamic module lifecycle (`install`, `start`, `stop`, `restart`, `status`, `open`) |
|
|
243
|
+
| `ndev module create` | Scaffold a new dynamic module with manifest and template code |
|
|
244
|
+
| `ndev upgrade` | Check for and upgrade stack components (Nginx, MariaDB, Redis, PMA, Mailpit, mkcert, Composer) |
|
|
245
|
+
| `ndev upgrade --check` | Check component versions against upstream releases without upgrading |
|
|
246
|
+
| `ndev shell` | Interactive developer subshell pre-loaded with PHP/Composer/MySQL/Redis on PATH |
|
|
247
|
+
| `ndev doctor` | Run environment diagnostics and health checks |
|
|
248
|
+
| `ndev logs` | View and tail service and virtual host logs |
|
|
249
|
+
| `ndev clean` | Clean up downloads cache and stale runtime state |
|
|
250
|
+
|
|
251
|
+
---
|
|
252
|
+
|
|
253
|
+
## Detailed Usage Guide
|
|
254
|
+
|
|
255
|
+
### 1. Interactive Terminal UI Dashboard (`ndev ui`)
|
|
256
|
+
|
|
257
|
+
Launch the modern, responsive Textual TUI dashboard for real-time monitoring and process control:
|
|
258
|
+
|
|
259
|
+
```bash
|
|
260
|
+
ndev ui
|
|
261
|
+
# Aliases: ndev tui, ndev dashboard
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
- **Live Status Grid**: Monitor real-time status, PIDs, and active ports for Nginx, MariaDB, Redis, PMA, Mailpit, and PHP worker pools.
|
|
265
|
+
- **One-Click Component Setup & Upgrades**: Install uninstalled services (**Redis**, **PMA**, **Mailpit**, **Nginx**, **MariaDB**, **mkcert**, **Composer**) or upgrade existing components with single-click UI actions.
|
|
266
|
+
- **Interactive Virtual Host Manager**: Create new virtual hosts (`+ Create VHost`) with automatic local SSL (`mkcert`) and an integrated folder-picker dialog.
|
|
267
|
+
- **PHP Runtime Management**: Install any PHP version (`+ Install PHP`), uninstall versions (`✖ Uninstall Selected`), or change the active CLI PHP version via dropdown.
|
|
268
|
+
- **Batch Actions**: One-click **Start All**, **Stop All**, **Restart All**, and **Reload Nginx** from the persistent sidebar.
|
|
269
|
+
- **Integrated Log Tail Viewer**: Select and inspect live logs for Nginx, MariaDB, Redis, PHP, and Virtual Hosts.
|
|
270
|
+
|
|
271
|
+
---
|
|
272
|
+
|
|
273
|
+
### 2. PHP Version Management
|
|
274
|
+
|
|
275
|
+
```bash
|
|
276
|
+
# List available PHP releases (from php.net / windows.php.net)
|
|
277
|
+
ndev available
|
|
278
|
+
ndev available --archives # include legacy releases (5.6 - 7.3)
|
|
279
|
+
|
|
280
|
+
# Install a PHP version (prebuilt on Windows, source-compiled on Linux)
|
|
281
|
+
ndev install 8.4
|
|
282
|
+
|
|
283
|
+
# List locally installed PHP versions and daemon/pool status
|
|
284
|
+
ndev list
|
|
285
|
+
|
|
286
|
+
# Switch globally active CLI PHP version
|
|
287
|
+
ndev use 8.4
|
|
288
|
+
|
|
289
|
+
# Show current active CLI PHP version
|
|
290
|
+
ndev current
|
|
291
|
+
|
|
292
|
+
# Uninstall a PHP version
|
|
293
|
+
ndev uninstall 7.4
|
|
294
|
+
```
|
|
295
|
+
|
|
296
|
+
---
|
|
297
|
+
|
|
298
|
+
### 3. Service & Process Management
|
|
299
|
+
|
|
300
|
+
```bash
|
|
301
|
+
# Start / Stop / Restart a PHP pool or individual service
|
|
302
|
+
ndev start 8.4
|
|
303
|
+
ndev stop 8.4
|
|
304
|
+
ndev restart 8.4
|
|
305
|
+
|
|
306
|
+
# Control core services
|
|
307
|
+
ndev start nginx
|
|
308
|
+
ndev start mariadb
|
|
309
|
+
ndev start redis
|
|
310
|
+
ndev start pma
|
|
311
|
+
ndev start mailpit
|
|
312
|
+
|
|
313
|
+
# Batch operations
|
|
314
|
+
ndev start all
|
|
315
|
+
ndev stop all
|
|
316
|
+
ndev restart all
|
|
317
|
+
|
|
318
|
+
# Reload Nginx configuration without downtime
|
|
319
|
+
ndev reload nginx
|
|
320
|
+
|
|
321
|
+
# View service status
|
|
322
|
+
ndev status
|
|
323
|
+
```
|
|
324
|
+
|
|
325
|
+
---
|
|
326
|
+
|
|
327
|
+
### 4. Virtual Host Management (`vhost`)
|
|
328
|
+
|
|
329
|
+
Create and manage local Nginx sites mapped to `127.0.0.1`:
|
|
330
|
+
|
|
331
|
+
```bash
|
|
332
|
+
# Interactive wizard (auto-prompts for domain, document root, PHP version, and SSL)
|
|
333
|
+
ndev vhost
|
|
334
|
+
|
|
335
|
+
# Create a standard HTTP virtual host
|
|
336
|
+
ndev vhost --domain project.local --root /path/to/project --php 8.4
|
|
337
|
+
|
|
338
|
+
# Create an HTTPS virtual host with trusted local SSL certificates (mkcert)
|
|
339
|
+
ndev vhost --domain project.local --root /path/to/project --php 8.4 --ssl
|
|
340
|
+
|
|
341
|
+
# List all configured virtual hosts
|
|
342
|
+
ndev vhost-list
|
|
343
|
+
|
|
344
|
+
# Remove a virtual host (removes Nginx conf and cleans hosts file)
|
|
345
|
+
ndev vhost-remove --domain project.local
|
|
346
|
+
```
|
|
347
|
+
|
|
348
|
+
---
|
|
349
|
+
|
|
350
|
+
### 5. Redis In-Memory Store (`redis`)
|
|
351
|
+
|
|
352
|
+
Manage the local Redis server and launch the interactive `redis-cli`:
|
|
353
|
+
|
|
354
|
+
> [!TIP]
|
|
355
|
+
> **Redis Connection Defaults**:
|
|
356
|
+
> * **Host**: `127.0.0.1` or `localhost`
|
|
357
|
+
> * **Port**: `6379`
|
|
358
|
+
> * **Password**: None (default)
|
|
359
|
+
|
|
360
|
+
```bash
|
|
361
|
+
# Start Redis server
|
|
362
|
+
ndev redis start
|
|
363
|
+
ndev start redis
|
|
364
|
+
|
|
365
|
+
# Check Redis status
|
|
366
|
+
ndev redis status
|
|
367
|
+
ndev status redis
|
|
368
|
+
|
|
369
|
+
# Open interactive redis-cli terminal
|
|
370
|
+
ndev redis cli
|
|
371
|
+
|
|
372
|
+
# Stop or restart Redis server
|
|
373
|
+
ndev redis stop
|
|
374
|
+
ndev redis restart
|
|
375
|
+
```
|
|
376
|
+
|
|
377
|
+
#### Laravel / Symfony / WordPress Configuration:
|
|
378
|
+
```env
|
|
379
|
+
REDIS_HOST=127.0.0.1
|
|
380
|
+
REDIS_PASSWORD=null
|
|
381
|
+
REDIS_PORT=6379
|
|
382
|
+
```
|
|
383
|
+
|
|
384
|
+
---
|
|
385
|
+
|
|
386
|
+
### 6. SQL Database Manager (`db`) & phpMyAdmin (`pma`)
|
|
387
|
+
|
|
388
|
+
Manage MySQL/MariaDB databases, users, and web administration:
|
|
389
|
+
|
|
390
|
+
> [!TIP]
|
|
391
|
+
> **Default MariaDB / MySQL Credentials**:
|
|
392
|
+
> * **Host**: `127.0.0.1` or `localhost`
|
|
393
|
+
> * **Port**: `3306`
|
|
394
|
+
> * **Username**: `root`
|
|
395
|
+
> * **Password**: `root` (Windows) / system auth (Linux)
|
|
396
|
+
> * **phpMyAdmin URL**: [http://127.0.0.1:8080](http://127.0.0.1:8080)
|
|
397
|
+
|
|
398
|
+
```bash
|
|
399
|
+
# Launch interactive database management wizard
|
|
400
|
+
ndev db
|
|
401
|
+
|
|
402
|
+
# Create database and user
|
|
403
|
+
ndev db create-db mydb --owner myuser
|
|
404
|
+
ndev db create-user myuser --new-password secret --grant-db mydb
|
|
405
|
+
|
|
406
|
+
# Export & import database dumps
|
|
407
|
+
ndev db export-db mydb -o backup.sql
|
|
408
|
+
ndev db import-db mydb backup.sql
|
|
409
|
+
|
|
410
|
+
# Start phpMyAdmin web UI
|
|
411
|
+
ndev start pma
|
|
412
|
+
ndev pma
|
|
413
|
+
```
|
|
414
|
+
|
|
415
|
+
---
|
|
416
|
+
|
|
417
|
+
### 7. Local Email Sandbox (`mailpit`)
|
|
418
|
+
|
|
419
|
+
Catch every outgoing e-mail your local applications send using [Mailpit](https://github.com/axllent/mailpit):
|
|
420
|
+
|
|
421
|
+
> [!TIP]
|
|
422
|
+
> **SMTP & Web UI Defaults**:
|
|
423
|
+
> * **SMTP Server**: `127.0.0.1:1025`
|
|
424
|
+
> * **Web Inbox**: [http://127.0.0.1:8025](http://127.0.0.1:8025)
|
|
425
|
+
> * No authentication required — all emails are safely intercepted locally.
|
|
426
|
+
|
|
427
|
+
```bash
|
|
428
|
+
# Start Mailpit (auto-installs if not present)
|
|
429
|
+
ndev mailpit start
|
|
430
|
+
ndev start mailpit
|
|
431
|
+
|
|
432
|
+
# Open Web UI in default browser
|
|
433
|
+
ndev mailpit launch
|
|
434
|
+
ndev mailpit open
|
|
435
|
+
|
|
436
|
+
# Stop or restart Mailpit
|
|
437
|
+
ndev mailpit stop
|
|
438
|
+
ndev mailpit restart
|
|
439
|
+
```
|
|
440
|
+
|
|
441
|
+
#### Configuring Mailpit in your Project:
|
|
442
|
+
|
|
443
|
+
**Laravel (`.env`):**
|
|
444
|
+
```env
|
|
445
|
+
MAIL_MAILER=smtp
|
|
446
|
+
MAIL_HOST=127.0.0.1
|
|
447
|
+
MAIL_PORT=1025
|
|
448
|
+
MAIL_USERNAME=null
|
|
449
|
+
MAIL_PASSWORD=null
|
|
450
|
+
MAIL_ENCRYPTION=null
|
|
451
|
+
```
|
|
452
|
+
|
|
453
|
+
**PHP (`php.ini`):**
|
|
454
|
+
```ini
|
|
455
|
+
[mail function]
|
|
456
|
+
SMTP = 127.0.0.1
|
|
457
|
+
smtp_port = 1025
|
|
458
|
+
```
|
|
459
|
+
|
|
460
|
+
---
|
|
461
|
+
|
|
462
|
+
### 8. Stack Upgrade Engine (`upgrade`)
|
|
463
|
+
|
|
464
|
+
Scan for and upgrade stack components (Nginx, MariaDB, Redis, PMA, Mailpit, mkcert, Composer) safely against latest upstream releases:
|
|
465
|
+
|
|
466
|
+
```bash
|
|
467
|
+
# Check for available updates across all stack components
|
|
468
|
+
ndev upgrade --check
|
|
469
|
+
|
|
470
|
+
# Upgrade all components to latest stable releases
|
|
471
|
+
ndev upgrade
|
|
472
|
+
|
|
473
|
+
# Upgrade a specific component
|
|
474
|
+
ndev upgrade redis
|
|
475
|
+
ndev upgrade mailpit
|
|
476
|
+
ndev upgrade pma
|
|
477
|
+
```
|
|
478
|
+
|
|
479
|
+
---
|
|
480
|
+
|
|
481
|
+
### 9. Diagnostics & Developer Tools
|
|
482
|
+
|
|
483
|
+
```bash
|
|
484
|
+
# Run full environment health check
|
|
485
|
+
ndev doctor
|
|
486
|
+
|
|
487
|
+
# Launch pre-configured developer subshell
|
|
488
|
+
ndev shell
|
|
489
|
+
|
|
490
|
+
# Tail live logs for services or virtual hosts
|
|
491
|
+
ndev logs
|
|
492
|
+
ndev logs 8.4
|
|
493
|
+
ndev logs nginx
|
|
494
|
+
|
|
495
|
+
# Tunnel local virtual host to public web via ngrok
|
|
496
|
+
ndev grok
|
|
497
|
+
|
|
498
|
+
# Clean download cache and temporary files
|
|
499
|
+
ndev clean
|
|
500
|
+
```
|
|
501
|
+
|
|
502
|
+
---
|
|
503
|
+
|
|
504
|
+
### 10. Extensible Dynamic Modules (`ndev module`)
|
|
505
|
+
|
|
506
|
+
`ndev` features a modular architecture where core services (`nginx`, `mariadb`, `php`, `phpmyadmin`, `ngrok`) are augmented with dynamic modules (`mailpit`, `redis`, `postgres`, `mongodb`, and custom community modules) located in `<userdir>/.ndev/modules/<module_name>/`.
|
|
507
|
+
|
|
508
|
+
#### Module Commands:
|
|
509
|
+
```bash
|
|
510
|
+
# List all discovered modules and running status
|
|
511
|
+
ndev module list
|
|
512
|
+
|
|
513
|
+
# Manage module lifecycle
|
|
514
|
+
ndev module install mailpit
|
|
515
|
+
ndev module start redis
|
|
516
|
+
ndev module status postgres
|
|
517
|
+
ndev module status mongodb
|
|
518
|
+
ndev module open mailpit # Opens web UI if available
|
|
519
|
+
ndev module restart redis
|
|
520
|
+
ndev module stop redis
|
|
521
|
+
|
|
522
|
+
# Direct convenience commands also work seamlessly:
|
|
523
|
+
ndev start mailpit
|
|
524
|
+
ndev stop redis
|
|
525
|
+
ndev postgres start
|
|
526
|
+
ndev postgres status
|
|
527
|
+
ndev mongodb start
|
|
528
|
+
ndev mongodb status
|
|
529
|
+
|
|
530
|
+
# Scaffold a new custom module
|
|
531
|
+
ndev module create my-service --display-name "My Custom Service" --category queue --port 9000
|
|
532
|
+
```
|
|
533
|
+
|
|
534
|
+
#### Module Structure (`~/.ndev/modules/<name>/`):
|
|
535
|
+
```text
|
|
536
|
+
~/.ndev/modules/my-service/
|
|
537
|
+
├── manifest.json # Module metadata, ports, categories, and web UI definitions
|
|
538
|
+
└── module.py # Python lifecycle handler (is_installed, install, start, stop, restart, status, open_ui)
|
|
539
|
+
```
|
|
540
|
+
|
|
541
|
+
**Sample `manifest.json`:**
|
|
542
|
+
```json
|
|
543
|
+
{
|
|
544
|
+
"name": "my-service",
|
|
545
|
+
"display_name": "My Custom Service",
|
|
546
|
+
"version": "1.0.0",
|
|
547
|
+
"description": "Custom queue worker service",
|
|
548
|
+
"category": "queue",
|
|
549
|
+
"ports": [9000],
|
|
550
|
+
"web_ui": "http://127.0.0.1:9000",
|
|
551
|
+
"platforms": ["windows", "linux"],
|
|
552
|
+
"entrypoint": "module.py"
|
|
553
|
+
}
|
|
554
|
+
```
|
|
555
|
+
|
|
556
|
+
Dynamic modules appear automatically inside the **TUI Dashboard (`ndev ui`)**, where you can start, stop, restart, and open web interfaces with a single click.
|
|
557
|
+
|
|
558
|
+
> 📖 **Looking to build your own module?** See the full [**ndev Module Developer Guide (MODULE_DEV_GUIDE.md)**](MODULE_DEV_GUIDE.md) for step-by-step instructions, manifest schema, and boilerplate templates.
|
|
559
|
+
|
|
560
|
+
---
|
|
561
|
+
|
|
562
|
+
## Configuration Files
|
|
563
|
+
|
|
564
|
+
### Windows
|
|
565
|
+
* **Global Settings**: `%USERPROFILE%\.ndev\config.json`
|
|
566
|
+
* **PHP Configuration**: `%USERPROFILE%\.ndev\php\<version>\php.ini`
|
|
567
|
+
* **Nginx Main Config**: `%USERPROFILE%\.ndev\nginx\conf\nginx.conf`
|
|
568
|
+
* **Virtual Host Configs**: `%USERPROFILE%\.ndev\nginx\conf\ndev-vhosts\*.conf`
|
|
569
|
+
* **FastCGI Worker Pools**: Base port `13000` with 4 workers per PHP version (customizable in `config.json`).
|
|
570
|
+
|
|
571
|
+
### Linux
|
|
572
|
+
* **Global Settings**: `~/.ndev/config.toml`
|
|
573
|
+
* **PHP Configuration**: `~/.ndev/php/<version>/etc/php.ini`
|
|
574
|
+
* **PHP Extensions**: `~/.ndev/php/<version>/etc/conf.d/<ext>.ini`
|
|
575
|
+
* **PHP-FPM Pool Config**: `~/.ndev/php/<version>/etc/php-fpm.d/www.conf`
|
|
576
|
+
|
|
577
|
+
---
|
|
578
|
+
|
|
579
|
+
## License
|
|
580
|
+
|
|
581
|
+
MIT License. See [LICENSE](LICENSE) for more details.
|