A cookiecutter template for creating applications for Serra Vine.
- Flexible project structure supporting web and console applications
- Optional integration with Fibery and Dremio
- Docker-based development environment
- Pre-configured CI/CD with GitHub Actions
- Built-in testing infrastructure
- Modern Python development practices
- Python 3.11+
- Cookiecutter (
pip install cookiecutter
) - Docker and Docker Compose (for development)
- Access to Serra Vine's Dremio instance (if using Dremio integration)
# Latest version
cookiecutter gh:serraict/cookiecutter-vine-app
# Specific version
cookiecutter gh:serraict/cookiecutter-vine-app --checkout v1.0.0
You will be prompted for various configuration options:
project_name
: Your project's nameproject_slug
: A slugified version of your project name (auto-generated)project_description
: A brief description of your projectauthor_name
: Your nameauthor_email
: Your emailproject_type
: Choose between:web
: A web-based application using NiceGUIconsole
: A command-line applicationboth
: Both web and console interfaces
use_fibery
: Include Fibery integration (y/n)use_dremio
: Include Dremio integration (y/n)python_version
: Python version to use (defaults to 3.11)version
: Initial version number
The generated project will include:
your_project/
├── .github/ # GitHub Actions workflows
├── docs/ # Project documentation
├── src/ # Source code
│ └── your_project/
│ ├── __init__.py
│ ├── web/ # Web interface (if selected)
│ └── cli/ # Console interface (if selected)
├── tests/ # Test suite
├── docker-compose.yml # Development environment
├── Dockerfile # Application container
├── .env.example # Example environment configuration
└── pyproject.toml # Python project configuration
-
Copy
.env.example
to.env
:cp .env.example .env
-
Update the
.env
file with your specific configuration:- Set
<PROJECT>_DB_CONNECTION
with your Dremio connection string - Configure optional settings like SQL logging
- Update Fibery settings if using Fibery integration
- Set
If you selected Dremio integration during project creation:
- Ensure you have access to the Serra Vine Dremio instance
- Update your
.env
file with the correct Dremio connection string:<PROJECT>_DB_CONNECTION=dremio+flight://user:pass@localhost:32010/dremio?UseEncryption=false
- The Docker container will automatically connect to the
serra-vine
network to access Dremio - Test the connection by running the products command:
This will attempt to fetch products from Dremio, verifying the connection is working.
python -m your_project products
- Create and activate a virtual environment:
python -m venv venv source venv/bin/activate # On Unix # or .\venv\Scripts\activate # On Windows
- Install development dependencies:
pip install -r requirements-dev.txt
- Run tests:
pytest
- Start the development server:
The web interface will be available at http://localhost:8080
python -m your_project.__web__
-
Ensure the
serra-vine
network exists:docker network create serra-vine
-
Start the application:
docker-compose up --build
The application will be available at:
- Web UI: http://localhost:8080 (if web interface is enabled)
To contribute to this template:
-
Clone the repository:
git clone https://github.com/serraict/cookiecutter-vine-app.git cd cookiecutter-vine-app
-
Create a test project:
./scripts/generate_test_project_from_template.sh
-
Test Docker setup:
./scripts/test_generated_project_docker.sh
-
Test web interface:
./scripts/test_generated_project_web.sh
TBD.