Code Monkey home page Code Monkey logo

users_crud_api_python's Introduction

Users Crud Api Python

A really simple CRUD GraphQL API based on Docker and Python.

Note: In develop mode and running locally the docs are available at this url


Project Commands

Note: Before running any of these commands be sure that your CWD is users_crud_api_python directory.

Clean Python Cache Using Grep

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

Install Python Dependencies

poetry install

Change Poetry Venv Version To 3.11

poetry env use 3.11

Export The Dev And App Dependencies With Poetry

poetry export --without-hashes --format=requirements.txt > requirements.app.txt
poetry export --without-hashes --only dev --format=requirements.txt > requirements.dev.txt

Update The Depedencies With Poetry

Note: Before running this command you need to install the dev dependencies.

poetry update

Check The Depedencies With Poetry

Note: Before running this command you need to install the dev dependencies.

poetry show
poetry show -l

Format The Code Using Black

Note: Before running this command you need to install the dev dependencies.

black ./src --line-length=150

Lint The Code Using Flake8

Note: Before running this command you need to install the dev dependencies.

flake8 ./src --max-line-length=150

Check Static Types Using Mypy

Note: Before running this command you need to install the dev dependencies.

mypy --explicit-package-bases ./src

Run On Development Mode

ENVIRONMENT_MODE=development python src/main.py

Run On Testing Mode

ENVIRONMENT_MODE=testing python src/main.py

Run On Production Mode

ENVIRONMENT_MODE=production python src/main.py

Docker Project Commands

Note: Before running any of these commands be sure that your CWD is users_crud_api_python directory.

Docker App Building Without Cache

docker build --no-cache --tag ghcr.io/joseesco24/users_crud_api_python:latest .

Docker App Building With Cache

docker build --tag ghcr.io/joseesco24/users_crud_api_python:latest .

Docker App Deployment Without Detach

docker run --rm --name users_crud_api_python_app --publish 10048:10048 --env-file ./.env --env ENVIRONMENT_MODE=production ghcr.io/joseesco24/users_crud_api_python:latest

Docker App Deployment With Detach

docker run --detach --rm --name users_crud_api_python_app --publish 10048:10048 --env-file ./.env --env ENVIRONMENT_MODE=production ghcr.io/joseesco24/users_crud_api_python:latest

Docker Access To The Container Terminal

docker exec -it users_crud_api_python_app /bin/bash

Docker Killing Containerized App

docker kill users_crud_api_python_app

Docker Login Into Github Container Registry

docker login -u joseesco24 -p < authentication token > ghcr.io

Docker Push The Image To Github Container Registry

docker push ghcr.io/joseesco24/users_crud_api_python:latest

Docker Pull The Image From Github Container Registry

docker pull ghcr.io/joseesco24/users_crud_api_python:latest

Docker Compose Project Commands

Note: Before running any of these commands be sure that your CWD is users_crud_api_python directory.

Docker Compose Build Image Using Compose File

docker-compose -f compose.build.yaml build

Docker Compose Start Dbs Services Using Compose File

docker-compose -f compose.databases.yaml up

Docker Compose Stop Dbs Services Using Compose File

docker-compose -f compose.databases.yaml down

Docker Compose Start Project Using Compose File

docker-compose -f compose.project.yaml up

Docker Compose Stop Project Using Compose File

docker-compose -f compose.project.yaml down

users_crud_api_python's People

Contributors

joseesco24 avatar

Stargazers

 avatar

Watchers

 avatar  avatar

users_crud_api_python's Issues

add a new logging middleware

the idea is to use this middleware to store all the needed data for future logs in logger based object and to propagate it across all the app modules in order to have a more rich and custom traceback

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.