-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
82 changed files
with
1,187 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
.idea | ||
|
||
/animals_photo/ | ||
/node_modules/ | ||
/frontend/node_modules/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
#!/bin/sh | ||
. "$(dirname "$0")/_/husky.sh" | ||
|
||
yarn precommit | ||
#!/usr/bin/env sh | ||
. "$(dirname -- "$0")/_/husky.sh" | ||
|
||
npm test | ||
yarn precommit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
3.11.6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# shelterpaws | ||
A system for animal shelters, providing an easy and free way for shelter owners to display their pets, help them find new homes, and fundraise. | ||
|
||
- [board to work on](https://github.com/orgs/qase-tms/projects/5/views/1) | ||
- [meta page](https://meta.shelterpaws.org) | ||
- [website](https://shelterpaws.org) | ||
|
||
## Режим разработки | ||
|
||
Перед тем, как закоммитить изменения, необходимо установить зависимости: | ||
|
||
``` | ||
npx husky-init && yarn install | ||
``` | ||
|
||
### Возможные проблемы | ||
|
||
#### Found incompatible module. | ||
|
||
Для успешной установки всех зависимостей желательно использовать **node >=18.12.0**. Для переключения между версиями node можно воспользоваться [nvm](https://github.com/nvm-sh/nvm). | ||
|
||
#### fatal: cannot exec '.husky/pre-commit': No such file or directory | ||
|
||
1. Скопировать содержимое файла `.husky/pre-commit`: | ||
|
||
``` | ||
#!/bin/sh | ||
. "$(dirname "$0")/_/husky.sh" | ||
yarn precommit | ||
``` | ||
|
||
2. Удалить файл `.husky/pre-commit` | ||
|
||
3. Создать пустой `.husky/pre-commit` и вставить туда скопированный код. | ||
|
||
4. Запустить команду `npx husky install` | ||
|
||
5. Попробовать еще раз сделать коммит. | ||
|
||
Если данная инструкция не решила проблему, можно обойти проверку, используя флаг `--no-verify`: | ||
|
||
``` | ||
git commit -m 'commit name' --no-verify | ||
``` | ||
|
||
Перед тем, как закоммитить изменения с флагом `--no-verify`, рекомендуется запустить проверки вручную и исправить ошибки, если они есть: | ||
|
||
``` | ||
yarn stylelint | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.gitignore | ||
*_env* | ||
*.pyc | ||
**/.pytest_cache/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
3.11.6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
FROM python:3.11.6-alpine | ||
|
||
ARG SERVICE_NAME=backend | ||
|
||
ADD ./$SERVICE_NAME/poetry.lock ./$SERVICE_NAME/pyproject.toml ./ | ||
|
||
ENV PYTHONPATH=/ | ||
|
||
ENV PATH=/root/.poetry/bin:${PATH} | ||
RUN apk add --update --no-cache --virtual .tmp-build-deps \ | ||
gcc libc-dev linux-headers postgresql-dev \ | ||
&& apk add libffi-dev | ||
RUN pip install --upgrade pip | ||
RUN pip install poetry | ||
RUN poetry config virtualenvs.create false | ||
RUN poetry install --no-dev | ||
RUN poetry show | ||
|
||
COPY ./$SERVICE_NAME/ backend/ | ||
|
||
CMD ["python", "/backend/main.py"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
version: "3.3" | ||
services: | ||
backend: | ||
container_name: backend | ||
command: python3 /backend/main.py | ||
build: | ||
context: ../ | ||
dockerfile: ./backend/Dockerfile | ||
ports: | ||
- 8080:8080 | ||
volumes: | ||
- ./:/app | ||
- '/var/data/shelterpaws/animal_photo:/var/animal_photos' | ||
env_file: | ||
- .env | ||
|
||
psql: | ||
image: postgres:15.5 | ||
volumes: | ||
- './docker/database:/var/lib/psql' | ||
ports: | ||
- "5432:5432" | ||
env_file: | ||
- .env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
from fastapi.responses import HTMLResponse | ||
from backend.services.base_template_service import BaseTemplateService | ||
|
||
|
||
class AnimalTemplateService(BaseTemplateService): | ||
def __init__(self, request): | ||
super().__init__(request) | ||
|
||
@staticmethod | ||
def _complete_template_path(template_name: str): | ||
return f"pages/index/{template_name}" | ||
|
||
def get_index_template(self) -> HTMLResponse: | ||
return self.templates.TemplateResponse( | ||
name=self._complete_template_path("index.html"), | ||
context={"request": self.request} | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
from fastapi import Request | ||
from fastapi.templating import Jinja2Templates | ||
|
||
|
||
class BaseTemplateService: | ||
templates = Jinja2Templates(directory="./backend/templates") | ||
|
||
def __init__(self, request: Request): | ||
self.request = request |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.local.env |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Oops, something went wrong.