Skip to main content

CLI tool to scaffold FastAPI + Next.js full-stack applications with Fox AI companion

Project description

NextPy CLI

NextPy Logo

Scaffold full-stack FastAPI + Next.js applications in seconds

PyPI version Python License: MIT

NextPy is a powerful CLI tool that helps you quickly scaffold modern full-stack applications with FastAPI backend and Next.js frontend, complete with Docker support and multiple database options.

๐Ÿš€ Quick Start

Recommended: Using uvx (Fastest)

No installation required! Run directly:

uvx nextpy-cli my-awesome-app

Alternative Methods

# Using pip
pip install nextpy-cli
nextpy my-awesome-app

# Using uv (faster pip)
uv pip install nextpy-cli
nextpy my-awesome-app

# Using pipx (isolated environment)
pipx install nextpy-cli
nextpy my-awesome-app

โœจ Features

  • ๐ŸฆŠ Fox - Your Smart Dev Companion - Intelligent CLI mascot that remembers your preferences and provides contextual suggestions
  • FastAPI Backend - Modern, fast Python web framework
  • Next.js Frontend - React framework with TypeScript support
  • Multiple Database Options - PostgreSQL, MongoDB, or SQLite
  • Docker Ready - Complete Docker and Docker Compose setup
  • TypeScript - Full TypeScript support for type safety
  • Vite - Lightning-fast development with Vite
  • Interactive CLI - Beautiful, user-friendly prompts powered by Rich and Questionary
  • Smart Suggestions - Fox learns your preferences and suggests your usual stack
  • Best Practices - Production-ready project structure

๐Ÿ“ฆ What You Get

Backend (FastAPI)

  • RESTful API structure
  • Database integration (PostgreSQL/MongoDB/SQLite)
  • Environment configuration
  • CORS setup
  • Health check endpoints
  • Docker configuration

Frontend (Next.js)

  • TypeScript configuration
  • Vite for fast development
  • API client setup
  • Modern React patterns
  • Responsive design ready
  • Docker configuration

DevOps

  • Docker Compose for local development
  • Separate Dockerfiles for frontend and backend
  • Environment variable management
  • Production-ready configurations

๐ŸŽฏ Usage

Create a New Project

# Quick start with uvx (recommended)
uvx nextpy-cli my-project

# Or if installed
nextpy my-project

The CLI will guide you through:

  1. Project name
  2. Frontend framework (Next.js or Vite + React)
  3. Database choice (SQLite, PostgreSQL, or MongoDB)
  4. Docker support (yes/no)
  5. GitHub repository initialization (yes/no)
  6. Automatic setup and installation

Start Development

cd my-project

# Start with Docker Compose (recommended)
docker-compose up

# Or start services individually:

# Backend
cd backend
pip install -r requirements.txt
uvicorn main:app --reload

# Frontend
cd frontend
npm install
npm run dev

๐ŸŒ Access Your Application

๐ŸฆŠ Meet Fox - Your Smart Dev Companion

Fox is NextPy's intelligent CLI mascot that makes project creation delightful and efficient!

What Fox Does:

  • Remembers Your Preferences - "You usually go with Next.js + PostgreSQL. Use that again?"
  • Smart Suggestions - Recommends the right database for your project type
  • Celebrates Milestones - Special messages for your 1st, 5th, 10th, 25th, and 50th projects!
  • Contextual Tips - Provides relevant advice based on your choices
  • Personality Modes - Choose how chatty Fox should be

Fox Modes:

# Verbose - Maximum personality, tips, and commentary
nextpy my-project --fox-mode verbose

# Normal - Balanced helpfulness (default)
nextpy my-project --fox-mode normal

# Quiet - Essential messages only
nextpy my-project --fox-mode quiet

# Silent - No Fox messages
nextpy my-project --fox-mode silent

# Set globally with environment variable
export NEXTPY_FOX_MODE=verbose
nextpy my-project

Quick Commands:

# Use your last configuration
nextpy my-new-project --last

# Combine options
nextpy my-project --fox-mode verbose --last

Fox Features:

  • ๐Ÿง  Smart Memory - Tracks your preferences across projects (stored in ~/.nextpy/preferences.json)
  • ๐Ÿ’ก Context-Aware - Detects project types (e-commerce, blog, API, etc.)
  • ๐ŸŽฏ Intelligent Recommendations - Suggests appropriate tech stacks
  • ๐ŸŽ‰ Milestone Celebrations - Acknowledges your progress
  • ๐ŸŽจ Personality - Witty, dev-focused messages

๐Ÿ“‹ Requirements

  • Python 3.11 or higher
  • Node.js 18+ (for the generated frontend)
  • Docker (optional, but recommended)

๐Ÿ› ๏ธ Project Structure

my-project/
โ”œโ”€โ”€ backend/
โ”‚   โ”œโ”€โ”€ main.py              # FastAPI application
โ”‚   โ”œโ”€โ”€ requirements.txt     # Python dependencies
โ”‚   โ”œโ”€โ”€ .env                 # Environment variables
โ”‚   โ””โ”€โ”€ Dockerfile
โ”œโ”€โ”€ frontend/
โ”‚   โ”œโ”€โ”€ src/
โ”‚   โ”‚   โ”œโ”€โ”€ pages/          # Next.js pages
โ”‚   โ”‚   โ”œโ”€โ”€ components/     # React components
โ”‚   โ”‚   โ””โ”€โ”€ lib/            # Utilities
โ”‚   โ”œโ”€โ”€ package.json
โ”‚   โ””โ”€โ”€ Dockerfile
โ”œโ”€โ”€ docker-compose.yml       # Docker orchestration
โ””โ”€โ”€ README.md               # Project documentation

๐Ÿ”ง Installation

Using uvx (Recommended - No Installation)

Run directly without installing:

uvx nextpy-cli my-project

Advantages:

  • โšก 10-100x faster than pip
  • โœ… No installation needed
  • โœ… Isolated environment
  • โœ… Always latest version

From PyPI

# Using pip
pip install nextpy-cli

# Using uv (faster)
uv pip install nextpy-cli

# Using pipx (isolated)
pipx install nextpy-cli

From Source

git clone https://github.com/VesperAkshay/nextpy.git
cd nextpy/python-cli
pip install -e .

Installing uv/uvx

If you don't have uv installed:

# macOS/Linux
curl -LsSf https://astral.sh/uv/install.sh | sh

# Windows
powershell -c "irm https://astral.sh/uv/install.ps1 | iex"

# Or with pip
pip install uv

๐Ÿค Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

๐Ÿ“„ License

MIT License - see the LICENSE file for details.

๐Ÿ”— Links

๐Ÿ’ก Why NextPy?

  • Save Time: Skip the boilerplate and start building features immediately
  • Best Practices: Pre-configured with industry standards
  • Flexible: Choose your database and customize as needed
  • Modern Stack: Use the latest and greatest technologies
  • Docker Ready: Deploy anywhere with confidence
  • Python-First: Built by Python developers, for Python developers

๐Ÿ› Troubleshooting

Command not found after installation

Make sure your Python scripts directory is in your PATH:

# On Linux/Mac
export PATH="$HOME/.local/bin:$PATH"

# On Windows
# Add %APPDATA%\Python\Python311\Scripts to your PATH

Permission errors on Linux/Mac

pip install --user nextpy-cli

๐Ÿ“š Documentation

For more detailed documentation, visit our GitHub repository.


Made with โค๏ธ by VesperAkshay

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nextpy_cli-1.1.1.tar.gz (26.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nextpy_cli-1.1.1-py3-none-any.whl (26.4 kB view details)

Uploaded Python 3

File details

Details for the file nextpy_cli-1.1.1.tar.gz.

File metadata

  • Download URL: nextpy_cli-1.1.1.tar.gz
  • Upload date:
  • Size: 26.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.13

File hashes

Hashes for nextpy_cli-1.1.1.tar.gz
Algorithm Hash digest
SHA256 0916456de52e89f9cd2664689fd94800c46fac226bdffa43542b1476d91b5a29
MD5 b15e7e21ea04db6f9dfe370fdabfa07d
BLAKE2b-256 32914dbbeedf24e2b0d824002761d52b5314d4091ad10fa32f23ea675ae580be

See more details on using hashes here.

File details

Details for the file nextpy_cli-1.1.1-py3-none-any.whl.

File metadata

  • Download URL: nextpy_cli-1.1.1-py3-none-any.whl
  • Upload date:
  • Size: 26.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.13

File hashes

Hashes for nextpy_cli-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9f98b003dc2b00dc0759678bfcac312f1493b9bf4ef885b7dcd20b94f2ea3613
MD5 271d94117a7b1e8edab6dabee91a1912
BLAKE2b-256 3d99112fd3233fd9b7dc5a276fb1bed2229414e047b68f3dc904c0bd6fabc449

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page