# create-alvie-app

Create an Alvie fullstack project from bundled templates.

```bash
npx create-alvie-app@latest
```

The CLI scans every folder in `template/`, shows a numbered menu, asks for a project name, copies the selected template, installs dependencies, detects frontend and backend apps, and writes root scripts for running the project.

## Usage

Interactive:

```bash
npx create-alvie-app@latest
```

Non-interactive:

```bash
npx create-alvie-app@latest -- --template PPMS --name my-ppms
```

Skip dependency installation:

```bash
npx create-alvie-app@latest -- --template AuthDashboard --name auth-dashboard --skip-install
```

Start after creation:

```bash
npx create-alvie-app@latest -- --template "Online Hospital" --name online-hospital --start
```

## Generated Project Scripts

When a template contains both frontend and backend folders, the CLI creates a root `package.json` with:

```bash
npm run dev
npm run server
npm run client
```

`npm run dev` starts frontend and backend together with `concurrently`.

## Detection

The CLI auto-detects common stacks:

- React
- Next.js
- Vite
- Vue
- Express
- NestJS
- Node.js backends
- Django projects with `manage.py`

It installs Node dependencies with `npm install`. For Python/Django apps with `requirements.txt`, it runs `python -m pip install -r requirements.txt`.

## Template Creation

Add a new template by creating a folder inside `template/`:

```text
template/
  My New App/
    frontend/
      package.json
    backend/
      package.json
```

The new folder appears automatically in the CLI menu after publishing the next package version.

Generated and heavy folders are ignored while copying templates:

- `node_modules`
- `dist`
- `build`
- `.next`
- `venv`
- `__pycache__`

## Local Development

Install dependencies:

```bash
npm install
```

Check the CLI syntax:

```bash
npm run check
```

Test locally without installing copied project dependencies:

```bash
node index.js --template PPMS --name test-ppms --skip-install
```

## Publishing

Before publishing:

```bash
npm version patch
npm run check
npm run pack:dry
```

Publish publicly:

```bash
npm publish --access public
```

Users can then run:

```bash
npx create-alvie-app@latest
```

## GitHub

Recommended first push:

```bash
git init
git add .
git commit -m "Initial create-alvie-app CLI"
git branch -M main
git remote add origin <your-repository-url>
git push -u origin main
```
