Skip to content

nexios-labs/nexios-bootstrap

Repository files navigation

Nexios Logo

πŸš€ Nexios Bootstrap

A modern, high-performance ASGI web framework starter template built with Nexios - the next-generation Python web framework designed for speed, flexibility, and simplicity with Rust-powered performance.

✨ Nexios Features

  • πŸ—οΈ ASGI Architecture - Built for async/await from the ground up
  • πŸ”„ Dependency Injection - Modern DI system for clean, testable code
  • πŸ“š Auto Documentation - Automatic OpenAPI/Swagger generation
  • πŸ›‘οΈ Security Built-in - JWT, API Key authentication, CORS, CSRF protection
  • 🌐 WebSocket Support - Real-time communication out of the box
  • 🎯 Pydantic Integration - Type-safe data validation and serialization
  • πŸ›£οΈ Flexible Routing - Express.js-like routing with modern Python features
  • πŸ§ͺ Testing Utilities - Comprehensive testing framework integration
  • πŸ“Š Pagination - Built-in pagination support
  • ⚑ HTTP/2 Support - Latest web protocol support
  • πŸ”„ Session Management - Secure session handling
  • 🎨 Custom Decorators - Extensible middleware and decorators

🏁 Quick Start

Prerequisites

  • Python 3.10+
  • pip or uv package manager

Installation

# Clone the repository
git clone https://github.com/nexios-labs/nexios-bootstrap.git
cd nexios-bootstrap

# Install dependencies
pip install -r requirements.txt

# Or using uv (recommended)
uv pip install -r requirements.txt

# Run development server
make dev

Docker Setup

# Build and run with Docker
make docker-up

# Or manually
docker-compose up -d

πŸ“ Project Structure

nexios-bootstrap/
β”œβ”€β”€ src/                          # Source code
β”‚   β”œβ”€β”€ api/                   # API routes
β”‚   β”‚   └── health/           # Health check endpoints
β”‚   β”œβ”€β”€ core/                  # Core application logic
β”‚   β”‚   β”œβ”€β”€ middleware/         # Custom middleware
β”‚   β”‚   └── database.py         # Database configuration
β”‚   β”œβ”€β”€ models/                 # Database models
β”‚   β”œβ”€β”€ utils/                  # Utility functions
β”‚   └── main.py               # Application entry point
β”œβ”€β”€ tests/                         # Test suite
β”œβ”€β”€ scripts/                        # Utility scripts
β”œβ”€β”€ docker-compose.yml               # Development environment
β”œβ”€β”€ docker-compose.prod.yml         # Production environment
β”œβ”€β”€ Dockerfile                     # Container configuration
β”œβ”€β”€ Makefile                       # Build automation
β”œβ”€β”€ requirements.txt                # Dependencies
β”œβ”€β”€ pyproject.toml                 # Project configuration
└── README.md                      # This file

πŸ›£οΈ API Endpoints

Health Check

GET /health/

Basic health check endpoint.

Response:

{
  "status": "ok",
  "service": "nexios-starter",
  "timestamp": "2024-02-20T12:00:00Z",
  "version": "0.1.0"
}

POST /health/

Advanced health check with async counting functionality.

Request:

{
  "service_name": "my-service",
  "include_details": true,
  "start_number": 1,
  "end_number": 10,
  "step": 2
}

Response:

{
  "status": "ok",
  "service": "my-service",
  "timestamp": "2024-02-20T12:00:00Z",
  "version": "0.1.0",
  "check_type": "basic",
  "counting_result": {
    "start": 1,
    "end": 10,
    "step": 2,
    "numbers": [1, 3, 5, 7, 9],
    "total_count": 5
  },
  "details": {
    "database": "connected",
    "cache": "available",
    "external_apis": "responsive"
  }
}

πŸ—ƒοΈ Database Integration

Supported Databases

  • PostgreSQL - Production-ready with connection pooling
  • SQLite - Development and testing (default fallback)

Environment Variables

# PostgreSQL (recommended)
DATABASE_URL=postgres://user:password@localhost:5432/nexios

# Or individual settings
DB_HOST=localhost
DB_PORT=5432
DB_USER=postgres
DB_PASSWORD=password
DB_NAME=nexios

# Application
APP_ENV=development
DEBUG=true

πŸ§ͺ Testing

Run Tests

# Run all tests
pytest tests/

# Run with coverage
pytest tests/ --cov=src --cov-report=html

# Verbose output
pytest tests/ -v

🐳 Docker Deployment

# Build and run with Docker
docker-compose up -d

# Stop services
docker-compose down

πŸ”§ Development Workflow

Code Quality

# Format code
ruff format src/ tests/

# Lint code
ruff check src/ tests/

# Install dependencies
pip install -r requirements.txt

πŸ“š Documentation

Official Documentation

Repository

οΏ½ Middleware

The application includes:

  • CORS Middleware - Cross-origin request handling
  • Logging Middleware - Request/response logging

πŸ“Š Logging

Automatic request/response logging with:

  • HTTP method and URL
  • Origin tracking
  • Response status codes

🀝 Contributing

We welcome contributions! Please see our Contributing Guide.

Development Setup

# Fork and clone
git clone https://github.com/your-username/nexios-bootstrap.git
cd nexios-bootstrap

# Install dependencies
pip install -r requirements.txt

# Create feature branch
git checkout -b feature/amazing-feature

# Make changes and test
pytest tests/
ruff check src/ tests/

πŸ“„ License

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

πŸ™β€β™‚οΈ Acknowledgments

  • Built with Nexios framework
  • Inspired by modern web framework best practices

πŸ“ž Support


⭐ Star this repository if it helped you!

Built with ❀️ using Nexios

About

The ultimate clean, modular Nexios starter template with scalable structure, and Docker support.

Resources

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors