Metadata-Version: 2.4
Name: storeapp
Version: 3.0.1
Summary: Le Play Store du Terminal — client TUI Textual + backend FastAPI
Home-page: https://github.com/gopu-inc/store-app
Author: StoreApp
Author-email: ceoseshell@gmail.com
License: MIT
Project-URL: Homepage, https://github.com/gopu-inc/store-app
Project-URL: Repository, https://github.com/gopu-inc/store-app
Project-URL: Documentation, https://github.com/gopu-inc/store-app/blob/main/README.md
Project-URL: Changelog, https://github.com/gopu-inc/store-app/blob/main/CHANGELOG.md
Keywords: terminal,tui,app-store,textual,cli,playstore,playstore tui,playstore terminal
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Terminals
Classifier: Topic :: System :: Software Distribution
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: textual>=0.80.0
Requires-Dist: rich>=13.7.0
Requires-Dist: httpx>=0.27.0
Provides-Extra: nlp
Requires-Dist: nltk>=3.8.0; extra == "nlp"
Provides-Extra: dev
Requires-Dist: pytest>=8.0.0; extra == "dev"
Requires-Dist: pytest-asyncio>=0.23.0; extra == "dev"
Requires-Dist: pytest-mock>=3.14.0; extra == "dev"
Requires-Dist: coverage>=7.4.0; extra == "dev"
Requires-Dist: mypy>=1.9.0; extra == "dev"
Requires-Dist: ruff>=0.4.0; extra == "dev"
Requires-Dist: textual[dev]>=0.80.0; extra == "dev"
Requires-Dist: nltk>=3.8.0; extra == "dev"
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: keywords
Dynamic: license
Dynamic: license-file
Dynamic: project-url
Dynamic: provides-extra
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# StoreApp.TUI v3.0

> **Le Play Store du Terminal** — une TUI immersive style Google Play pour découvrir, télécharger, installer et publier des applications en ligne de commande.

---

## Aperçu rapide

```
 _____ ___  ___  ____  _____   _   ____  ____
/ ____|  _||   ||  _ \|  ___| / \ |  _ \|  _ \
\___ \ | |_|   || |_) |  _|  / _ \| |_) | |_) |
 ___) ||  _|   ||  _ <| |___/ ___ \  __/|  __/
|____/ |_| \___||_| \_\|____/_/   \_\_|  |_|

✦  Le Play Store du Terminal  ✦
```

![socket](https://badge.socket.dev/npm/package/storeapp-tui/3.0.1)

**Backend public** : `https://storeapp-7mbo.onrender.com`  
**Python requis** : 3.9+  
**OS** : Linux · macOS · Windows (WSL recommandé)

---

## Installation

### Option 1 — Script automatique (recommandé)

```bash
git clone https://github.com/gopu-inc/store-app.git
cd store-app
bash install.sh
```

Options disponibles :

| Flag | Effet |
|---|---|
| *(aucun)* | Installe uniquement le client TUI |
| `--dev` | Client + dépendances serveur (développement local) |
| `--server` | Dépendances serveur uniquement |
| `--uninstall` | Supprime l'installation complète |

### Option 2 — Manuelle

```bash
# 1. Cloner
git clone https://github.com/gopu-inc/store-app.git
cd store-app

# 2. Dépendances
pip install textual>=0.50.0 rich>=13.0.0 httpx>=0.27.0

# 3. (Optionnel) Installer le package
pip install -e .
```

### Option 3 — pip (quand publié sur PyPI)

```bash
pip install storeapp-tui
```

---

## Lancement

```bash
# Via l'entry-point installé
store

# Directement depuis le dépôt
cd store && python store.py

# Avec un serveur personnalisé
STOREAPP_API_URL=http://localhost:8000 store
```

---

## Fonctionnalités v3.0

### Écran Accueil — style Play Store

| Zone | Description |
|---|---|
| **Top bar** | Logo + barre de recherche intégrée + nom d'utilisateur connecté |
| **Catégories** | Chips scrollables : Tout / Python / Node / Go / Rust / Bash… |
| **Carousel "En vedette"** | 6 cartes riches (icône env, auteur, note ★, téléchargements) — cliquables |
| **Liste Applications** | DataTable avec icônes d'environnement, notes colorées, highlight de recherche |
| **Barre de nav** | Accueil · Parcourir · Publier · Profil |

### Écran Parcourir — recherche avancée

| Fonctionnalité | Détail |
|---|---|
| **Live search** | Recherche dès 2 caractères tapés, sans appuyer Entrée |
| **Highlight** | Correspondances surlignées dans le nom **et** la description |
| **Filtres Env** | Chips : Tout / Python / Node / Go / Rust… |
| **Tri** | Pertinence · Note ↓ · Téléchargements ↓ · Récent |
| **Statut serveur** | Indicateur ● vert/rouge (ping Render en temps réel) |

### Écran Détail — TabbedContent

| Onglet | Contenu |
|---|---|
| **📋 Informations** | Nom, bundle, version, auteur, description, dépendances, permissions |
| **📖 README** | Rendu Markdown du README de l'application |
| **📸 Médias** | Icône pixel art (`.pxl`) + carousel de screenshots |
| **⭐ Avis** | Liste des notes et commentaires utilisateurs |

#### Installation automatique

Le bouton **⚙ Installer** :
1. Télécharge le `.tpkg` dans `~/.storeapp/downloads/`
2. Extrait l'archive dans `~/.storeapp/tmp_store/<bundle>/`
3. Détecte et exécute `postinstall.sh` automatiquement
4. Affiche la progression et les logs en temps réel

### Autres écrans

| Écran | Description |
|---|---|
| **Login** | ASCII art banner · Connexion + Inscription · Session persistante |
| **Publier** | Upload `.tpkg` avec validation en temps réel |

---

## Raccourcis clavier

| Touche | Action |
|---|---|
| `Ctrl+H` | Accueil |
| `Ctrl+B` | Parcourir |
| `Ctrl+P` | Publier |
| `Ctrl+Q` | Quitter |
| `Escape` | Retour / Fermer dialog |
| `1 – 5` | Sélectionner une note (dialog de notation) |
| `F5` | Rafraîchir l'écran courant |
| `Tab` / `Shift+Tab` | Naviguer entre les champs |

---

## Architecture du projet

```
store-app/
├── install.sh              # Script d'installation universel
├── setup.py                # Package Python (pip install -e .)
├── MANIFEST.in             # Fichiers inclus dans la distribution
├── server.py               # Backend FastAPI (Render)
├── manifest.txml           # Manifest du projet
│
└── store/                  # Client TUI
    ├── store.py            # Point d'entrée (python store.py)
    ├── app.py              # StoreApp — routage, bindings globaux
    ├── api.py              # Client httpx → API Render
    ├── config.py           # Config + persistance session (~/.storeapp/)
    │
    ├── screens/
    │   ├── login.py        # Login/signup avec ASCII art
    │   ├── home.py         # Accueil Play Store (carousel, catégories)
    │   ├── browse.py       # Recherche live + filtres avancés
    │   ├── detail.py       # Détail tabbé + installation + médias
    │   └── publish.py      # Publication .tpkg
    │
    ├── widgets/
    │   ├── pixel_art.py    # PixelArtWidget — rendu .pxl (blocs colorés)
    │   ├── rating_dialog.py  # Modal notation 1–5 ★
    │   └── comment_dialog.py # Modal commentaire texte libre
    │
    ├── styles/
    │   └── app.tcss        # Thème cyberpunk dark complet (730+ lignes)
    │
    └── agent/              # Outils développeur
        ├── builder.py      # Construction du .tpkg
        ├── commands.py     # Commandes CLI (init/build/publish)
        └── metadata.py     # Gestion du manifest.txml
```

### Flux de données

```
Utilisateur
    │
    ▼
StoreApp (app.py)          ← bindings clavier, routage screens
    │
    ├── StoreAPI (api.py)  ← httpx → https://storeapp-7mbo.onrender.com
    │       │
    │       └── /apps · /search · /featured · /download · /rate · /comment
    │
    └── Screens            ← workers thread (jamais de freeze UI)
```

---

## Format `.pxl` (pixel art)

Les icônes et screenshots sont stockés côté serveur en PNG et convertis à la volée en `.pxl` (texte brut) par l'API.

**Format hex (par défaut) :**
```
#1a1b1e #58a6ff #58a6ff #1a1b1e
#58a6ff #ffffff #ffffff #58a6ff
#1a1b1e #58a6ff #58a6ff #1a1b1e
```

**Format palette :**
```
PALETTE
B=#1a1b1e  W=#ffffff  A=#58a6ff  .=transparent
PIXELS
B A A B
A W W A
B A A B
```

Rendu dans le terminal : blocs colorés `█` via Rich.

---

## Format `.tpkg`

Les applications publiées sur le store sont des archives `.tar.gz` renommées `.tpkg`.

**Structure attendue :**
```
monapp.tpkg/
├── manifest.txml           # Obligatoire
├── README.md               # Recommandé
├── postinstall.sh          # Exécuté automatiquement à l'installation
├── icon.png                # 200×200 px (optionnel)
└── screenshots/            # Max 5 PNG (optionnel)
    ├── 01.png
    └── 02.png
```

**manifest.txml minimal :**
```xml
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
  <name>Mon Application</name>
  <bundle>com.auteur.monapp</bundle>
  <version>1.0.0</version>
  <author>Auteur</author>
  <description>Description courte</description>
  <environnement>python</environnement>
  <entrypoint>main.py</entrypoint>
</manifest>
```

---

## Agent CLI (développeurs)

```bash
# Initialiser un nouveau projet
agent init

# Construire le .tpkg
agent build

# Publier sur le store (connexion requise)
agent publish
```

---

## Backend (serveur FastAPI)

Le serveur `server.py` est déployé sur **Render** à l'adresse `https://storeapp-7mbo.onrender.com`.

### Lancer localement

```bash
# Dépendances serveur
pip install fastapi uvicorn[standard] python-jose[cryptography] pillow python-multipart httpx

# Variables d'environnement requises
export GITHUB_TOKEN=ghp_xxxxxxxxxxxxx    # Token GitHub (stockage des .tpkg)
export GITHUB_REPO=owner/repo            # Dépôt de stockage
export SECRET_KEY=changeme               # Clé JWT (optionnel, défaut généré)

# Lancement
python server.py
# → http://localhost:8000
```

### Routes principales

| Méthode | Route | Description |
|---|---|---|
| `GET` | `/apps` | Liste toutes les applications |
| `GET` | `/apps/{bundle}` | Détail d'une application |
| `GET` | `/apps/{bundle}/icon` | Icône `.pxl` 16×8 |
| `GET` | `/apps/{bundle}/screenshots` | Screenshots `.pxl` 40×14 |
| `GET` | `/search?q=…` | Recherche full-text |
| `GET` | `/featured` | Applications en vedette |
| `GET` | `/download/{bundle}` | Téléchargement `.tpkg` |
| `POST` | `/signup` | Création de compte |
| `POST` | `/login` | Connexion (JWT) |
| `POST` | `/publish` | Publication `.tpkg` |
| `POST` | `/rate/{bundle}` | Note + commentaire |

---

## Données persistantes locales

```
~/.storeapp/
├── session.json            # Token JWT + nom d'utilisateur
├── downloads/              # .tpkg téléchargés
├── apps/                   # Applications installées
└── tmp_store/              # Extraction temporaire à l'installation
```

---

## Dépendances

| Paquet | Version min | Rôle |
|---|---|---|
| `textual` | 0.50.0 | Framework TUI |
| `rich` | 13.0.0 | Rendu texte coloré |
| `httpx` | 0.27.0 | Client HTTP async-compatible |
| `fastapi` | *(serveur)* | API REST |
| `uvicorn` | *(serveur)* | Serveur ASGI |
| `pillow` | *(serveur)* | Conversion PNG → .pxl |
| `python-jose` | *(serveur)* | JWT |

---

## Contribution

1. Forkez le dépôt
2. Créez une branche : `git checkout -b feat/ma-fonctionnalite`
3. Committez : `git commit -m "feat: description"`
4. Pushez : `git push origin feat/ma-fonctionnalite`
5. Ouvrez une Pull Request

---

## Licence

MIT — voir [LICENSE](LICENSE)
