Metadata-Version: 2.4
Name: deployfilegen
Version: 0.1.21
Summary: A production-grade CLI tool to generate deployment configuration files for Django/React projects.
Author-email: Shankarsan Sahoo <shankarsansahoo2001@gmail.com>
License: MIT License
        
        Copyright (c) 2026 Shankarsan Sahoo
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://github.com/Shankarsan-Sahoo/deployfilegen
Project-URL: Repository, https://github.com/Shankarsan-Sahoo/deployfilegen.git
Project-URL: Issues, https://github.com/Shankarsan-Sahoo/deployfilegen/issues
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: typer[all]
Requires-Dist: python-dotenv
Requires-Dist: pytest
Dynamic: license-file

# deployfilegen

**deployfilegen** is a production-grade Python CLI library designed to automatically generate production-ready deployment configuration files for full-stack applications (Django + React).

Writing Dockerfiles, Compose configs, and CI pipelines repeatedly is slow and error-prone. **deployfilegen** automates this process using secure, battle-tested defaults.

## Quick Start

```bash
# 1. Install the tool
pip install deployfilegen

# 2. Initialize your project
deployfilegen init

# 3. Deploy locally
docker compose -f docker-compose.prod.yml up --build
```

---

## Why deployfilegen?

Standardizing deployment is hard. This tool ensures your project follows industry best practices out of the box:
- **Security**: All containers run as non-root users.
- **Reliability**: Automated healthchecks and dependency waiting.
- **CI/CD**: Complete GitHub Actions workflow with Docker layer caching.
- **Zero Hardcoding**: All configuration is derived from your `.env` files.

---

## Example Project Structure

The tool expects a standard full-stack layout:

```text
my-cool-project/
├── backend/            # Django project
│   └── manage.py
├── frontend/           # React project
│   └── package.json
└── .env                # Required environment variables
```

---

## CLI Output Example

```text
$ deployfilegen init
INFO: Initializing deployfilegen in /path/to/project (Mode: prod)
INFO: Detected Django backend.
INFO: Detected React frontend.
INFO: Loaded environment from: .env
INFO: Generating Backend Dockerfile...
INFO: Generated backend/Dockerfile
INFO: Generating Frontend Dockerfile...
INFO: Generated frontend/Dockerfile
INFO: Generating Docker Compose...
INFO: Generated docker-compose.prod.yml
INFO: Generating GitHub Actions workflow...
INFO: Generated .github/workflows/deploy.yml
INFO: Deployment configuration generated successfully!
```

---

## Usage

Navigate to your project root and run:

```bash
# Generate a boilerplate .env template
deployfilegen template

# Initialize your project
deployfilegen init [OPTIONS]
```

### Commands

*   `init`: Initialize deployment configuration.
*   `template`: Generate a boilerplate `.env` file.

### Global Options
- `--version`, `-v`: Show the version and exit.
- `--help`: Show this message and exit.

### `init` Command Options

| Option | Description |
| :--- | :--- |
| `--mode prod` | Generates `docker-compose.prod.yml` (Default). Optimized for servers. |
| `--mode dev` | Generates `docker-compose.dev.yml`. Optimized for local coding. |
| `--force`, `-f` | Overwrite existing files. (Default: skips existing files). |
| `--docker-only` | Generate only the Dockerfiles. |
| `--compose-only` | Generate only the Docker Compose files. |
| `--github-only` | Generate only the GitHub Actions workflow. |
| `--backend-only` | Filter generation to only Backend components. |
| `--frontend-only` | Filter generation to only Frontend components. |

---

## Requirements

- Python 3.9+
- A project structure with a Django-based `backend` and a React-based `frontend`.
- A `.env` file containing: `DOCKER_USERNAME`, `BACKEND_IMAGE_NAME`, `FRONTEND_IMAGE_NAME`, `DEPLOY_HOST`, and `DEPLOY_USER`.

## License

MIT
