@rafeekpro/stackwizard
v1.3.0
Published
π§ββοΈ Magical full-stack project generator with FastAPI, React, PostgreSQL, and Docker
Maintainers
Readme
π§ββοΈ StackWizard CLI
Create production-ready full-stack applications in seconds!
StackWizard is a powerful CLI tool that generates complete, production-ready full-stack applications with a single command. Get a fully configured project with FastAPI backend, React frontend, PostgreSQL database, and Docker Compose orchestration - all following industry best practices.
β¨ Features
Core Stack
- π FastAPI Backend - Modern Python web API with async support, JWT authentication, and 100% type hints
- βοΈ React Frontend - Choose between Material-UI or Tailwind CSS for your UI
- π PostgreSQL Database - Production-ready database with Alembic migrations
- π³ Docker Compose - Complete containerized development environment with health checks
Security & Architecture
- π Authentication System - JWT-based auth with secure password hashing & refresh tokens
- π‘οΈ Security Middleware - Rate limiting, CSRF protection, security headers
- ποΈ Service Layer Architecture - Clean separation with Service/Repository patterns
- π API Documentation - Auto-generated Swagger/OpenAPI documentation
Developer Experience
- π§ͺ Comprehensive Testing - Cypress E2E tests, unit tests, Docker validation
- π Visual Testing - Watch Cypress tests run in real-time
- π οΈ Pre-Push Validation - Automatic Docker & dependency verification
- π Test Orchestration - Makefile & custom orchestrator for test management
- π― Best Practices - Clean architecture, type safety, and production-ready configuration
π Quick Start
From GitHub (Current Method)
Clone and run directly:
# Clone the repository
git clone https://github.com/rafeekpro/stackwizard.git
cd stackwizard
npm install
# Run the generator
npm start
# or
node src/index.jsNPM Installation β
Install from NPM registry:
# Global installation
npm install -g @rafeekpro/stackwizard
# Or use npx directly
npx @rafeekpro/stackwizard my-awesome-appGitHub Packages (Alternative)
Install from GitHub Packages registry:
# Configure npm to use GitHub registry for @rafeekpro scope
npm config set @rafeekpro:registry https://npm.pkg.github.com
# Install globally
npm install -g @rafeekpro/stackwizardNote: Both NPM and GitHub Packages are now live with version 1.0.0!
π Usage
Interactive Mode (Recommended)
Simply run the command and follow the interactive prompts:
# From cloned repository
npm start
# Or after global installation
stackwizard
# Or use npx directly (no installation needed!)
npx @rafeekpro/stackwizardYou'll be asked to configure:
- π Project name
- π¨ UI library (Material-UI or Tailwind CSS)
- ποΈ Database configuration
- π Port settings
- β Additional features (Git initialization, dependency installation)
Command Line Mode
Skip the prompts with command-line options:
node src/index.js --name my-app --ui mui --skip-gitAvailable Options
Options:
-V, --version Output version number
-n, --name <name> Project name
-u, --ui <ui> UI library (mui or tailwind)
-s, --skip-git Skip git initialization
-i, --install Install dependencies after creation
-q, --quick Quick mode - use all defaults
-h, --help Display helpQuick Mode
Generate a project with all defaults in seconds:
node src/index.js --quick --name my-appποΈ Generated Project Structure
your-project/
βββ backend/ # FastAPI backend application
β βββ app/
β β βββ api/ # API endpoints
β β βββ core/ # Core configuration & security
β β βββ crud/ # Database operations
β β βββ models/ # SQLAlchemy models
β β βββ schemas/ # Pydantic schemas
β β βββ main.py # Application entry point
β βββ alembic/ # Database migrations
β βββ tests/ # Backend tests
β βββ Dockerfile # Production-ready Dockerfile
βββ frontend/ # React frontend application
β βββ src/
β β βββ components/ # Reusable UI components
β β βββ pages/ # Page components
β β βββ services/ # API service layer
β β βββ App.js # Main application component
β βββ public/ # Static assets
β βββ Dockerfile # Production-ready Dockerfile
βββ database/ # Database initialization
βββ docker-compose.yml # Docker orchestration
βββ .env # Environment configuration
βββ README.md # Project documentationπ― What You Get
Backend (FastAPI)
- β RESTful API with async/await support
- β SQLAlchemy ORM with Alembic migrations
- β JWT authentication & authorization
- β Request validation with Pydantic
- β CORS configuration
- β Health check endpoints
- β Comprehensive error handling
- β 100% type hints for better IDE support
Frontend (React)
- β Modern React with Hooks
- β React Router for navigation
- β Axios with request/response interceptors
- β Authentication context & protected routes
- β Responsive design
- β Material-UI or Tailwind CSS styling
- β Environment-based configuration
Database (PostgreSQL)
- β PostgreSQL 15 with optimal settings
- β Database migrations with Alembic
- β Connection pooling
- β Automated backup support
- β Health monitoring
DevOps (Docker)
- β Multi-stage Dockerfiles for optimal image size
- β Docker Compose with health checks
- β Hot-reload for development
- β Production-ready configuration
- β Optional Redis & Nginx services
π Running Your Generated Project
After generation, start your full-stack application with:
cd your-project
docker-compose up -dYour application will be available at:
- π Frontend: http://localhost:3000
- π Backend API: http://localhost:8000
- π API Documentation: http://localhost:8000/docs
π οΈ Development Workflow
Without Docker
Backend Development:
cd backend
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txt
uvicorn app.main:app --reloadFrontend Development:
cd frontend
npm install
npm startDatabase Migrations
# Create a new migration
alembic revision --autogenerate -m "Description"
# Apply migrations
alembic upgrade headπ§ͺ Testing & Validation
Visual Testing with Cypress
Watch your tests run in real-time:
# Install Cypress
make cypress-install
# Test MUI template visually
make cypress-mui
# Test Tailwind template visually
make cypress-tailwindPre-Push Validation
Ensure everything works before pushing to GitHub:
# Full validation (recommended)
npm run validate:full
# Quick validation
npm run validate:quick
# Install git hooks for automatic validation
npm run install-hooksTest Orchestration
Run comprehensive tests with a single command:
# Using Makefile
make test-all # Run all tests
make pre-commit # Pre-commit checks
make docker-build-test # Test Docker builds
# Using orchestrator
npm run test:orchestrate # Smart mode
npm run test:orchestrate:full # Full test suiteπ¦ System Requirements
- Node.js 16.0.0 or higher
- npm 7.0.0 or higher
- Docker & Docker Compose (for running generated projects)
- Python 3.11+ (for local backend development)
π€ Contributing
Contributions are welcome! Feel free to:
- Report bugs and request features via GitHub Issues
- Submit pull requests with improvements
- Share feedback and suggestions
π License
MIT Β© RafaΕ Εagowski
π¨βπ» Author
RafaΕ Εagowski - Full-Stack Developer
- GitHub: @rafeekpro
- NPM: @rafeekpro
π Technologies Used
This project leverages modern, production-ready technologies:
- FastAPI - High-performance Python web framework
- React - Component-based UI library
- PostgreSQL - Enterprise-grade database
- Docker - Container orchestration
- SQLAlchemy - Python SQL toolkit and ORM
- Alembic - Database migration tool
- Material-UI - React component library
- Tailwind CSS - Utility-first CSS framework
π Contact & Support
- π Bug Reports: GitHub Issues
- π‘ Feature Requests: GitHub Discussions
- π¦ NPM Package: @rafeekpro/stackwizard
- π¦ GitHub Package: @rafeekpro/stackwizard
- π€ Developer: RafaΕ Εagowski
