CLI tool to scaffold FastAPI + Next.js full-stack applications with Fox AI companion
Project description
NextPy CLI
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:
- Project name
- Frontend framework (Next.js or Vite + React)
- Database choice (SQLite, PostgreSQL, or MongoDB)
- Docker support (yes/no)
- GitHub repository initialization (yes/no)
- 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
- Frontend: http://localhost:3000
- Backend API: http://localhost:8000
- API Docs: http://localhost:8000/docs
๐ฆ 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.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0916456de52e89f9cd2664689fd94800c46fac226bdffa43542b1476d91b5a29
|
|
| MD5 |
b15e7e21ea04db6f9dfe370fdabfa07d
|
|
| BLAKE2b-256 |
32914dbbeedf24e2b0d824002761d52b5314d4091ad10fa32f23ea675ae580be
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9f98b003dc2b00dc0759678bfcac312f1493b9bf4ef885b7dcd20b94f2ea3613
|
|
| MD5 |
271d94117a7b1e8edab6dabee91a1912
|
|
| BLAKE2b-256 |
3d99112fd3233fd9b7dc5a276fb1bed2229414e047b68f3dc904c0bd6fabc449
|