Metadata-Version: 2.4
Name: vesta-web
Version: 1.2.15
Summary: An extensive web framework adding every feature needed for Carbonlab
Project-URL: Homepage, https://gitlab.com/Louciole/vesta
Project-URL: Issues, https://gitlab.com/Louciole/vesta/-/issues
Author-email: Lou !  <lou@carbonlab.dev>
License: # Copyright (C) Carbonlab - All Rights Reserved
        
        * Unauthorized copying of this file, via any medium is strictly prohibited
        * Proprietary
        * Written by Lou ! <lou@carbonlab.dev>
License-File: LICENSE.md
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Internet :: WWW/HTTP
Requires-Python: >=3.8
Requires-Dist: bcrypt
Requires-Dist: colorama
Requires-Dist: configparser
Requires-Dist: dkimpy
Requires-Dist: fastpysgi
Requires-Dist: multipart
Requires-Dist: psycopg[pool]
Requires-Dist: pyjwt
Requires-Dist: setuptools
Requires-Dist: websockets
Description-Content-Type: text/markdown

# Vesta 🍒

> **V1 — _Harpie_** · A batteries-included Python web framework.

Vesta is a strongly opinionated, minimalist framework for building full-stack web
applications. Routing, a PostgreSQL ORM, authentication, mailing, WebSockets, and a
companion JavaScript front-end library all ship in a single package — so you can go
from `vesta init` to a running app without wiring together a dozen dependencies.

<p>
  <img alt="Python" src="https://img.shields.io/badge/python-3.8%2B-blue">
  <img alt="PostgreSQL" src="https://img.shields.io/badge/postgresql-required-336791">
</p>

---

## ✨ Features

- **HTTP server** — fast WSGI-based routing with a simple `@expose` decorator
- **WebSocket server** — real-time messaging and notifications
- **PostgreSQL ORM** — lightweight, parameterized query helpers
- **uniauth** — built-in authentication: JWT sessions, email verification, password reset
- **Mailing** — SMTP delivery with DKIM signing and HTML templates
- **Front-end library** — reactive HTML templating, navigation, i18n, and a Markdown renderer
- **Tooling** — project scaffolding, DB management, and nginx/systemd setup via one CLI

## 📋 Requirements

- Python **3.8+**
- **PostgreSQL** (used by the ORM and uniauth)

## ⏬ Installation

```bash
pip install vesta-web
```

Or install the latest from source control:

```bash
pip install git+https://gitlab.com/Louciole/vesta.git/
```

### Minimal example

```python
from vesta import Server

from os.path import abspath, dirname
PATH = dirname(abspath(__file__))

class App(Server):
    features = {"errors": {404: "/static/404.html"}}

    @Server.expose
    def index(self):
        return self.file(PATH + "/static/home/home.html")

    @Server.expose
    def hello(self, name="world"):
        return f"Hello, {name}!"

App(path=PATH, configFile="/server.ini")
```

A method decorated with `@Server.expose` becomes a route: `index` is served at `/`,
and `hello` at `/hello` (query/JSON/form parameters are passed as arguments).

## 🛠️ CLI

| Command              | Description                                            |
| -------------------- | ------------------------------------------------------ |
| `vesta init`         | Scaffold a new project (choose server type & features) |
| `vesta install`      | Install front-end dependencies declared in the project |
| `vesta update`       | Update the bundled front-end libraries                 |
| `vesta test`         | Run the project's test suite                           |
| `vesta db create`    | Create and initialize the database (+ uniauth)         |
| `vesta db init`      | Initialize the schema on an existing database          |
| `vesta db reset`     | Drop and re-initialize the database                    |
| `vesta nginx setup`  | Install an nginx site config                           |
| `vesta service setup`| Install and enable a systemd service                   |

## ⚙️ Configuration

Settings live in `server.ini` (parsed with `ConfigParser`). A typical file:

```ini
[server]
IP = 0.0.0.0
PORT = 9876
DEBUG = true
DEFAULT_ENDPOINT = /
SERVICE_NAME = MyApp

[security]
SECRET_KEY = change-me        # signs JWT sessions — use a long random value

[DB]
DB_USER = myapp
DB_PASSWORD = ...
DB_NAME = myapp
DB_HOST = localhost
DB_PORT = 5432
```

> **Keep secrets out of version control.** `server.ini` holds credentials and the JWT
> signing key — don't commit a real one. To stop tracking changes to a local copy:
> `git update-index --assume-unchanged server.ini`.

## 📚 Documentation

Full guides and the API reference: **https://louciole.gitlab.io/vesta-docs/**

## 📁 Build from source

```bash
python3 -m pip install --upgrade build
python3 -m build
pip install dist/vesta_web-*.whl
```

