Skip to main content

Generate complete Streamlit applications with authentication and database templates

Project description

Streamlit App Generator

๐Ÿš€ Generate complete Streamlit applications with authentication and database templates in seconds!

Created by: Leandro Meyer Dal Cortivo

Features

  • ๐Ÿ” Multiple Auth Styles: Basic, Modern, and Minimal login templates
  • ๐Ÿ—„๏ธ Database Templates: PostgreSQL, MySQL, SQLite, MongoDB, Redis
  • ๐Ÿ“„ Multi-page Support: Auto-generate page structure
  • ๐ŸŽจ Customizable Themes: Light, Dark, and Custom themes
  • ๐Ÿ›ก๏ธ Security First: Password hashing, session management, role-based access
  • ๐Ÿ“ฆ Production Ready: Clean code, type hints, comprehensive tests
  • โšก Performance Optimized: Caching, connection pooling, lazy loading

Installation

pip install streamlit-app-generator

Development Installation

git clone https://github.com/leandrodalcortivo/streamlit-app-generator.git
cd streamlit-app-generator
pip install -e ".[dev]"

Install with Database Support

# PostgreSQL
pip install streamlit-app-generator[postgresql]

# MySQL
pip install streamlit-app-generator[mysql]

# MongoDB
pip install streamlit-app-generator[mongodb]

# Redis
pip install streamlit-app-generator[redis]

# Oracle
pip install streamlit-app-generator[oracle]

# All databases
pip install streamlit-app-generator[all-databases]

Quick Start

Interactive Mode

streamlit-app-generator create my_app --interactive

With Specific Options

streamlit-app-generator create my_app \
    --database postgresql \
    --auth modern \
    --pages home,dashboard,settings

Using Python API

from streamlit_app_generator import AppGenerator

generator = AppGenerator(
    name="my_awesome_app",
    database="postgresql",
    auth_style="modern",
    pages=["home", "dashboard", "analytics", "settings"],
    theme="dark",
    enable_multipage=True
)

generator.generate()

Usage Examples

Create a Basic App

streamlit-app-generator create my_app

This creates a minimal Streamlit app with:

  • Basic authentication
  • SQLite database
  • Home page
  • Default theme

Create a Full-Featured App

streamlit-app-generator create my_app \
    --database postgresql \
    --auth modern \
    --theme dark \
    --pages home,dashboard,analytics,settings

Add Components to Existing Project

cd my_app
streamlit-app-generator add-database mysql
streamlit-app-generator add-page analytics

Generated Project Structure

my_app/
โ”œโ”€โ”€ .streamlit/
โ”‚   โ”œโ”€โ”€ config.toml
โ”‚   โ””โ”€โ”€ secrets.toml
โ”œโ”€โ”€ pages/
โ”‚   โ”œโ”€โ”€ 1_๐Ÿ _Home.py
โ”‚   โ”œโ”€โ”€ 2_๐Ÿ“Š_Dashboard.py
โ”‚   โ””โ”€โ”€ 3_โš™๏ธ_Settings.py
โ”œโ”€โ”€ auth/
โ”‚   โ”œโ”€โ”€ __init__.py
โ”‚   โ”œโ”€โ”€ login.py
โ”‚   โ””โ”€โ”€ session.py
โ”œโ”€โ”€ database/
โ”‚   โ”œโ”€โ”€ __init__.py
โ”‚   โ”œโ”€โ”€ connection.py
โ”‚   โ””โ”€โ”€ models.py
โ”œโ”€โ”€ utils/
โ”‚   โ”œโ”€โ”€ __init__.py
โ”‚   โ””โ”€โ”€ helpers.py
โ”œโ”€โ”€ app.py
โ”œโ”€โ”€ requirements.txt
โ”œโ”€โ”€ .env.example
โ”œโ”€โ”€ .gitignore
โ””โ”€โ”€ README.md

Authentication Styles

Basic

Simple and functional authentication with username/password.

Modern

Beautiful UI with gradients, animations, and modern design.

Minimal

Clean and minimalist design focused on simplicity.

Database Support

PostgreSQL

Full support with SQLAlchemy ORM, connection pooling, and migrations.

MySQL

Complete MySQL integration with connection management.

SQLite

Lightweight embedded database, perfect for prototyping.

MongoDB

NoSQL database support with pymongo.

Redis

In-memory data structure store for caching and sessions.

Documentation

For Developers

Development

Setup Development Environment

git clone https://github.com/leandrodalcortivo/streamlit-app-generator.git
cd streamlit-app-generator
pip install -e ".[dev]"
pre-commit install

Run Tests

pytest
pytest --cov=streamlit_app_generator

Code Quality

# Format code
black .
isort .

# Lint
flake8 .
mypy .

Using Makefile

make install       # Install dependencies
make test          # Run tests
make format        # Format code
make lint          # Run linters
make clean         # Clean build artifacts

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Roadmap

  • Support for more authentication providers (OAuth, SAML)
  • GraphQL API template
  • Docker deployment templates
  • CI/CD pipeline generator
  • Admin dashboard template
  • Email integration
  • File upload/download components
  • Data visualization templates

Support the Project

If you find this project useful and want to support its development, consider making a contribution!

PIX Donation (Brazil)

You can support the developer via PIX:

Email PIX: lmdcorti@gmail.com

Your support helps maintain and improve this project with new features and updates!

License

MIT License - Copyright (c) 2024 Leandro Meyer

Author

Leandro Meyer

Acknowledgments


โญ If you find this project useful, please consider giving it a star on GitHub!

๐Ÿ’– Support via PIX: lmdcorti@gmail.com

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

streamlit_app_generator-0.1.0.tar.gz (29.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

streamlit_app_generator-0.1.0-py3-none-any.whl (32.7 kB view details)

Uploaded Python 3

File details

Details for the file streamlit_app_generator-0.1.0.tar.gz.

File metadata

  • Download URL: streamlit_app_generator-0.1.0.tar.gz
  • Upload date:
  • Size: 29.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.5

File hashes

Hashes for streamlit_app_generator-0.1.0.tar.gz
Algorithm Hash digest
SHA256 7da629510f0ccaf9f78b7ddd95bdcbd550c8af4473f1a33f468ef7370be82ac1
MD5 18489e90eaadee21e4d0e89b0edc6dd9
BLAKE2b-256 6325a8f2bb0c50519133a4c3766566b4c3290bdb56daf6bc223aa9f76de9c2ea

See more details on using hashes here.

File details

Details for the file streamlit_app_generator-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for streamlit_app_generator-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a43918e15dbaa099f000911c8f902bd3ea412293b88a056c8b2ae10b925ce456
MD5 472842e100c04ba5ba4c5f618a78e52b
BLAKE2b-256 db80f8470ad85d5c588b474d1035d9437e59ece9d720a572413ee143817ee77a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page