ndev-stack 0.3.3__tar.gz → 0.3.4__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.
Files changed (113) hide show
  1. {ndev_stack-0.3.3 → ndev_stack-0.3.4}/PKG-INFO +614 -582
  2. {ndev_stack-0.3.3 → ndev_stack-0.3.4}/README.md +39 -7
  3. {ndev_stack-0.3.3 → ndev_stack-0.3.4}/ndev/__init__.py +1 -1
  4. {ndev_stack-0.3.3 → ndev_stack-0.3.4}/ndev/common/constants.py +1 -1
  5. ndev_stack-0.3.4/ndev/common/distro.py +137 -0
  6. {ndev_stack-0.3.3 → ndev_stack-0.3.4}/ndev/common/modules/builtin/mongodb/module.py +6 -3
  7. {ndev_stack-0.3.3 → ndev_stack-0.3.4}/ndev/common/modules/builtin/postgres/module.py +5 -2
  8. {ndev_stack-0.3.3 → ndev_stack-0.3.4}/ndev/common/modules/builtin/redis/module.py +5 -2
  9. {ndev_stack-0.3.3 → ndev_stack-0.3.4}/ndev/linux/chroot/manager.py +92 -60
  10. ndev_stack-0.3.4/ndev/linux/chroot/packages.py +128 -0
  11. {ndev_stack-0.3.3 → ndev_stack-0.3.4}/ndev/linux/cli.py +246 -244
  12. {ndev_stack-0.3.3 → ndev_stack-0.3.4}/ndev/linux/commands/clean.py +41 -25
  13. {ndev_stack-0.3.3 → ndev_stack-0.3.4}/ndev/linux/commands/ctl.py +216 -191
  14. {ndev_stack-0.3.3 → ndev_stack-0.3.4}/ndev/linux/commands/doctor.py +86 -54
  15. {ndev_stack-0.3.3 → ndev_stack-0.3.4}/ndev/linux/commands/grok.py +74 -97
  16. ndev_stack-0.3.4/ndev/linux/commands/logs.py +94 -0
  17. ndev_stack-0.3.4/ndev/linux/commands/reload.py +41 -0
  18. ndev_stack-0.3.4/ndev/linux/commands/restart.py +41 -0
  19. {ndev_stack-0.3.3 → ndev_stack-0.3.4}/ndev/linux/commands/setup.py +134 -113
  20. ndev_stack-0.3.4/ndev/linux/commands/start.py +41 -0
  21. {ndev_stack-0.3.3 → ndev_stack-0.3.4}/ndev/linux/commands/status.py +157 -109
  22. ndev_stack-0.3.4/ndev/linux/commands/stop.py +41 -0
  23. {ndev_stack-0.3.3 → ndev_stack-0.3.4}/ndev/linux/commands/vhost.py +386 -367
  24. {ndev_stack-0.3.3 → ndev_stack-0.3.4}/ndev/linux/php/builder.py +186 -183
  25. {ndev_stack-0.3.3 → ndev_stack-0.3.4}/ndev/linux/php/downloader.py +1 -1
  26. ndev_stack-0.3.4/ndev/linux/php/installer.py +65 -0
  27. {ndev_stack-0.3.3 → ndev_stack-0.3.4}/ndev/linux/php/templates.py +4 -2
  28. {ndev_stack-0.3.3 → ndev_stack-0.3.4}/ndev/linux/runtime/mailpit.py +2 -1
  29. ndev_stack-0.3.4/ndev/linux/runtime/nginx_helper.py +269 -0
  30. {ndev_stack-0.3.3 → ndev_stack-0.3.4}/ndev/linux/runtime/pma.py +229 -224
  31. {ndev_stack-0.3.3 → ndev_stack-0.3.4}/ndev/linux/runtime/process.py +2 -0
  32. ndev_stack-0.3.4/ndev/linux/runtime/services.py +319 -0
  33. {ndev_stack-0.3.3 → ndev_stack-0.3.4}/ndev/linux/runtime/sockets.py +4 -2
  34. {ndev_stack-0.3.3 → ndev_stack-0.3.4}/ndev/linux/runtime/upgrade.py +595 -544
  35. {ndev_stack-0.3.3 → ndev_stack-0.3.4}/ndev/linux/tui.py +1600 -1632
  36. {ndev_stack-0.3.3 → ndev_stack-0.3.4}/ndev/win/bin/shim.exe +0 -0
  37. {ndev_stack-0.3.3 → ndev_stack-0.3.4}/ndev_stack.egg-info/PKG-INFO +614 -582
  38. {ndev_stack-0.3.3 → ndev_stack-0.3.4}/ndev_stack.egg-info/SOURCES.txt +4 -0
  39. {ndev_stack-0.3.3 → ndev_stack-0.3.4}/pyproject.toml +1 -1
  40. {ndev_stack-0.3.3 → ndev_stack-0.3.4}/setup.cfg +4 -4
  41. ndev_stack-0.3.4/tests/test_opensuse_compat.py +303 -0
  42. ndev_stack-0.3.3/ndev/linux/chroot/packages.py +0 -91
  43. ndev_stack-0.3.3/ndev/linux/commands/logs.py +0 -36
  44. ndev_stack-0.3.3/ndev/linux/commands/reload.py +0 -25
  45. ndev_stack-0.3.3/ndev/linux/commands/restart.py +0 -52
  46. ndev_stack-0.3.3/ndev/linux/commands/start.py +0 -51
  47. ndev_stack-0.3.3/ndev/linux/commands/stop.py +0 -44
  48. ndev_stack-0.3.3/ndev/linux/php/installer.py +0 -41
  49. {ndev_stack-0.3.3 → ndev_stack-0.3.4}/ndev/__main__.py +0 -0
  50. {ndev_stack-0.3.3 → ndev_stack-0.3.4}/ndev/cli.py +0 -0
  51. {ndev_stack-0.3.3 → ndev_stack-0.3.4}/ndev/common/__init__.py +0 -0
  52. {ndev_stack-0.3.3 → ndev_stack-0.3.4}/ndev/common/config.py +0 -0
  53. {ndev_stack-0.3.3 → ndev_stack-0.3.4}/ndev/common/github.py +0 -0
  54. {ndev_stack-0.3.3 → ndev_stack-0.3.4}/ndev/common/logger.py +0 -0
  55. {ndev_stack-0.3.3 → ndev_stack-0.3.4}/ndev/common/manifest.py +0 -0
  56. {ndev_stack-0.3.3 → ndev_stack-0.3.4}/ndev/common/modules/__init__.py +0 -0
  57. {ndev_stack-0.3.3 → ndev_stack-0.3.4}/ndev/common/modules/base.py +0 -0
  58. {ndev_stack-0.3.3 → ndev_stack-0.3.4}/ndev/common/modules/builtin/mailpit/manifest.json +0 -0
  59. {ndev_stack-0.3.3 → ndev_stack-0.3.4}/ndev/common/modules/builtin/mailpit/module.py +0 -0
  60. {ndev_stack-0.3.3 → ndev_stack-0.3.4}/ndev/common/modules/builtin/mongodb/manifest.json +0 -0
  61. {ndev_stack-0.3.3 → ndev_stack-0.3.4}/ndev/common/modules/builtin/postgres/manifest.json +0 -0
  62. {ndev_stack-0.3.3 → ndev_stack-0.3.4}/ndev/common/modules/builtin/redis/manifest.json +0 -0
  63. {ndev_stack-0.3.3 → ndev_stack-0.3.4}/ndev/common/modules/manager.py +0 -0
  64. {ndev_stack-0.3.3 → ndev_stack-0.3.4}/ndev/common/utils.py +0 -0
  65. {ndev_stack-0.3.3 → ndev_stack-0.3.4}/ndev/linux/__init__.py +0 -0
  66. {ndev_stack-0.3.3 → ndev_stack-0.3.4}/ndev/linux/chroot/shell.py +0 -0
  67. {ndev_stack-0.3.3 → ndev_stack-0.3.4}/ndev/linux/commands/available.py +0 -0
  68. {ndev_stack-0.3.3 → ndev_stack-0.3.4}/ndev/linux/commands/current.py +0 -0
  69. {ndev_stack-0.3.3 → ndev_stack-0.3.4}/ndev/linux/commands/db.py +0 -0
  70. {ndev_stack-0.3.3 → ndev_stack-0.3.4}/ndev/linux/commands/install.py +0 -0
  71. {ndev_stack-0.3.3 → ndev_stack-0.3.4}/ndev/linux/commands/list.py +0 -0
  72. {ndev_stack-0.3.3 → ndev_stack-0.3.4}/ndev/linux/commands/mailpit.py +0 -0
  73. {ndev_stack-0.3.3 → ndev_stack-0.3.4}/ndev/linux/commands/modules.py +0 -0
  74. {ndev_stack-0.3.3 → ndev_stack-0.3.4}/ndev/linux/commands/mongodb.py +0 -0
  75. {ndev_stack-0.3.3 → ndev_stack-0.3.4}/ndev/linux/commands/postgres.py +0 -0
  76. {ndev_stack-0.3.3 → ndev_stack-0.3.4}/ndev/linux/commands/uninstall.py +0 -0
  77. {ndev_stack-0.3.3 → ndev_stack-0.3.4}/ndev/linux/commands/update.py +0 -0
  78. {ndev_stack-0.3.3 → ndev_stack-0.3.4}/ndev/linux/commands/upgrade.py +0 -0
  79. {ndev_stack-0.3.3 → ndev_stack-0.3.4}/ndev/linux/commands/use.py +0 -0
  80. {ndev_stack-0.3.3 → ndev_stack-0.3.4}/ndev/linux/php/extensions.py +0 -0
  81. {ndev_stack-0.3.3 → ndev_stack-0.3.4}/ndev/linux/php/resolver.py +0 -0
  82. {ndev_stack-0.3.3 → ndev_stack-0.3.4}/ndev/linux/runtime/fpm.py +0 -0
  83. {ndev_stack-0.3.3 → ndev_stack-0.3.4}/ndev/main.py +0 -0
  84. {ndev_stack-0.3.3 → ndev_stack-0.3.4}/ndev/tui.py +0 -0
  85. {ndev_stack-0.3.3 → ndev_stack-0.3.4}/ndev/win/__init__.py +0 -0
  86. {ndev_stack-0.3.3 → ndev_stack-0.3.4}/ndev/win/cli.py +0 -0
  87. {ndev_stack-0.3.3 → ndev_stack-0.3.4}/ndev/win/commands/__init__.py +0 -0
  88. {ndev_stack-0.3.3 → ndev_stack-0.3.4}/ndev/win/core/__init__.py +0 -0
  89. {ndev_stack-0.3.3 → ndev_stack-0.3.4}/ndev/win/core/db.py +0 -0
  90. {ndev_stack-0.3.3 → ndev_stack-0.3.4}/ndev/win/core/elevate.py +0 -0
  91. {ndev_stack-0.3.3 → ndev_stack-0.3.4}/ndev/win/core/ext.py +0 -0
  92. {ndev_stack-0.3.3 → ndev_stack-0.3.4}/ndev/win/core/fcgi.py +0 -0
  93. {ndev_stack-0.3.3 → ndev_stack-0.3.4}/ndev/win/core/grok.py +0 -0
  94. {ndev_stack-0.3.3 → ndev_stack-0.3.4}/ndev/win/core/logs.py +0 -0
  95. {ndev_stack-0.3.3 → ndev_stack-0.3.4}/ndev/win/core/mailpit.py +0 -0
  96. {ndev_stack-0.3.3 → ndev_stack-0.3.4}/ndev/win/core/mkcert.py +0 -0
  97. {ndev_stack-0.3.3 → ndev_stack-0.3.4}/ndev/win/core/paths.py +0 -0
  98. {ndev_stack-0.3.3 → ndev_stack-0.3.4}/ndev/win/core/php.py +0 -0
  99. {ndev_stack-0.3.3 → ndev_stack-0.3.4}/ndev/win/core/pma.py +0 -0
  100. {ndev_stack-0.3.3 → ndev_stack-0.3.4}/ndev/win/core/redis_core.py +0 -0
  101. {ndev_stack-0.3.3 → ndev_stack-0.3.4}/ndev/win/core/services.py +0 -0
  102. {ndev_stack-0.3.3 → ndev_stack-0.3.4}/ndev/win/core/setup.py +0 -0
  103. {ndev_stack-0.3.3 → ndev_stack-0.3.4}/ndev/win/core/shim.py +0 -0
  104. {ndev_stack-0.3.3 → ndev_stack-0.3.4}/ndev/win/core/upgrade.py +0 -0
  105. {ndev_stack-0.3.3 → ndev_stack-0.3.4}/ndev/win/core/vhost.py +0 -0
  106. {ndev_stack-0.3.3 → ndev_stack-0.3.4}/ndev/win/templates/vhost.conf.tmpl +0 -0
  107. {ndev_stack-0.3.3 → ndev_stack-0.3.4}/ndev/win/templates/vhost_ssl.conf.tmpl +0 -0
  108. {ndev_stack-0.3.3 → ndev_stack-0.3.4}/ndev/win/tui.py +0 -0
  109. {ndev_stack-0.3.3 → ndev_stack-0.3.4}/ndev_stack.egg-info/dependency_links.txt +0 -0
  110. {ndev_stack-0.3.3 → ndev_stack-0.3.4}/ndev_stack.egg-info/entry_points.txt +0 -0
  111. {ndev_stack-0.3.3 → ndev_stack-0.3.4}/ndev_stack.egg-info/requires.txt +0 -0
  112. {ndev_stack-0.3.3 → ndev_stack-0.3.4}/ndev_stack.egg-info/top_level.txt +0 -0
  113. {ndev_stack-0.3.3 → ndev_stack-0.3.4}/tests/test_shim.py +0 -0
@@ -1,582 +1,614 @@
1
- Metadata-Version: 2.4
2
- Name: ndev-stack
3
- Version: 0.3.3
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 shim` | Manage Windows binary shims and PATH registration (`list`, `init`, `add`, `rm`) |
248
- | `ndev doctor` | Run environment diagnostics and health checks |
249
- | `ndev logs` | View and tail service and virtual host logs |
250
- | `ndev clean` | Clean up downloads cache and stale runtime state |
251
-
252
- ---
253
-
254
- ## Detailed Usage Guide
255
-
256
- ### 1. Interactive Terminal UI Dashboard (`ndev ui`)
257
-
258
- Launch the modern, responsive Textual TUI dashboard for real-time monitoring and process control:
259
-
260
- ```bash
261
- ndev ui
262
- # Aliases: ndev tui, ndev dashboard
263
- ```
264
-
265
- - **Live Status Grid**: Monitor real-time status, PIDs, and active ports for Nginx, MariaDB, Redis, PMA, Mailpit, and PHP worker pools.
266
- - **One-Click Component Setup & Upgrades**: Install uninstalled services (**Redis**, **PMA**, **Mailpit**, **Nginx**, **MariaDB**, **mkcert**, **Composer**) or upgrade existing components with single-click UI actions.
267
- - **Interactive Virtual Host Manager**: Create new virtual hosts (`+ Create VHost`) with automatic local SSL (`mkcert`) and an integrated folder-picker dialog.
268
- - **PHP Runtime Management**: Install any PHP version (`+ Install PHP`), uninstall versions (`✖ Uninstall Selected`), or change the active CLI PHP version via dropdown.
269
- - **Batch Actions**: One-click **Start All**, **Stop All**, **Restart All**, and **Reload Nginx** from the persistent sidebar.
270
- - **Integrated Log Tail Viewer**: Select and inspect live logs for Nginx, MariaDB, Redis, PHP, and Virtual Hosts.
271
-
272
- ---
273
-
274
- ### 2. PHP Version Management
275
-
276
- ```bash
277
- # List available PHP releases (from php.net / windows.php.net)
278
- ndev available
279
- ndev available --archives # include legacy releases (5.6 - 7.3)
280
-
281
- # Install a PHP version (prebuilt on Windows, source-compiled on Linux)
282
- ndev install 8.4
283
-
284
- # List locally installed PHP versions and daemon/pool status
285
- ndev list
286
-
287
- # Switch globally active CLI PHP version
288
- ndev use 8.4
289
-
290
- # Show current active CLI PHP version
291
- ndev current
292
-
293
- # Uninstall a PHP version
294
- ndev uninstall 7.4
295
- ```
296
-
297
- ---
298
-
299
- ### 3. Service & Process Management
300
-
301
- ```bash
302
- # Start / Stop / Restart a PHP pool or individual service
303
- ndev start 8.4
304
- ndev stop 8.4
305
- ndev restart 8.4
306
-
307
- # Control core services
308
- ndev start nginx
309
- ndev start mariadb
310
- ndev start redis
311
- ndev start pma
312
- ndev start mailpit
313
-
314
- # Batch operations
315
- ndev start all
316
- ndev stop all
317
- ndev restart all
318
-
319
- # Reload Nginx configuration without downtime
320
- ndev reload nginx
321
-
322
- # View service status
323
- ndev status
324
- ```
325
-
326
- ---
327
-
328
- ### 4. Virtual Host Management (`vhost`)
329
-
330
- Create and manage local Nginx sites mapped to `127.0.0.1`:
331
-
332
- ```bash
333
- # Interactive wizard (auto-prompts for domain, document root, PHP version, and SSL)
334
- ndev vhost
335
-
336
- # Create a standard HTTP virtual host
337
- ndev vhost --domain project.local --root /path/to/project --php 8.4
338
-
339
- # Create an HTTPS virtual host with trusted local SSL certificates (mkcert)
340
- ndev vhost --domain project.local --root /path/to/project --php 8.4 --ssl
341
-
342
- # List all configured virtual hosts
343
- ndev vhost-list
344
-
345
- # Remove a virtual host (removes Nginx conf and cleans hosts file)
346
- ndev vhost-remove --domain project.local
347
- ```
348
-
349
- ---
350
-
351
- ### 5. Redis In-Memory Store (`redis`)
352
-
353
- Manage the local Redis server and launch the interactive `redis-cli`:
354
-
355
- > [!TIP]
356
- > **Redis Connection Defaults**:
357
- > * **Host**: `127.0.0.1` or `localhost`
358
- > * **Port**: `6379`
359
- > * **Password**: None (default)
360
-
361
- ```bash
362
- # Start Redis server
363
- ndev redis start
364
- ndev start redis
365
-
366
- # Check Redis status
367
- ndev redis status
368
- ndev status redis
369
-
370
- # Open interactive redis-cli terminal
371
- ndev redis cli
372
-
373
- # Stop or restart Redis server
374
- ndev redis stop
375
- ndev redis restart
376
- ```
377
-
378
- #### Laravel / Symfony / WordPress Configuration:
379
- ```env
380
- REDIS_HOST=127.0.0.1
381
- REDIS_PASSWORD=null
382
- REDIS_PORT=6379
383
- ```
384
-
385
- ---
386
-
387
- ### 6. SQL Database Manager (`db`) & phpMyAdmin (`pma`)
388
-
389
- Manage MySQL/MariaDB databases, users, and web administration:
390
-
391
- > [!TIP]
392
- > **Default MariaDB / MySQL Credentials**:
393
- > * **Host**: `127.0.0.1` or `localhost`
394
- > * **Port**: `3306`
395
- > * **Username**: `root`
396
- > * **Password**: `root` (Windows) / system auth (Linux)
397
- > * **phpMyAdmin URL**: [http://127.0.0.1:8080](http://127.0.0.1:8080)
398
-
399
- ```bash
400
- # Launch interactive database management wizard
401
- ndev db
402
-
403
- # Create database and user
404
- ndev db create-db mydb --owner myuser
405
- ndev db create-user myuser --new-password secret --grant-db mydb
406
-
407
- # Export & import database dumps
408
- ndev db export-db mydb -o backup.sql
409
- ndev db import-db mydb backup.sql
410
-
411
- # Start phpMyAdmin web UI
412
- ndev start pma
413
- ndev pma
414
- ```
415
-
416
- ---
417
-
418
- ### 7. Local Email Sandbox (`mailpit`)
419
-
420
- Catch every outgoing e-mail your local applications send using [Mailpit](https://github.com/axllent/mailpit):
421
-
422
- > [!TIP]
423
- > **SMTP & Web UI Defaults**:
424
- > * **SMTP Server**: `127.0.0.1:1025`
425
- > * **Web Inbox**: [http://127.0.0.1:8025](http://127.0.0.1:8025)
426
- > * No authentication required — all emails are safely intercepted locally.
427
-
428
- ```bash
429
- # Start Mailpit (auto-installs if not present)
430
- ndev mailpit start
431
- ndev start mailpit
432
-
433
- # Open Web UI in default browser
434
- ndev mailpit launch
435
- ndev mailpit open
436
-
437
- # Stop or restart Mailpit
438
- ndev mailpit stop
439
- ndev mailpit restart
440
- ```
441
-
442
- #### Configuring Mailpit in your Project:
443
-
444
- **Laravel (`.env`):**
445
- ```env
446
- MAIL_MAILER=smtp
447
- MAIL_HOST=127.0.0.1
448
- MAIL_PORT=1025
449
- MAIL_USERNAME=null
450
- MAIL_PASSWORD=null
451
- MAIL_ENCRYPTION=null
452
- ```
453
-
454
- **PHP (`php.ini`):**
455
- ```ini
456
- [mail function]
457
- SMTP = 127.0.0.1
458
- smtp_port = 1025
459
- ```
460
-
461
- ---
462
-
463
- ### 8. Stack Upgrade Engine (`upgrade`)
464
-
465
- Scan for and upgrade stack components (Nginx, MariaDB, Redis, PMA, Mailpit, mkcert, Composer) safely against latest upstream releases:
466
-
467
- ```bash
468
- # Check for available updates across all stack components
469
- ndev upgrade --check
470
-
471
- # Upgrade all components to latest stable releases
472
- ndev upgrade
473
-
474
- # Upgrade a specific component
475
- ndev upgrade redis
476
- ndev upgrade mailpit
477
- ndev upgrade pma
478
- ```
479
-
480
- ---
481
-
482
- ### 9. Diagnostics & Developer Tools
483
-
484
- ```bash
485
- # Run full environment health check
486
- ndev doctor
487
-
488
- # Launch pre-configured developer subshell
489
- ndev shell
490
-
491
- # Tail live logs for services or virtual hosts
492
- ndev logs
493
- ndev logs 8.4
494
- ndev logs nginx
495
-
496
- # Tunnel local virtual host to public web via ngrok
497
- ndev grok
498
-
499
- # Clean download cache and temporary files
500
- ndev clean
501
- ```
502
-
503
- ---
504
-
505
- ### 10. Extensible Dynamic Modules (`ndev module`)
506
-
507
- `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>/`.
508
-
509
- #### Module Commands:
510
- ```bash
511
- # List all discovered modules and running status
512
- ndev module list
513
-
514
- # Manage module lifecycle
515
- ndev module install mailpit
516
- ndev module start redis
517
- ndev module status postgres
518
- ndev module status mongodb
519
- ndev module open mailpit # Opens web UI if available
520
- ndev module restart redis
521
- ndev module stop redis
522
-
523
- # Direct convenience commands also work seamlessly:
524
- ndev start mailpit
525
- ndev stop redis
526
- ndev postgres start
527
- ndev postgres status
528
- ndev mongodb start
529
- ndev mongodb status
530
-
531
- # Scaffold a new custom module
532
- ndev module create my-service --display-name "My Custom Service" --category queue --port 9000
533
- ```
534
-
535
- #### Module Structure (`~/.ndev/modules/<name>/`):
536
- ```text
537
- ~/.ndev/modules/my-service/
538
- ├── manifest.json # Module metadata, ports, categories, and web UI definitions
539
- └── module.py # Python lifecycle handler (is_installed, install, start, stop, restart, status, open_ui)
540
- ```
541
-
542
- **Sample `manifest.json`:**
543
- ```json
544
- {
545
- "name": "my-service",
546
- "display_name": "My Custom Service",
547
- "version": "1.0.0",
548
- "description": "Custom queue worker service",
549
- "category": "queue",
550
- "ports": [9000],
551
- "web_ui": "http://127.0.0.1:9000",
552
- "platforms": ["windows", "linux"],
553
- "entrypoint": "module.py"
554
- }
555
- ```
556
-
557
- Dynamic modules appear automatically inside the **TUI Dashboard (`ndev ui`)**, where you can start, stop, restart, and open web interfaces with a single click.
558
-
559
- > 📖 **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.
560
-
561
- ---
562
-
563
- ## Configuration Files
564
-
565
- ### Windows
566
- * **Global Settings**: `%USERPROFILE%\.ndev\config.json`
567
- * **PHP Configuration**: `%USERPROFILE%\.ndev\php\<version>\php.ini`
568
- * **Nginx Main Config**: `%USERPROFILE%\.ndev\nginx\conf\nginx.conf`
569
- * **Virtual Host Configs**: `%USERPROFILE%\.ndev\nginx\conf\ndev-vhosts\*.conf`
570
- * **FastCGI Worker Pools**: Base port `13000` with 4 workers per PHP version (customizable in `config.json`).
571
-
572
- ### Linux
573
- * **Global Settings**: `~/.ndev/config.toml`
574
- * **PHP Configuration**: `~/.ndev/php/<version>/etc/php.ini`
575
- * **PHP Extensions**: `~/.ndev/php/<version>/etc/conf.d/<ext>.ini`
576
- * **PHP-FPM Pool Config**: `~/.ndev/php/<version>/etc/php-fpm.d/www.conf`
577
-
578
- ---
579
-
580
- ## License
581
-
582
- MIT License. See [LICENSE](LICENSE) for more details.
1
+ Metadata-Version: 2.4
2
+ Name: ndev-stack
3
+ Version: 0.3.4
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, openSUSE Tumbleweed, and openSUSE Leap).
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 (Debian/Ubuntu multiarch and openSUSE `/usr/lib64`).
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, openSUSE Tumbleweed/Leap) (`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` or `zypper install nginx` |
90
+ | **Database** | Portable MariaDB in `%USERPROFILE%\.ndev\mariadb\` | System MariaDB via `apt install mariadb-server` or `zypper install mariadb mariadb-client` |
91
+ | **In-Memory Cache** | Portable Redis in `%USERPROFILE%\.ndev\redis\` | System Redis via `apt install redis-server` or `zypper install redis` |
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` via `apt`/`zypper` or auto GitHub download |
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
+ ### Linux (openSUSE Tumbleweed / Leap)
213
+
214
+ ```bash
215
+ # 1. Install system build dependencies & tools
216
+ sudo zypper refresh
217
+ sudo zypper install -y bubblewrap gcc gcc-c++ make pkg-config nginx mariadb mariadb-client curl redis \
218
+ sqlite3-devel oniguruma-devel libxcrypt-devel libcurl-devel libxml2-devel libopenssl-devel \
219
+ libzip-devel libicu-devel libsodium-devel libpng16-devel libjpeg8-devel libwebp-devel \
220
+ freetype2-devel libbz2-devel gmp-devel readline-devel zlib-devel
221
+
222
+ # Optional: install mkcert for local SSL (available natively in Tumbleweed or auto-installed by ndev)
223
+ sudo zypper install -y mkcert 2>/dev/null || true
224
+ mkcert -install 2>/dev/null || true
225
+
226
+ # 2. Install ndev-stack
227
+ pip install ndev-stack
228
+
229
+ # 3. Bootstrap runtime environment and shims
230
+ ndev setup
231
+ export PATH="$HOME/.local/bin:$PATH"
232
+
233
+ # 4. Verify installation & launch interactive dashboard
234
+ ndev doctor
235
+ ndev ui
236
+ ```
237
+
238
+ ---
239
+
240
+ ## Quick Command Reference
241
+
242
+ | Command | Action |
243
+ |---|---|
244
+ | `ndev ui` | Launch real-time Textual TUI dashboard (*aliases: `tui`, `dashboard`*) |
245
+ | `ndev available` | List available PHP releases (`--archives` for legacy versions) |
246
+ | `ndev install <ver>` | Install / compile a PHP version (`8.4`, `8.3`, `7.4`, etc.) |
247
+ | `ndev use <ver>` | Switch active CLI PHP version on PATH |
248
+ | `ndev current` | Show active CLI PHP version |
249
+ | `ndev list` | List installed PHP versions and daemon / worker pool status |
250
+ | `ndev start <target>` | Start service or pool (`all`, `nginx`, `mariadb`, `redis`, `pma`, `mailpit`, `<ver>`) |
251
+ | `ndev stop <target>` | Stop service or pool (`all`, `nginx`, `mariadb`, `redis`, `pma`, `mailpit`, `<ver>`) |
252
+ | `ndev restart <target>`| Restart service or pool (`all`, `nginx`, `mariadb`, `redis`, `pma`, `mailpit`, `<ver>`) |
253
+ | `ndev reload nginx` | Reload Nginx configuration without downtime |
254
+ | `ndev status` | View real-time service status dashboard |
255
+ | `ndev ctl` | Interactive terminal service control menu |
256
+ | `ndev vhost` | Interactive virtual host creation wizard with local SSL |
257
+ | `ndev vhost-list` | List all configured virtual hosts |
258
+ | `ndev vhost-remove` | Remove virtual host and clean up hosts file |
259
+ | `ndev db` | Interactive SQL database management wizard |
260
+ | `ndev redis` | Manage Redis server or launch interactive `redis-cli` |
261
+ | `ndev mailpit` | Manage local email sandbox (`install`, `start`, `stop`, `launch`, `open`) |
262
+ | `ndev pma` | Manage phpMyAdmin background service (`http://127.0.0.1:8080`) |
263
+ | `ndev ext` | Manage PECL extensions (`list`, `install`, `enable`, `disable`) |
264
+ | `ndev grok` | Public HTTP tunneling for local virtual hosts via ngrok |
265
+ | `ndev postgres` | Manage PostgreSQL server (`install`, `start`, `stop`, `restart`, `status`) |
266
+ | `ndev mongodb` | Manage MongoDB server (`install`, `start`, `stop`, `restart`, `status`) |
267
+ | `ndev module list` | List all dynamic modules and status in `<userdir>/.ndev/modules/` |
268
+ | `ndev module <action>`| Manage dynamic module lifecycle (`install`, `start`, `stop`, `restart`, `status`, `open`) |
269
+ | `ndev module create` | Scaffold a new dynamic module with manifest and template code |
270
+ | `ndev upgrade` | Check for and upgrade stack components (Nginx, MariaDB, Redis, PMA, Mailpit, mkcert, Composer) |
271
+ | `ndev upgrade --check` | Check component versions against upstream releases without upgrading |
272
+ | `ndev shell` | Interactive developer subshell pre-loaded with PHP/Composer/MySQL/Redis on PATH |
273
+ | `ndev shim` | Manage Windows binary shims and PATH registration (`list`, `init`, `add`, `rm`) |
274
+ | `ndev doctor` | Run environment diagnostics and health checks |
275
+ | `ndev logs` | View and tail service and virtual host logs |
276
+ | `ndev clean` | Clean up downloads cache and stale runtime state |
277
+
278
+ ---
279
+
280
+ ## Detailed Usage Guide
281
+
282
+ ### 1. Interactive Terminal UI Dashboard (`ndev ui`)
283
+
284
+ Launch the modern, responsive Textual TUI dashboard for real-time monitoring and process control:
285
+
286
+ ```bash
287
+ ndev ui
288
+ # Aliases: ndev tui, ndev dashboard
289
+ ```
290
+
291
+ - **Live Status Grid**: Monitor real-time status, PIDs, and active ports for Nginx, MariaDB, Redis, PMA, Mailpit, and PHP worker pools.
292
+ - **One-Click Component Setup & Upgrades**: Install uninstalled services (**Redis**, **PMA**, **Mailpit**, **Nginx**, **MariaDB**, **mkcert**, **Composer**) or upgrade existing components with single-click UI actions.
293
+ - **Interactive Virtual Host Manager**: Create new virtual hosts (`+ Create VHost`) with automatic local SSL (`mkcert`) and an integrated folder-picker dialog.
294
+ - **PHP Runtime Management**: Install any PHP version (`+ Install PHP`), uninstall versions (`✖ Uninstall Selected`), or change the active CLI PHP version via dropdown.
295
+ - **Batch Actions**: One-click **Start All**, **Stop All**, **Restart All**, and **Reload Nginx** from the persistent sidebar.
296
+ - **Integrated Log Tail Viewer**: Select and inspect live logs for Nginx, MariaDB, Redis, PHP, and Virtual Hosts.
297
+
298
+ ---
299
+
300
+ ### 2. PHP Version Management
301
+
302
+ ```bash
303
+ # List available PHP releases (from php.net / windows.php.net)
304
+ ndev available
305
+ ndev available --archives # include legacy releases (5.6 - 7.3)
306
+
307
+ # Install a PHP version (prebuilt on Windows, source-compiled on Linux)
308
+ ndev install 8.4
309
+
310
+ # List locally installed PHP versions and daemon/pool status
311
+ ndev list
312
+
313
+ # Switch globally active CLI PHP version
314
+ ndev use 8.4
315
+
316
+ # Show current active CLI PHP version
317
+ ndev current
318
+
319
+ # Uninstall a PHP version
320
+ ndev uninstall 7.4
321
+ ```
322
+
323
+ ---
324
+
325
+ ### 3. Service & Process Management
326
+
327
+ ```bash
328
+ # Start / Stop / Restart a PHP pool or individual service
329
+ ndev start 8.4
330
+ ndev stop 8.4
331
+ ndev restart 8.4
332
+
333
+ # Control core services
334
+ ndev start nginx
335
+ ndev start mariadb
336
+ ndev start redis
337
+ ndev start pma
338
+ ndev start mailpit
339
+
340
+ # Batch operations
341
+ ndev start all
342
+ ndev stop all
343
+ ndev restart all
344
+
345
+ # Reload Nginx configuration without downtime
346
+ ndev reload nginx
347
+
348
+ # View service status
349
+ ndev status
350
+ ```
351
+
352
+ ---
353
+
354
+ ### 4. Virtual Host Management (`vhost`)
355
+
356
+ Create and manage local Nginx sites mapped to `127.0.0.1`:
357
+
358
+ > [!NOTE]
359
+ > **Cross-Distro Nginx Support**: Virtual host configurations are automatically written to the native Nginx directories of your distribution:
360
+ > * **openSUSE Tumbleweed / Leap**: `/etc/nginx/vhosts.d/<domain>.conf`
361
+ > * **Debian / Ubuntu**: `/etc/nginx/sites-available/<domain>.conf` with symlink in `/etc/nginx/sites-enabled/`
362
+ > * **Generic / Custom**: `/etc/nginx/conf.d/<domain>.conf`
363
+
364
+ ```bash
365
+ # Interactive wizard (auto-prompts for domain, document root, PHP version, and SSL)
366
+ ndev vhost
367
+
368
+ # Create a standard HTTP virtual host
369
+ ndev vhost --domain project.local --root /path/to/project --php 8.4
370
+
371
+ # Create an HTTPS virtual host with trusted local SSL certificates (mkcert)
372
+ ndev vhost --domain project.local --root /path/to/project --php 8.4 --ssl
373
+
374
+ # List all configured virtual hosts
375
+ ndev vhost-list
376
+
377
+ # Remove a virtual host (removes Nginx conf and cleans hosts file)
378
+ ndev vhost-remove --domain project.local
379
+ ```
380
+
381
+ ---
382
+
383
+ ### 5. Redis In-Memory Store (`redis`)
384
+
385
+ Manage the local Redis server and launch the interactive `redis-cli`:
386
+
387
+ > [!TIP]
388
+ > **Redis Connection Defaults**:
389
+ > * **Host**: `127.0.0.1` or `localhost`
390
+ > * **Port**: `6379`
391
+ > * **Password**: None (default)
392
+
393
+ ```bash
394
+ # Start Redis server
395
+ ndev redis start
396
+ ndev start redis
397
+
398
+ # Check Redis status
399
+ ndev redis status
400
+ ndev status redis
401
+
402
+ # Open interactive redis-cli terminal
403
+ ndev redis cli
404
+
405
+ # Stop or restart Redis server
406
+ ndev redis stop
407
+ ndev redis restart
408
+ ```
409
+
410
+ #### Laravel / Symfony / WordPress Configuration:
411
+ ```env
412
+ REDIS_HOST=127.0.0.1
413
+ REDIS_PASSWORD=null
414
+ REDIS_PORT=6379
415
+ ```
416
+
417
+ ---
418
+
419
+ ### 6. SQL Database Manager (`db`) & phpMyAdmin (`pma`)
420
+
421
+ Manage MySQL/MariaDB databases, users, and web administration:
422
+
423
+ > [!TIP]
424
+ > **Default MariaDB / MySQL Credentials**:
425
+ > * **Host**: `127.0.0.1` or `localhost`
426
+ > * **Port**: `3306`
427
+ > * **Username**: `root`
428
+ > * **Password**: `root` (Windows) / system auth (Linux)
429
+ > * **phpMyAdmin URL**: [http://127.0.0.1:8080](http://127.0.0.1:8080)
430
+
431
+ ```bash
432
+ # Launch interactive database management wizard
433
+ ndev db
434
+
435
+ # Create database and user
436
+ ndev db create-db mydb --owner myuser
437
+ ndev db create-user myuser --new-password secret --grant-db mydb
438
+
439
+ # Export & import database dumps
440
+ ndev db export-db mydb -o backup.sql
441
+ ndev db import-db mydb backup.sql
442
+
443
+ # Start phpMyAdmin web UI
444
+ ndev start pma
445
+ ndev pma
446
+ ```
447
+
448
+ ---
449
+
450
+ ### 7. Local Email Sandbox (`mailpit`)
451
+
452
+ Catch every outgoing e-mail your local applications send using [Mailpit](https://github.com/axllent/mailpit):
453
+
454
+ > [!TIP]
455
+ > **SMTP & Web UI Defaults**:
456
+ > * **SMTP Server**: `127.0.0.1:1025`
457
+ > * **Web Inbox**: [http://127.0.0.1:8025](http://127.0.0.1:8025)
458
+ > * No authentication required — all emails are safely intercepted locally.
459
+
460
+ ```bash
461
+ # Start Mailpit (auto-installs if not present)
462
+ ndev mailpit start
463
+ ndev start mailpit
464
+
465
+ # Open Web UI in default browser
466
+ ndev mailpit launch
467
+ ndev mailpit open
468
+
469
+ # Stop or restart Mailpit
470
+ ndev mailpit stop
471
+ ndev mailpit restart
472
+ ```
473
+
474
+ #### Configuring Mailpit in your Project:
475
+
476
+ **Laravel (`.env`):**
477
+ ```env
478
+ MAIL_MAILER=smtp
479
+ MAIL_HOST=127.0.0.1
480
+ MAIL_PORT=1025
481
+ MAIL_USERNAME=null
482
+ MAIL_PASSWORD=null
483
+ MAIL_ENCRYPTION=null
484
+ ```
485
+
486
+ **PHP (`php.ini`):**
487
+ ```ini
488
+ [mail function]
489
+ SMTP = 127.0.0.1
490
+ smtp_port = 1025
491
+ ```
492
+
493
+ ---
494
+
495
+ ### 8. Stack Upgrade Engine (`upgrade`)
496
+
497
+ Scan for and upgrade stack components (Nginx, MariaDB, Redis, PMA, Mailpit, mkcert, Composer) safely against latest upstream releases:
498
+
499
+ ```bash
500
+ # Check for available updates across all stack components
501
+ ndev upgrade --check
502
+
503
+ # Upgrade all components to latest stable releases
504
+ ndev upgrade
505
+
506
+ # Upgrade a specific component
507
+ ndev upgrade redis
508
+ ndev upgrade mailpit
509
+ ndev upgrade pma
510
+ ```
511
+
512
+ ---
513
+
514
+ ### 9. Diagnostics & Developer Tools
515
+
516
+ ```bash
517
+ # Run full environment health check
518
+ ndev doctor
519
+
520
+ # Launch pre-configured developer subshell
521
+ ndev shell
522
+
523
+ # Tail live logs for services or virtual hosts
524
+ ndev logs
525
+ ndev logs 8.4
526
+ ndev logs nginx
527
+
528
+ # Tunnel local virtual host to public web via ngrok
529
+ ndev grok
530
+
531
+ # Clean download cache and temporary files
532
+ ndev clean
533
+ ```
534
+
535
+ ---
536
+
537
+ ### 10. Extensible Dynamic Modules (`ndev module`)
538
+
539
+ `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>/`.
540
+
541
+ #### Module Commands:
542
+ ```bash
543
+ # List all discovered modules and running status
544
+ ndev module list
545
+
546
+ # Manage module lifecycle
547
+ ndev module install mailpit
548
+ ndev module start redis
549
+ ndev module status postgres
550
+ ndev module status mongodb
551
+ ndev module open mailpit # Opens web UI if available
552
+ ndev module restart redis
553
+ ndev module stop redis
554
+
555
+ # Direct convenience commands also work seamlessly:
556
+ ndev start mailpit
557
+ ndev stop redis
558
+ ndev postgres start
559
+ ndev postgres status
560
+ ndev mongodb start
561
+ ndev mongodb status
562
+
563
+ # Scaffold a new custom module
564
+ ndev module create my-service --display-name "My Custom Service" --category queue --port 9000
565
+ ```
566
+
567
+ #### Module Structure (`~/.ndev/modules/<name>/`):
568
+ ```text
569
+ ~/.ndev/modules/my-service/
570
+ ├── manifest.json # Module metadata, ports, categories, and web UI definitions
571
+ └── module.py # Python lifecycle handler (is_installed, install, start, stop, restart, status, open_ui)
572
+ ```
573
+
574
+ **Sample `manifest.json`:**
575
+ ```json
576
+ {
577
+ "name": "my-service",
578
+ "display_name": "My Custom Service",
579
+ "version": "1.0.0",
580
+ "description": "Custom queue worker service",
581
+ "category": "queue",
582
+ "ports": [9000],
583
+ "web_ui": "http://127.0.0.1:9000",
584
+ "platforms": ["windows", "linux"],
585
+ "entrypoint": "module.py"
586
+ }
587
+ ```
588
+
589
+ Dynamic modules appear automatically inside the **TUI Dashboard (`ndev ui`)**, where you can start, stop, restart, and open web interfaces with a single click.
590
+
591
+ > 📖 **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.
592
+
593
+ ---
594
+
595
+ ## Configuration Files
596
+
597
+ ### Windows
598
+ * **Global Settings**: `%USERPROFILE%\.ndev\config.json`
599
+ * **PHP Configuration**: `%USERPROFILE%\.ndev\php\<version>\php.ini`
600
+ * **Nginx Main Config**: `%USERPROFILE%\.ndev\nginx\conf\nginx.conf`
601
+ * **Virtual Host Configs**: `%USERPROFILE%\.ndev\nginx\conf\ndev-vhosts\*.conf`
602
+ * **FastCGI Worker Pools**: Base port `13000` with 4 workers per PHP version (customizable in `config.json`).
603
+
604
+ ### Linux
605
+ * **Global Settings**: `~/.ndev/config.toml`
606
+ * **PHP Configuration**: `~/.ndev/php/<version>/etc/php.ini`
607
+ * **PHP Extensions**: `~/.ndev/php/<version>/etc/conf.d/<ext>.ini`
608
+ * **PHP-FPM Pool Config**: `~/.ndev/php/<version>/etc/php-fpm.d/www.conf`
609
+
610
+ ---
611
+
612
+ ## License
613
+
614
+ MIT License. See [LICENSE](LICENSE) for more details.