Coder Social home page Coder Social logo

likeinlife / memes Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 1022 KB

АПИ для загрузки/получения/редактирования мемов.

Makefile 1.26% Dockerfile 1.01% Python 95.85% Shell 0.88% Mako 1.01%
clean-architecture ddd dishka fastapi microservice minio poetry postgresql pydantic pytest python3 s3 sqlalchemy

memes's Introduction

Description

GitHub tag (latest SemVer) Ruff Mypy checked

АПИ для загрузки/получения/редактирования мемов.

Мем состоит из текста и картинки.

Картинки сохраняются в S3 хранилище.

Диаграмма

Запуск

  1. make dev-storages - запустить PostgreSQL, MinIO
  2. make dev-app - запустить приложения
  3. make down-all - закрыть приложения
  4. make down-storages-v - удалить volume хранилищ

Swagger

Swagger доступен по адресу http://localhost:8000/api/docs

Тестирование

  1. cd memes/public - перейти в тестируемую директорию
  2. poetry install --with test - установить зависимости для тестирования
  3. pytest - запустить тесты

Описание работы

Проект представляет собой два сервиса: PublicAPI и Gateway.

  • PublicAPI - публичное апи для действий с мемами.
  • Gateway - закрытое апи для взаимодействия с S3 хранилищем.

Приложения построены с оглядкой на чистую архитектуру.

В каждом выделены слои:

  • domain - домен
  • logic - бизнес-логика: use-cases, interactors (в Gateway отсутствует, т.к. нет необходимости)
  • infra - репозитории, сервисы
  • presentation - представление

В качестве DI-библиотеки применяется Dishka. Конфигурация описана в каждом проекте в пакете container

Время работы

Полное время работы над проектом составило 8 часов.

Стек

  • Python3.11
  • FastAPI
  • MinIO
  • PostgreSQL
  • Docker
  • SQLALchemy
  • alembic
  • dishka
  • pytest

Скриншоты

Скриншоты Swagger можно посмотреть в папке ./static/

memes's People

Contributors

likeinlife avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.