Skip to content

Commit

Permalink
Merge pull request #604 from memeLab/develop
Browse files Browse the repository at this point in the history
Update master to v1.4.1
  • Loading branch information
pablodiegoss authored Feb 16, 2025
2 parents b04432e + 65c765b commit 12bef52
Show file tree
Hide file tree
Showing 101 changed files with 4,040 additions and 3,085 deletions.
22 changes: 16 additions & 6 deletions .envs/.example
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@
DJANGO_DEBUG=True
DEBUG_TOOLBAR=True
DJANGO_SECRET_KEY=change_me
DJANGO_ADMIN_URL=jandig-admin/
USE_MINIO=True
USE_GUNICORN=True

# Sentry Variables
DJANGO_ADMIN_URL=jandig-admin/
ENABLE_SENTRY=False
SENTRY_DSN=
SENTRY_ENVIRONMENT="local"
HEALTH_CHECK_URL=api/v1/status/
SENTRY_TRACES_SAMPLE_RATE=0.1

Expand All @@ -18,7 +20,6 @@ AWS_SECRET_ACCESS_KEY=minio123
MINIO_ROOT_USER=minio
MINIO_ROOT_PASSWORD=minio123
AWS_STORAGE_BUCKET_NAME=jandig-cdn
AWS_PRIVATE_STORAGE_BUCKET_NAME=jandig-private-cdn
AWS_S3_REGION_NAME=us-east-2
AWS_STATIC_LOCATION=static
MINIO_S3_ENDPOINT_URL=http://storage:9000
Expand All @@ -34,7 +35,16 @@ POSTGRES_USER=jandig
POSTGRES_PASSWORD=secret

# Email server variables
SMTP_SERVER=smtp.gmail.com
SMTP_PORT=587
[email protected]
JANDIG_EMAIL_PASSWORD=local_password
SMTP_SERVER=mailpit
SMTP_PORT=1025
SMTP_USE_TLS=False
SMTP_USE_SSL=False
SMTP_USER=
SMTP_PASSWORD=
SMTP_SENDER_MAIL="[email protected]"

# Recaptcha
RECAPTCHA_ENABLED=False
RECAPTCHA_PROJECT_ID=
RECAPTCHA_GCLOUD_API_KEY=
RECAPTCHA_SITE_KEY=
2 changes: 1 addition & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
## Repository Policy
All contributions to ARte must be tracked by an issue and at least one pull request. To start working on an issue you must fork ARte repository, create or pick an issue. Also check that there is no issue that already adheres to what you intend to post. To create your branch, follow the pattern: `feature/issueID-issue-title`. When you have did your first commit on your fork you have to create a pull request to ARte devel branch so we can see your work in progress. The pull request name must follow this pattern: `{STATE} {ISSUE NUMBER} - {ISSUE NAME}`. Where {STATE} is the state of the pull request, all pull requests must be created with [WIP] tag and when you think you resolved the issue change to [REVIEW]. Example of pull request name: [WIP] 435 - Refactor create method.
All contributions to ARte must be tracked by an issue and at least one pull request. To start working on an issue you must fork ARte repository and create or pick an issue. You should also check that there are no issues that already adheres to what you intend to post. To create your branch, follow the pattern: `feature/issueID-issue-title`. When you have done your first commit on your fork you have to create a pull request to ARte devel branch so we can see your work in progress. The pull request name must follow this pattern: `{STATE} {ISSUE NUMBER} - {ISSUE NAME}`, where {STATE} is the state of the pull request. All pull requests must be created with [WIP] tag, and when you think you resolved the issue, change to [REVIEW]. Example of pull request name: [WIP] 435 - Refactor create method.

## Coding Style
Make sure you are following our code style when submiting a pull request, following the style you make the process of reviewing your pull request better.
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ jobs:
steps:
- name: Check out code from Github
uses: actions/checkout@v3
- name: Set up Python 3.10
- name: Set up Python 3.13
uses: actions/setup-python@v4
with:
python-version: "3.10"
python-version: "3.13"
- name: Installing flake8
run: |
python -m pip install --upgrade pip
Expand Down Expand Up @@ -57,7 +57,7 @@ jobs:
run: |
cp .envs/.example .envs/.env
docker load -i docker_image_$GITHUB_SHA
docker-compose -f docker-compose.ci.yml -p jandigarte_$GITHUB_SHA up --no-build -d
docker compose -f docker-compose.ci.yml -p jandigarte_$GITHUB_SHA up --no-build -d
- name: Test migrations
run: |
docker exec jandigarte_${{ github.sha }}_django_1 sh -c "\
Expand All @@ -81,7 +81,7 @@ jobs:
run: |
cp .envs/.example .envs/.env
docker load -i docker_image_$GITHUB_SHA
docker-compose -f docker-compose.ci.yml -p jandigarte_$GITHUB_SHA up --no-build -d
docker compose -f docker-compose.ci.yml -p jandigarte_$GITHUB_SHA up --no-build -d
- name: Running users tests
run: |
docker exec jandigarte_${{ github.sha }}_django_1 sh -c "\
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Docker pipeline
on:
push:
branches:
- develop
- master

# TODO: Change environment and login envs
jobs:
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ src/ARte/config/__pycache__/
*.sqlite3

build/
static/
media/
src/data/certbot/
docker/node_modules/
node_modules/
Expand Down
1 change: 1 addition & 0 deletions .venv/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*
53 changes: 28 additions & 25 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,40 +1,31 @@
FROM python:3.10-slim-bullseye

RUN apt-get update && \
apt-get install -y --no-install-recommends \
gettext \
docutils-common \
curl \
wget

COPY ./pyproject.toml /pyproject.toml
COPY ./poetry.lock /poetry.lock

ENV PATH="$PATH:/root/.local/bin" \
POETRY_NO_INTERACTION=1 \
POETRY_VIRTUALENVS_CREATE=false \
POETRY_CACHE_DIR='/var/cache/pypoetry' \
FROM python:3.13.1-slim-bookworm
COPY --from=ghcr.io/astral-sh/uv:0.5.24 /uv /uvx /bin/

ENV PATH="$PATH:/home/jandig/.local/bin:/jandig/.venv/bin" \
TINI_VERSION=v0.19.0 \
# poetry:
POETRY_VERSION=1.3.1
UV_CACHE_DIR=/home/jandig/jandig/cache/uv

# Installing `poetry` package manager:
# https://github.com/python-poetry/poetry
RUN curl -sSL https://install.python-poetry.org | python3 - \
&& poetry --version
RUN apt-get update && \
apt-get install -y --no-install-recommends \
gettext \
docutils-common \
curl \
wget

RUN pip install --upgrade pip
RUN poetry install

RUN dpkgArch="$(dpkg --print-architecture | awk -F- '{ print $NF }')" \
&& wget "https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini-${dpkgArch}" -O /usr/local/bin/tini \
&& chmod +x /usr/local/bin/tini && tini --version


RUN mkdir -p /jandig/src /jandig/locale /jandig/docs /jandig/static /jandig/build
RUN mkdir -p /jandig/src /jandig/locale /jandig/docs /jandig/.venv /jandig/static /jandig/build /home/jandig/jandig/cache/uv

WORKDIR /jandig

COPY ./pyproject.toml /jandig/pyproject.toml
COPY ./uv.lock /jandig/uv.lock

COPY ./src/ /jandig/src/
COPY ./docs/ /jandig/docs/
COPY ./locale/ /jandig/locale/
Expand All @@ -43,7 +34,19 @@ COPY ./run.sh /jandig/run.sh
COPY ./etc/ /jandig/etc/


# Create group and user
RUN groupadd -g 1000 jandig && useradd -u 1000 -g 1000 -r -m -d /home/jandig jandig

# Change ownership of the directories to the new user and group
RUN chown -R jandig:jandig /jandig /home/jandig
RUN chmod 2775 /jandig /home/jandig

# Switch to the new user
USER jandig

RUN find . | grep -E "(__pycache__|\.pyc|\.pyo$)" | xargs rm -rf

RUN uv sync --frozen --no-dev
ENTRYPOINT ["tini", "--"]

ENTRYPOINT ["tini", "--"]
CMD [ "/jandig/run.sh" ]
26 changes: 15 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,33 @@ RUNNING_CONTAINER := $(shell docker compose ps --services --filter "status=runni

test:
@if [[ -n "${RUNNING_CONTAINER}" ]]; then \
docker compose exec django poetry run pytest src/core src/users; \
docker compose exec django uv run pytest src/core src/users src/blog; \
else \
docker compose run --rm django poetry run pytest src/core src/users;\
docker compose run --rm django uv run pytest src/core src/users src/blog;\
fi

test-ui:
docker compose up -d
poetry run pytest src/tests
uv run pytest src/tests

lint:
poetry run black --line-length=200 src
poetry run isort src
flake8:
poetry run flake8 --max-line-length=200 --exclude=*/migrations src
uv run ruff format src
uv run ruff check --fix src

check:
uv run ruff check

migrations:
poetry run python src/manage.py makemigrations
uv run python src/manage.py makemigrations

migrate:
poetry run python src/manage.py migrate
uv run python src/manage.py migrate

gen:
poetry run playwright codegen -b chromium --target python-pytest localhost:8000
uv run playwright codegen -b chromium --target python-pytest localhost:8000

translate_es:
poetry run inv i18n -l es_ES
docker compose exec django uv run inv i18n -l es_ES

translate_pt:
docker compose exec django uv run inv i18n -l pt_BR
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Jandig ARte
ARte is a Progressive Web App for augmented reality artworks. Our goal is to give a way for artists share their artworks in a simple and free way.

You can see galleries with pictures of [exhibitions](http://memelab.com.br/jandig/exposicoes/) created with Jandig.
You can see these galleries filled with pictures of [exhibitions](http://memelab.com.br/jandig/exposicoes/) created with Jandig.

## How it works
Jandig ARte uses image pattern detection to detect [augmented reality markers](https://www.kudan.eu/kudan-news/augmented-reality-fundamentals-markers/) through the camera of a device and render a content (currently a GIF) on the device screen, giving the impression that your device is like a virtual window that you are looking at.

![usage](https://user-images.githubusercontent.com/12930004/46251341-770de200-c426-11e8-9671-d870d1b9bd5d.jpg)

Jandig ARte is a Progressive Web App, which means you can open in every device with a browser and a camera. Also you can add Jandig ARte to your homescreen and it will run like a native app on your device.
Jandig ARte is a Progressive Web App, which means you can open in any device with a browser and a camera. You can also add Jandig ARte to your homescreen and it will run like a native app on your device.

### People
We are a small team based in Brazil :D talk to us on [Telegram](https://t.me/joinchat/HES_ShA6TMPP-aiHxH7thQ). Here's a list of some of the contributors for the development:
Expand Down Expand Up @@ -38,7 +38,7 @@ We are looking for artists (both illustrators and animators) to create great con
You can find interviews and references to Jandig in the press [here](http://memelab.com.br/jandig/clipping/).

## Get Started
To contribute to Jandig ARte it would be awesome if you read [Contributing](https://github.com/memeLab/ARte/blob/master/.github/CONTRIBUTING.md) and our [Code of conduct](https://github.com/memeLab/ARte/blob/master/.github/CODE_OF_CONDUCT.md). After a good read you are ready to move foward!
To contribute to Jandig ARte, it would be awesome if you read [Contributing](https://github.com/memeLab/ARte/blob/master/.github/CONTRIBUTING.md) and our [Code of conduct](https://github.com/memeLab/ARte/blob/master/.github/CODE_OF_CONDUCT.md). After a good read you are ready to move foward!

### Prerequisites
We use docker and docker-compose to ensure a consistent development environment and to make the deploy process as painless as possible, so all you need on your development tools to run Jandig ARte is [Docker](https://www.docker.com/) and [Docker-Compose](https://docs.docker.com/compose/overview/).
Expand Down Expand Up @@ -110,4 +110,8 @@ vim /etc/resolv.conf
```
nameserver 172.21.176.1
```
- Access the localhost using this IP (e.g.: 172.21.176.1:8000)
- Access the localhost using this IP (e.g.: 172.21.176.1:8000)

### Prototype

The Jandig platform count with a High-Fidelity Prototype which aims the development and documentation of improvements related to usability. To acess and contribute with the prototype, follow the instructions in [Prototype Documentation](/docs/prototype.md).
1 change: 0 additions & 1 deletion docker-compose.ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ services:
until (/usr/bin/mc config host add myminio $${MINIO_S3_ENDPOINT_URL} $${MINIO_ROOT_USER} $${MINIO_ROOT_PASSWORD}) do echo '...waiting...' && sleep 1; done;
/usr/bin/mc mb myminio/$${AWS_STORAGE_BUCKET_NAME};
/usr/bin/mc policy set download myminio/$${AWS_STORAGE_BUCKET_NAME};
/usr/bin/mc mb myminio/$${AWS_PRIVATE_STORAGE_BUCKET_NAME};
/usr/bin/mc admin user add myminio $${MINIO_USER_ACCESS_KEY} $${MINIO_USER_SECRET_KEY};
/usr/bin/mc admin policy set myminio readwrite user=$${MINIO_USER_ACCESS_KEY};
exit 0;
Expand Down
43 changes: 30 additions & 13 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,26 @@ services:
build:
dockerfile: Dockerfile
context: .
user: jandig
ports:
- 8000:8000
- 80:8000
volumes:
- ./src/:/jandig/src/
- ./docs/:/jandig/docs/
- ./etc/:/jandig/etc/
- ./locale/:/jandig/locale/
- ./run.sh:/jandig/run.sh
- ./tasks.py:/jandig/tasks.py
- ./:/jandig
- uv_cache:/home/jandig/cache/uv
env_file:
- .envs/.example
environment:
- USE_GUNICORN=True
- INSTALL_DEV=True
depends_on:
storage:
condition: service_started
createbuckets:
condition: service_started
mailpit:
condition: service_started
postgres:
condition: service_healthy
command: /jandig/run.sh

postgres:
image: postgres:15.4
Expand All @@ -42,33 +43,49 @@ services:
start_interval: 5s

storage:
image: minio/minio:latest
image: minio/minio:RELEASE.2022-09-17T00-09-45Z.hotfix.acb000d3a
ports:
- 9000:9000
- 9001:9001
volumes:
- media_data:/storage
env_file:
- .envs/.env
- .envs/.example
command: server /storage --console-address ":9001"

createbuckets:
image: minio/mc:RELEASE.2022-09-16T09-16-47Z
depends_on:
- storage
env_file:
- .envs/.env
- .envs/.example
entrypoint: >
/bin/sh -c "
until (/usr/bin/mc config host add myminio $${MINIO_S3_ENDPOINT_URL} $${MINIO_ROOT_USER} $${MINIO_ROOT_PASSWORD}) do echo '...waiting...' && sleep 1; done;
/usr/bin/mc mb myminio/$${AWS_STORAGE_BUCKET_NAME};
/usr/bin/mc policy set download myminio/$${AWS_STORAGE_BUCKET_NAME};
/usr/bin/mc mb myminio/$${AWS_PRIVATE_STORAGE_BUCKET_NAME};
/usr/bin/mc admin user add myminio $${MINIO_USER_ACCESS_KEY} $${MINIO_USER_SECRET_KEY};
/usr/bin/mc admin policy set myminio readwrite user=$${MINIO_USER_ACCESS_KEY};
exit 0;
"
mailpit:
image: axllent/mailpit
volumes:
- mailpit_data:/data
- ./etc/mailpit/:/self_signed/
ports:
- 8025:8025
- 1025:1025
environment:
MP_MAX_MESSAGES: 5000
MP_DATABASE: /data/mailpit.db
MP_SMTP_AUTH_ACCEPT_ANY: 1
MP_SMTP_AUTH_ALLOW_INSECURE: 1
MP_SMTP_TLS_CERT: /self_signed/mailpit_cert.pem
MP_SMTP_TLS_KEY: /self_signed/mailpit_key.pem

volumes:
postgres_data:
media_data:
media_data:
mailpit_data:
uv_cache:
Loading

0 comments on commit 12bef52

Please sign in to comment.