create-neon-api

Crates.iocreate-neon-api
lib.rscreate-neon-api
version0.1.2
created_at2025-08-29 13:28:16.52898+00
updated_at2025-08-29 14:02:05.89683+00
descriptionA CLI tool to bootstrap a clean, production-ready Rust backend with JWT authentication and Neon PostgreSQL database.
homepage
repositoryhttps://github.com/peterkyle01/create-neon-api.git
max_upload_size
id1815831
size34,164
Peter Mwangi (peterkyle01)

documentation

README

๐Ÿš€ Create Neon API

Crates.io Downloads License: MIT

A beautiful CLI tool to bootstrap clean, production-ready Rust backend projects with JWT authentication and Neon PostgreSQL database integration.

๐Ÿ“ฆ Available on crates.io/crates/create-neon-api!

โœจ Features

  • ๐ŸŽจ Beautiful CLI Interface - Colorful and interactive prompts
  • ๐Ÿ“ฆ Template-based - Clones from a pre-configured Rust backend template
  • ๐Ÿ”ง Auto-configuration - Automatically updates project name in Cargo.toml
  • ๐Ÿ—๏ธ Ready to Build - Runs initial cargo build to fetch dependencies
  • โœ… Validation - Ensures project names follow Cargo package naming conventions
  • ๐Ÿ” Production Ready - Includes JWT authentication and PostgreSQL integration

๐Ÿ“‹ Prerequisites

  • Rust (latest stable version)
  • Git
  • Internet connection for cloning the template

๐Ÿ› ๏ธ Installation

Option 1: Install from Crates.io (Recommended)

cargo install create-neon-api

Option 2: Install from Source

git clone https://github.com/peterkyle01/create-neon-api.git
cd create-neon-api
cargo install --path .

๐Ÿš€ Usage

You can use the tool in two ways:

Option 1: Interactive Mode

Run the tool and follow the prompts:

create-neon-api

The tool will start with a beautiful interactive interface:

๐Ÿš€ Rust Backend Project Generator
โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
๐Ÿ“ Enter your project name: my-awesome-api
๐Ÿš€ Creating project 'my-awesome-api'...
โœ… Template cloned successfully!
๐Ÿ“ Updated Cargo.toml with project name
๐Ÿ“ฆ Running initial `cargo build`...
๐ŸŽ‰ Project created successfully!
Next steps: `cd my-awesome-api`, configure your `.env` file, and run `cargo run`.

Option 2: Direct Project Name

Provide the project name directly as an argument:

create-neon-api my-new-project

This will skip the interactive prompt and create the project immediately.

Quick Start

  1. Install the tool:

    cargo install create-neon-api
    
  2. Create a new project:

    # Interactive mode
    create-neon-api
    
    # Or provide project name directly
    create-neon-api my-awesome-api
    
  3. Follow the prompts (if using interactive mode) and enter your project name

  4. Start developing:

    cd your-project-name
    cp .env.example .env
    # Edit .env with your configuration
    cargo run
    

Project Name Validation

The tool validates project names to ensure they follow Cargo package naming conventions:

  • โœ… Lowercase letters, numbers, hyphens, and underscores only
  • โœ… Cannot start or end with hyphens
  • โœ… Cannot be empty

Examples:

  • โœ… my-api-server
  • โœ… user_service
  • โœ… backend2024
  • โŒ My-API (uppercase letters)
  • โŒ -invalid-start (starts with hyphen)
  • โŒ invalid@name (special characters)

๐Ÿ“ What You Get

The generated project includes:

  • ๐Ÿ” JWT Authentication - Ready-to-use authentication system
  • ๐Ÿ—„๏ธ PostgreSQL Integration - With Neon database support
  • ๐ŸŒ RESTful API Structure - Well-organized endpoints
  • โš™๏ธ Environment Configuration - .env file support
  • ๐Ÿงช Testing Setup - Unit and integration tests
  • ๐Ÿ“ Documentation - Comprehensive API documentation
  • ๐Ÿš€ Production Ready - Optimized for deployment

๐Ÿ”ง Next Steps After Project Creation

  1. Navigate to your project:

    cd your-project-name
    
  2. Configure environment variables:

    cp .env.example .env
    # Edit .env with your database credentials and JWT secret
    
  3. Run the development server:

    cargo run
    
  4. Run tests:

    cargo test
    

๐ŸŽฏ Template Repository

This tool clones from the Rust Backend Template repository, which includes:

  • Axum web framework
  • SQLx for database operations
  • JWT for authentication
  • Serde for serialization
  • Tokio async runtime
  • Configuration management
  • Error handling
  • Logging

๐Ÿค Contributing

Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.

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

๐Ÿ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ‘จโ€๐Ÿ’ป Author

Peter Mwangi

๐Ÿ™ Acknowledgments

  • Thanks to the Rust community for the amazing ecosystem
  • Inspired by create-react-app and similar bootstrapping tools
  • Built with love for the Rust backend development community

๐Ÿ“Š Version History

  • v0.1.1 - Latest release
    • Published and available on crates.io! ๐ŸŽ‰
    • Updated documentation and examples
  • v0.1.0 - Initial release
    • Interactive CLI interface
    • Template cloning and configuration
    • Project name validation
    • Automatic dependency building

Happy coding! ๐Ÿฆ€โœจ

Commit count: 0

cargo fmt