Skip to content

⚑ 3-Minute Bootstrap: Hello World¢

Get up and running with Neuroglia in under 3 minutes! This quick-start guide gets you from zero to a working API in the fastest way possible.

πŸš€ Want a Production-Ready Starting Point?

For a fully-featured application template with authentication, frontend, and all common concerns pre-configured, check out the Starter App Repository. This guide shows the minimal hello-world approach.

🎯 What You'll Build

A minimal "Hello Pizzeria" API with one endpoint that demonstrates the basic framework setup.## πŸš€ Quick Setup

PrerequisitesΒΆ

  • Python 3.8+ installed
  • pip package manager

InstallationΒΆ

# Create new directory
mkdir hello-pizzeria && cd hello-pizzeria

# Install Neuroglia
pip install neuroglia-python[web]

πŸ“ Create Your First APIΒΆ

Create main.py:

from neuroglia.hosting.web import WebApplicationBuilder
from neuroglia.mvc import ControllerBase
from classy_fastapi.decorators import get

class HelloController(ControllerBase):
    """Simple hello world controller"""

    @get("/hello")
    async def hello_world(self) -> dict:
        """Say hello to Mario's Pizzeria!"""
        return {
            "message": "Welcome to Mario's Pizzeria! πŸ•",
            "status": "We're open for business!",
            "framework": "Neuroglia Python"
        }

def create_app():
    """Create the web application"""
    builder = WebApplicationBuilder()

    # Add SubApp with controllers
    builder.add_sub_app(
        SubAppConfig(
            path="/api",
            name="api",
            controllers=[HelloController]
        )
    )

    # Build app
    app = builder.build()

    return app

if __name__ == "__main__":
    import uvicorn
    app = create_app()
    uvicorn.run(app, host="0.0.0.0", port=8000)

πŸƒβ€β™‚οΈ Run Your APIΒΆ

python main.py

πŸŽ‰ Test Your APIΒΆ

Open your browser and visit:

You should see:

{
  "message": "Welcome to Mario's Pizzeria! πŸ•",
  "status": "We're open for business!",
  "framework": "Neuroglia Python"
}

βœ… What You've AccomplishedΒΆ

In just 3 minutes, you've created:

  • βœ… A working FastAPI application with Neuroglia
  • βœ… Automatic API documentation (Swagger UI)
  • βœ… Controller-based routing with clean architecture
  • βœ… Automatic module discovery
  • βœ… Dependency injection container setup

πŸ”„ Next StepsΒΆ

Now that you have the basics working:

  1. πŸ› οΈ Local Development Setup - Set up a proper development environment
  2. πŸ• Mario's Pizzeria Tutorial - Build a complete application (1 hour)
  3. 🎯 Architecture Patterns - Learn the design principles
  4. πŸš€ Framework Features - Explore advanced capabilities

πŸ”— Key Concepts IntroducedΒΆ

This hello world example demonstrates:


🎯 Pro Tip

This is just the beginning! The framework includes powerful features like CQRS, event sourcing, and advanced data access patterns. Continue with the Local Development Setup to explore more.