Metadata-Version: 2.4
Name: ntc-dev-kit
Version: 1.3.2
Summary: Nexent Toolkit Console - A CLI tool for scaffolding Django REST Framework, React, Next.js, and Flutter projects
Home-page: https://github.com/nexent/ntc
Author: Nexent
Author-email: Nexent <dev@nexent.com>
License: MIT
Project-URL: Homepage, https://github.com/nexent/ntc
Project-URL: Repository, https://github.com/nexent/ntc
Project-URL: Issues, https://github.com/nexent/ntc/issues
Keywords: cli,scaffold,django,drf,react,nextjs,flutter,generator,boilerplate
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Code Generators
Classifier: Topic :: Utilities
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: colorama>=0.4.6
Requires-Dist: pyyaml>=6.0
Requires-Dist: textual>=1.0
Requires-Dist: tomli>=2.0; python_version < "3.11"
Provides-Extra: dev
Requires-Dist: build>=1.0; extra == "dev"
Requires-Dist: twine>=4.0; extra == "dev"
Requires-Dist: pytest>=7.0; extra == "dev"
Requires-Dist: ruff>=0.1.0; extra == "dev"
Requires-Dist: black>=23.0; extra == "dev"
Dynamic: author
Dynamic: home-page
Dynamic: license-file
Dynamic: requires-python

# NTC - Nexent Toolkit Console

A powerful CLI scaffolding tool for rapidly bootstrapping modern web and mobile projects.

## Overview

NTC (Nexent Toolkit Console) is a command-line interface that generates production-ready project boilerplates for:

- **Backend**: Django REST Framework with authentication, Celery, Docker support
- **Frontend**: React, React Admin, Next.js
- **Mobile**: Flutter

## Features

- **Interactive project initialization** with step-by-step prompts
- **Django REST Framework scaffolding** with JWT authentication, custom User models, and API documentation
- **Environment setup automation** (virtual environments, dependency installation)
- **Docker & Docker Compose** configuration included
- **Authentication app generator** with login, register, password reset endpoints
- **Modular app architecture** with pre-configured common utilities

## Installation

```bash
pip install ntc-dev-kit
```

## Quick Start

Create a new project interactively:

```bash
ntc init
```

Or specify technology directly:

```bash
# Django REST API backend
ntc init --technology django

# React frontend
ntc init --technology react

# Next.js full-stack
ntc init --technology nextjs

# Flutter mobile
ntc init --technology flutter
```

## Usage

### Interactive Mode

```bash
ntc init
```

A few questions, asked inline: project name, what you're building, where it goes, then the
options for that technology (sign-in and Python environment for Django; installing dependencies
for the others), a summary, and **Create?**. The defaults are already selected, so Enter takes
them; **↑/↓** move, a **number key** picks an option at once, **Esc** cancels without writing
anything. Each answer collapses to one line, and the only progress shown is for real work
(creating the environment, installing packages).

### Without questions

Every answer can be given as a flag; with `--yes` nothing is asked (scripts, CI, AI agents):

```bash
ntc init -t django --name shop-api --with-auth --env venv --yes
ntc init -t nextjs --name site --install --yes
```

| Flag | Meaning |
|------|---------|
| `-t`, `--technology` | `django`, `nextjs`, `react-admin`, `react`, `flutter` |
| `--name` | Project name (`.` = the current folder) |
| `--path` | Folder to create the project in (default: current folder) |
| `--with-auth` / `--no-auth` | Django: include the sign-in app (custom User model, JWT, migration included) |
| `--env` | Django: `venv`, `conda`, `existing` (the active virtualenv) or `skip` |
| `--install` / `--no-install` | Others: run `npm install` / `flutter pub get` |
| `--apps` | A workspace instead of one app: `backend,website,dashboard,admin,mobile` (any of them) |
| `--git` | Workspace: `per-app` (default), `single` or `none` |
| `--yes`, `-y` | Ask nothing; needs `--name` and `--technology` (or `--apps`) |

### Workspaces: several apps at once

Tick more than one app at **What are you building?** (Space ticks) - say a backend, a website and
an admin dashboard - and they're created side by side in one folder, already connected:

- each app gets its own port, the frontends point at the backend's API, and the backend allows
  the frontends' origins (CORS);
- dependencies install for all apps at once, one line each;
- git: a repository per app (plus a small one at the root for `ntc.toml`), one for everything,
  or none;
- `ntc.toml` at the root says how each app is set up and run.

```
kaya/
├── ntc.toml        # the apps, their ports, setup and run commands, env
├── README.md
├── backend/        # Django REST API   http://127.0.0.1:8000
├── website/        # Next.js           http://127.0.0.1:3000
└── admin/          # React admin       http://127.0.0.1:5173
```

Then, from anywhere inside the workspace:

```bash
ntc start                  # every app in this terminal: a tab each plus "All"
ntc start backend admin    # just these (and what they need)
ntc start --plain          # interleaved output instead (CI, logs)
ntc setup                  # environments, .env files, dependencies - after a clone or a deep clean
ntc clean                  # build output and caches; shows the space freed
ntc clean --deep           # also node_modules and Python environments
ntc add                    # another app, wired in like the rest
```

In `ntc start`, **All** is a grid of up to four terminals, one per app (**[** and **]** page
through more), with each app's port and status on its border and its output colour-coded: errors
red, warnings amber, ready/compiled green, HTTP status codes by class. **Tab** moves between the
terminals and the keys act on the focused one: **r** restarts, **s** stops or starts, **o** opens
it in the browser, **i** types into it (Flutter's `r` hot reload), **c** clears, **Enter** opens it
full screen (**Esc** comes back). **1-9** jump to an app's own tab, **0** back to all, **q** quits
and stops everything. Apps wait for the ones they `need` (the backend) before starting, and a port
that's already taken is reported instead of crashing.

`ntc clean` only removes what the tools rebuild (`.next`, `dist`, `__pycache__`, caches; with
`--deep` also `node_modules` and `env`), never anything git tracks, and skips apps that are running.
`--dry-run` shows what would go.

`ntc.toml` is plain TOML and meant to be edited and committed (no secrets in it - those stay in
each app's `.env`):

```toml
name = "kaya"

[apps.backend]
kind = "django"
path = "backend"
port = 8000
python = "env"
setup = ["{python} -m pip install -r requirements-dev.txt", "{python} manage.py migrate"]
run = "{python} manage.py runserver 127.0.0.1:{port}"
# also = { worker = "{python} -m celery -A kaya worker -B -l INFO" }

[apps.backend.env]
CORS_ALLOWED_ORIGINS = "{frontends.origins}"

[apps.website]
kind = "nextjs"
path = "website"
port = 3000
needs = ["backend"]
run = "npm run dev -- --port {port}"
repo = "git@github.com:you/website.git"   # `ntc setup` clones it when the folder is missing

[apps.website.env]
NEXT_PUBLIC_API_BASE_URL = "{backend.url}/api/v1"
```

Placeholders: `{port}`, `{url}`, `{python}` (this app's), `{<app>.port}`, `{<app>.url}`,
`{frontends.origins}`. Commands are one program with its arguments (no `&&`), so they run the
same on Windows and Unix.

### Technology Options

| Technology | Description |
|-----------|-------------|
| `django` | Django REST Framework with JWT auth, Celery, Docker |
| `react` | React Vite project with TypeScript |
| `react-admin` | React Admin dashboard template |
| `nextjs` | Next.js full-stack application |
| `flutter` | Flutter mobile application |

### Additional Commands

```bash
# Create a new Django app within your project
ntc create app <app_name>

# Show help
ntc --help
```

## Django Project Structure

When you create a Django project, you get:

```
myproject/
├── .env                          # Environment variables
├── .gitignore
├── requirements.txt
├── manage.py
├── Dockerfile
├── docker-compose.yml
├── config/                       # Gunicorn & nginx config
├── .entry/                       # Startup scripts
├── .knowledge/                   # AI documentation
├── apps/
│   ├── __init__.py
│   ├── common/                   # Common utilities
│   └── authentication/           # (Optional) Auth app
├── core/                         # Core utilities
│   ├── pagination.py
│   ├── base_model.py
│   ├── response_wrapper.py
│   └── services/                 # Azure/AWS services
└── myproject/                    # Django project settings
    ├── settings/
    ├── urls.py
    ├── asgi.py
    ├── wsgi.py
    └── commands/                 # Management commands
```

## Requirements

- **Python**: >= 3.10
- **Operating System**: Windows, macOS, Linux

## Dependencies

- `colorama` - Cross-platform colored terminal output
- `pyyaml` - YAML configuration parsing

## Development

```bash
# Clone repository
git clone https://github.com/nexent/ntc.git
cd ntc

# Install in development mode
pip install -e ".[dev]"

# Run tests
pytest

# Code formatting
black ntc/
ruff check ntc/
```

## License

MIT License - see [LICENSE](LICENSE) for details.

## Support

- **Issues**: [GitHub Issues](https://github.com/nexent/ntc/issues)
- **Repository**: [GitHub](https://github.com/nexent/ntc)
