Metadata-Version: 2.4
Name: nolite
Version: 0.1.0
Summary: A Python library to create websites using only Python code
Home-page: https://github.com/FakeCoder01/nolite
Author: FakeCoder01
Author-email: fakecoder@duck.com
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
Requires-Python: >=3.6
Description-Content-Type: text/markdown
Requires-Dist: Flask<3.0.0,>=2.0.0
Requires-Dist: Flask-SQLAlchemy<3.0.0,>=2.5.1
Requires-Dist: SQLAlchemy<2.0,>=1.4
Requires-Dist: Flask-Login>=0.6.0
Requires-Dist: email_validator>=2.0.0
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# Nolite: The Full-Stack Python Web Framework

[![PyPI version](https://badge.fury.io/py/nolite.svg)](https://badge.fury.io/py/nolite)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Build Status](https://img.shields.io/badge/build-passing-brightgreen)](https://github.com/FakeCoder01/nolite)

**Build beautiful, database-driven web applications using only Python**

Nolite is a full-stack web framework for Python developers who want to create robust web applications without the steep learning curve of modern frontend development or complex backend configurations. Our mission is to provide an intuitive, batteries-included, and purely Pythonic way to build for the web.

---

## Key Features

- **Truly Full-Stack:** From frontend rendering to backend logic and database management, Nolite provides a single, unified Python environment.
- **Pythonic Styling:** Style your UI components using simple Python keyword arguments. Nolite translates `bg_color="blue"` into the correct CSS, so you don't have to.
- **Database Included:** Built-in integration with SQLAlchemy and SQLite gets you started with a powerful ORM and a zero-config database from day one.
- **Component-Based UI:** Build your user interface with a rich library of components, from basic tags like `Div` to advanced, interactive elements like `Navbar` and `Slider`.
- **Command-Line Interface:** Nolite comes with a CLI to instantly generate a new, well-structured, full-stack project, so you can start developing immediately.
- **Powered by Flask:** Nolite is built on the solid foundation of Flask, giving you access to its powerful ecosystem and extensions. It works seamlessly with standard Flask features like Blueprints.

---

## Quick Start: Your First Nolite Project in 60 Seconds

Nolite's Command-Line Interface (CLI) is the fastest and recommended way to start a new project.

### 1. Installation

First, install Nolite from PyPI. This will also make the `nolite` CLI tool available.

```bash
pip install nolite
```

### 2. Create a New Application

Use the `python -m nolite new` command to generate a new, full-stack project. This creates a new directory with a complete, ready-to-run application.

```bash
python -m nolite new my-first-app
```

### 3. Run the Development Server

Navigate into your new project directory and run the application.

```bash
cd my-first-app
python run.py
```

Your new Nolite application is now running at **http://127.0.0.1:5000**.

When you open your browser, you will see a welcome page that is dynamically rendering content from a pre-configured SQLite database. You have just created and launched a full-stack web application!

---

## The Nolite Workflow: A Glimpse Inside

The project generated by `nolite new` has a clean, scalable structure:

```text
my-first-app/
├── app.db            # Your application's SQLite database file
├── run.py            # The main entry point to start the server
└── app/
    ├── __init__.py   # Initializes the app, database, and routes
    ├── layout.py     # Defines a reusable page layout
    ├── models.py     # Defines your database tables (e.g., User)
    └── routes.py     # Defines your application's pages and logic
```

### 1. Define Your UI with Components

Build your pages by composing components and styling them with simple keyword arguments.

```python
# app/layout.py
from nolite.components import Card, H1, Paragraph

def info_card(title, text):
    return Card(
        padding=25,
        border_radius=8,
        box_shadow="0 5px 15px rgba(0,0,0,0.1)",
        hover_style={"transform": "translateY(-5px)"},
        transition="transform 0.2s ease-in-out",
        children=[
            H1(children=[title]),
            Paragraph(children=[text])
        ]
    )
```

### 2. Define Your Database in `models.py`

Create your database tables by defining simple Python classes. Nolite handles the SQL for you.

```python
# app/models.py
from . import db

class Product(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    name = db.Column(db.String(120), nullable=False)
    price = db.Column(db.Float, nullable=False)
```

### 3. Create Your Pages in `routes.py`

Define a function that returns a `Page` object and decorate it with a route. You can query your database directly inside this function.

```python
# app/routes.py
from . import app
from .models import Product
from .layout import main_layout

@app.route("/")
def index():
    # Query the database for all products
    all_products = Product.query.all()

    # Use your components to build the page content
    product_cards = [info_card(p.name, f"${p.price}") for p in all_products]

    # Return the final page using your main layout
    return main_layout(children=product_cards)
```

## Contributing

Any contribution of all kinds is welcome. Whether it's reporting a bug, suggesting a new feature, or improving the documentation.

## License

This project is licensed under the MIT License.
