reactango
Version:
A CLI tool that simplify React and Django Implementation.
327 lines (242 loc) ⢠9.19 kB
Markdown
# š React Tango Creator (`reactango`)
<div align="center">

[](https://www.npmjs.com/package/reactango)
[](https://www.npmjs.com/package/reactango)
[](https://opensource.org/licenses/MIT)
[](https://www.npmjs.com/package/reactango)
**The fastest way to bootstrap modern full-stack applications with React + Django**
[Quick Start](#-quick-start) ⢠[Features](#-features) ⢠[Installation](#-installation) ⢠[Usage](#-usage) ⢠[Documentation](#-documentation)
</div>
---
## ⨠What is React Tango Creator?
`reactango` is a powerful command-line tool that instantly scaffolds production-ready full-stack applications using the **ReactTangoTemplate**. It combines the best of modern frontend and backend technologies:
Stop wasting time on boilerplate setup and start building features from day one!
## šÆ Quick Start
Get your new project running in under 30 seconds:
```bash
# Install reactango globally
npm install -g reactango
# or with pnpm
pnpm add -g reactango
# or with yarn
yarn global add reactango
# Create your new project
reactango create my-awesome-project
# Navigate to your project
cd my-awesome-project
```
That's it! Your full-stack application is now ready!
## š Features
### šļø **Instant Project Scaffolding**
- Creates a complete full-stack project structure in seconds
- No manual setup or configuration required
- Ready-to-use development environment
### š **Clean Git History**
- Automatically initializes a fresh Git repository
- Removes template history for a clean start
- Makes initial commit with all template files
### āļø **Modern Tech Stack**
- **React 18** with hooks and modern patterns
- **TanStack Router** for type-safe routing
- **Vite** for lightning-fast development
- **Django** with REST Framework for robust APIs
- **TypeScript** for type safety across the stack
### š³ **Containerized Development**
- Docker Compose setup included
- Consistent development environment
- Easy deployment and scaling
### š ļø **Developer Experience**
- Hot reloading for both frontend and backend
- Pre-configured linting and formatting
- Organized project structure
- Comprehensive documentation
## š¦ Installation
### Install from npm (Recommended)
```bash
# Using npm
npm install -g reactango
# Using pnpm
pnpm add -g reactango
# Using yarn
yarn global add reactango
```
### Prerequisites
Before using `reactango`, ensure you have:
- **Node.js 18+** with npm/pnpm/yarn
- **Git** for version control
- **Python 3.7+** (for Django backend)
## š Usage
### Basic Usage
Create a new project with the default template:
```bash
reactango create my-project-name
```
### Advanced Options
```bash
# Create project with custom branch
reactango create my-project --branch develop
# Force initialize Git repository
reactango create my-project --init-git
# Skip Git initialization
reactango create my-project --no-init-git
# Install all dependencies automatically (backend & frontend)
reactango create my-project --install-all
# Skip all dependency installations and prompts
reactango create my-project --skip-all-install
# Don't use Python virtual environment for backend
reactango create my-project --no-venv
# Combine multiple options
reactango create my-project --branch develop --install-all --init-git
# Show help
reactango --help
```
### Command Options
| Option | Description | Default |
|--------|-------------|---------|
| `project_name` | Name of your new project | Required |
| `--branch <branch>` | Specific branch of the template to clone | `main` |
| `--init-git` | Force initialization of a new git repository | Interactive prompt |
| `--no-init-git` | Force skipping git initialization | Interactive prompt |
| `--install-all` | Automatically install all dependencies (backend & frontend) | Interactive prompt |
| `--skip-all-install` | Skip all automatic dependency installations and prompts | Interactive prompt |
| `--no-venv` | Don't use a Python virtual environment for backend dependencies | Uses venv by default |
| `--help` | Show help message | - |
## š What You Get
After running `reactango create`, your project will have:
```
/ (root)
āāā api/ # Django api
ā āāā __init__.py
ā āāā admin.py
ā āāā apps.py
ā āāā models.py
ā āāā urls.py
ā āāā views.py
ā āāā welcome/
ā ā āāā __init__.py
ā ā āāā urls.py
ā ā āāā views.py
ā ā āāā __pycache__/
ā ā āāā models/
ā ā āāā __init__.py
ā ā āāā welcome.py
ā āāā __pycache__/
āāā app/ # React app (TanStack Router)
ā āāā app.css
ā āāā root.tsx
ā āāā routes.ts
ā āāā routes/
ā ā āāā home.tsx
ā āāā welcome/
ā āāā logo-dark.svg
ā āāā logo-light.svg
ā āāā welcome.tsx
āāā config/ # Django config
ā āāā __init__.py
ā āāā asgi.py
ā āāā settings.py
ā āāā urls.py
ā āāā wsgi.py
ā āāā __pycache__/
āāā public/ # Static assets
ā āāā favicon.ico
āāā db.sqlite3
āāā Dockerfile
āāā install.js
āāā manage.py
āāā package.json
āāā pnpm-lock.yaml
āāā react-router.config.ts
āāā requirements.txt
āāā tsconfig.json
āāā vite.config.ts
āāā README.md
```
## Getting Started
### Backend (Django)
1. Install Python dependencies:
```sh
pip install -r requirements.txt
```
### Frontend (React + TanStack Router)
1. Install Node dependencies:
```sh
pnpm install
```
### Install All (Backend + Frontend)
1. Run the installer script (with interactive options):
```sh
node install.js
```
- Use `--backend-only` to install only Django dependencies
- Use `--frontend-only` to install only frontend dependencies
- Use `--with-venv` to create and use a Python virtual environment
### Simple RUN
1. Run this:
```sh
pnpm run dev
```
## š§ CLI Commands
The `reactango` CLI provides comprehensive options for creating and configuring your projects:
### Basic Command
```bash
# Create a new project with interactive prompts
reactango create <project-name>
```
### Full Command Reference
```bash
# Create with specific branch
reactango create my-app --branch develop
# Auto-install all dependencies without prompts
reactango create my-app --install-all
# Skip all installations for manual setup later
reactango create my-app --skip-all-install
# Control Git initialization
reactango create my-app --init-git # Force Git init
reactango create my-app --no-init-git # Skip Git init
# Python environment options
reactango create my-app --no-venv # Skip virtual environment
# Combined options for automated setup
reactango create my-app --branch main --install-all --init-git
```
### Interactive vs Automated Modes
**Interactive Mode (Default):**
- Prompts you for Git initialization preference
- Asks about dependency installation options
- Guides you through Python virtual environment setup
**Automated Mode:**
- Use `--install-all` to skip prompts and install everything
- Use `--skip-all-install` to skip all installations
- Combine with other flags for fully automated project creation
### Other Commands
```bash
# Show version
reactango --version
# Show help
reactango --help
```
## š¤ Contributing
We welcome contributions! Here's how you can help:
1. **Fork the repository**
2. **Create a feature branch**: `git checkout -b feature/amazing-feature`
3. **Make your changes**
4. **Run tests**: `npm test`
5. **Commit your changes**: `git commit -m 'Add amazing feature'`
6. **Push to the branch**: `git push origin feature/amazing-feature`
7. **Open a Pull Request**
## š License
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
## š Issues & Support
- **Bug Reports**: [GitHub Issues](https://github.com/Abdullah6346/Reactang-NodeCLI/issues)
- **Feature Requests**: [GitHub Discussions](https://github.com/Abdullah6346/Reactang-NodeCLI/discussions)
- **Documentation**: [Wiki](https://github.com/Abdullah6346/Reactang-NodeCLI/wiki)
## š Acknowledgments
- Built on top of the powerful [ReactTangoTemplate](https://github.com/Abdullah6346/ReactTangoTemplate)
- Inspired by tools like Create React App and Django startproject
- Thanks to all contributors and the open-source community
---
<div align="center">
**Made with ā¤ļø for the developer community**
[ā Star us on GitHub](https://github.com/Abdullah6346/Reactang-NodeCLI) if this project helped you!
</div>