6 Commits
0.1.0 ... 0.1.1

Author SHA1 Message Date
cff6d9cc50 Roll to 0.1.1 2022-07-15 09:30:10 -07:00
2c4f98d567 Fix bottom padding 2022-07-15 09:29:10 -07:00
386341f977 Update Dockerfile 2022-07-15 07:17:03 -07:00
eb1d1e1dd3 Fix Code Styling 2022-07-14 17:17:11 -07:00
21ffc736bc Add Pre-Commit Hooks 2022-07-14 17:12:35 -07:00
e6e7c20479 Add Docker Compose and Quick Start 2022-07-14 17:09:13 -07:00
14 changed files with 108 additions and 39 deletions

30
.pre-commit-config.yaml Normal file
View File

@@ -0,0 +1,30 @@
repos:
- repo: https://github.com/asottile/pyupgrade
rev: v2.7.4
hooks:
- id: pyupgrade
args: [--py37-plus]
- repo: https://github.com/codespell-project/codespell
rev: v2.0.0
hooks:
- id: codespell
args:
- --ignore-words-list=sigl
- --skip="./.*,*.csv,*.json"
- --quiet-level=2
exclude_types: [csv, json]
- repo: https://gitlab.com/pycqa/flake8
rev: 3.8.4
hooks:
- id: flake8
additional_dependencies:
- flake8-docstrings==1.5.0
- pydocstyle==5.1.1
files: ^(sigl|tests)/.+\.py$
- repo: https://github.com/PyCQA/isort
rev: 5.5.3
hooks:
- id: isort

View File

@@ -41,5 +41,8 @@ RUN mkdir -p /var/lib/sigl \
USER sigl
EXPOSE 5151
ENTRYPOINT [ "/home/sigl/docker-entry.sh" ]
VOLUME [ "/var/lib/sigl" ]
CMD [ "sigl" ]
ENTRYPOINT [ "/home/sigl/docker-entry.sh" ]

View File

@@ -1,3 +1,22 @@
# Simple Grocery List (Sigl)
Simple Grocery List, or **Sigl** (pronounced "sigil") is a lightweight shopping list manager designed for shared grocery lists (or any other shopping list). Sigl is designed to be intuitive and flexible, emphasizing an ad-hoc approach to shopping lists rather than "recipe" based lists.
Simple Grocery List, or **Sigl** (pronounced "sigil") is a lightweight shopping list manager designed for shared grocery lists (or any other shopping list). Sigl is designed to be intuitive and flexible, emphasizing an ad-hoc approach to shopping lists rather than "recipe" based lists.
## Quick Start
Install [Docker](https://www.docker.com/) and
[Docker Compose](https://docs.docker.com/compose/install/) for your platform.
Then run the following commands to clone the Jade Tree repository and run a
local instance of Jade Tree on your machine. Note that the database migration
only has to be done once to set up a fresh database or to upgrade a database to
the latest schema.
```sh
$ git clone https://github.com/asymworks/sigl.git sigl
$ docker-compose -f sigl/docker-compose.yaml up -d
$ docker-compose -f sigl/docker-compose.yaml \
exec app /home/sigl/docker-entry.sh db upgrade
$ docker-compose -f sigl/docker-compose.yaml restart app
```
Then access the Sigl server at http://localhost:5151

18
docker-compose.yaml Normal file
View File

@@ -0,0 +1,18 @@
---
#
# Docker Compose File for Sigl Server
#
version: '3.7'
services:
app:
image: asymworks/sigl:latest
ports:
- 5151:5151
volumes:
- sigl_data:/var/lib/sigl
- ./docker/config.py:/home/sigl/config.py:ro
restart: always
volumes:
sigl_data:

View File

@@ -1,6 +1,6 @@
{
"name": "sigl",
"version": "0.1.0",
"version": "0.1.1",
"description": "Simple Grocery List",
"dependencies": {
"tailwindcss": "^3.1.6"

View File

@@ -1,6 +1,6 @@
[tool.poetry]
name = "sigl"
version = "0.1.0"
version = "0.1.1"
description = "Simple Grocery List"
authors = ["Jonathan Krauss <jkrauss@asymworks.com>"]
license = "BSD-3-Clause"

View File

@@ -8,15 +8,11 @@ Copyright (c) 2022 Asymworks, LLC. All Rights Reserved.
def init_shell(): # pragma: no cover
"""Initialize the Flask Shell Context."""
import datetime
import sqlalchemy as sa
from sigl.database import db
from sigl.domain.models import (
ListEntry,
Product,
ProductLocation,
ShoppingList,
)
from sigl.domain.models import ListEntry, Product, ProductLocation, ShoppingList
return {
# Imports

View File

@@ -4,27 +4,18 @@ Simple Grocery List (Sigl) | sigl.app
Copyright (c) 2022 Asymworks, LLC. All Rights Reserved.
"""
from sigl.domain.models import (
Product,
ProductLocation,
)
from sigl.domain.models import Product, ProductLocation
from sigl.domain.models.list import ListEntry, ShoppingList
from .globals import db
from .tables import (
list_entries,
lists,
product_locations,
products,
)
from .tables import list_entries, lists, product_locations, products
__all__ = ('init_orm', )
def init_orm():
"""Initialize the Sigl ORM."""
# # List Entries
# List Entries
db.mapper(ListEntry, list_entries, properties={
'product': db.relationship(
Product,

View File

@@ -5,7 +5,7 @@ Copyright (c) 2022 Asymworks, LLC. All Rights Reserved.
"""
from dataclasses import dataclass, field
from typing import List, TYPE_CHECKING
from typing import TYPE_CHECKING, List
from .mixins import NotesMixin, TimestampMixin

View File

@@ -9,6 +9,7 @@ from typing import List, Optional, Union
from sqlalchemy.orm import Session
from sigl.exc import DomainError, NotFoundError
from .models import ListEntry, Product, ProductLocation, ShoppingList
@@ -140,7 +141,7 @@ def list_stores(session: Session, id: Optional[int]) -> List[str]:
Product has locations are returned.
"""
if id is None:
return list(set([loc.store for loc in session.query(ProductLocation).all()]))
return list({loc.store for loc in session.query(ProductLocation).all()})
sList = list_by_id(session, id)
if not sList:

View File

@@ -52,7 +52,7 @@
<main class="max-w-3xl mx-auto bg-white md:border-l md:border-r border-b md:rounded-b border-gray-300">
{% block main %}{% endblock %}
</main>
<footer class="max-w-3xl mx-auto flex flex-col mt-1 px-2 text-xs text-gray-600">
<footer class="max-w-3xl mx-auto flex flex-col mt-1 mb-24 px-2 text-xs text-gray-600">
<p>Sigl | Simple Grocery List | Version {{ config['APP_VERSION'] }}</p>
<p>Copyright &copy;2022 Asymworks, LLC. All Rights Reserved.</p>
</footer>

View File

@@ -6,17 +6,32 @@ Copyright (c) 2022 Asymworks, LLC. All Rights Reserved.
from flask import (
Blueprint,
flash, jsonify, make_response, redirect, render_template, request, url_for
flash,
jsonify,
make_response,
redirect,
render_template,
request,
url_for,
)
from sigl.exc import DomainError, Error, NotFoundError
from sigl.database import db
from sigl.domain.service import (
list_entry_by_id, lists_all, list_by_id, list_create, list_delete,
list_update, list_addItem, list_deleteItem, list_editItem, list_stores,
list_deleteCrossedOff, list_entry_set_crossedOff,
list_addItem,
list_by_id,
list_create,
list_delete,
list_deleteCrossedOff,
list_deleteItem,
list_editItem,
list_entry_by_id,
list_entry_set_crossedOff,
list_stores,
list_update,
lists_all,
products_all,
)
from sigl.exc import DomainError, Error, NotFoundError
__all__ = ('bp', )

View File

@@ -4,23 +4,20 @@ Simple Grocery List (Sigl) | sigl.app
Copyright (c) 2022 Asymworks, LLC. All Rights Reserved.
"""
from flask import (
Blueprint,
flash, redirect, render_template, request, url_for
)
from flask import Blueprint, flash, redirect, render_template, request, url_for
from sigl.exc import Error, NotFoundError
from sigl.database import db
from sigl.domain.service import (
list_stores,
products_all,
product_addLocation,
product_by_id,
product_create,
product_delete,
product_update,
product_addLocation,
product_removeLocation,
product_update,
products_all,
)
from sigl.exc import Error, NotFoundError
__all__ = ('bp', )

View File

@@ -6,5 +6,4 @@ Copyright (c) 2022 Asymworks, LLC. All Rights Reserved.
from .factory import create_app
app = create_app()