Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
19e43fb
initial configs
alexandrejastrow Mar 22, 2022
52008ad
initial configs.
alexandrejastrow Mar 22, 2022
b9363d9
requirements.txt
alexandrejastrow Mar 22, 2022
5051dde
add postgres connection
alexandrejastrow Mar 22, 2022
df06dc4
add function provider that saves xml files
alexandrejastrow Mar 22, 2022
5cbf01e
static folder and templates folder
alexandrejastrow Mar 22, 2022
c860460
add uploadfiles route
alexandrejastrow Mar 22, 2022
63bcbb3
update gitignore, and poetry files
alexandrejastrow Mar 22, 2022
308537f
create a models of person, NFe and address
alexandrejastrow Mar 23, 2022
39edc41
capture data of xml doc
alexandrejastrow Mar 23, 2022
606aacd
del services
alexandrejastrow Mar 23, 2022
85755e4
add __init__.py
alexandrejastrow Mar 23, 2022
23a0014
add __init__.py
alexandrejastrow Mar 23, 2022
f04fdfe
add __init__.py
alexandrejastrow Mar 23, 2022
f942cc2
rafatore database and models
alexandrejastrow Mar 23, 2022
f8c71f5
update requirements.txt
alexandrejastrow Mar 23, 2022
3be2b18
update procfile
alexandrejastrow Mar 23, 2022
a220fa8
update procfile
alexandrejastrow Mar 23, 2022
1e24d7f
update procfile
alexandrejastrow Mar 23, 2022
dcf3888
update procfile
alexandrejastrow Mar 23, 2022
2e92dd6
update save_xml
alexandrejastrow Mar 24, 2022
83b18e2
update save_xml
alexandrejastrow Mar 24, 2022
83622b9
update static
alexandrejastrow Mar 24, 2022
ea21a06
update paths
alexandrejastrow Mar 24, 2022
04755e9
update paths
alexandrejastrow Mar 24, 2022
7b5f0ec
update paths
alexandrejastrow Mar 24, 2022
fb78bfb
update paths
alexandrejastrow Mar 24, 2022
9242576
update paths
alexandrejastrow Mar 24, 2022
4e39db5
update paths
alexandrejastrow Mar 24, 2022
e9bf1aa
make it better
alexandrejastrow Mar 24, 2022
bac49c3
add migration sistem with alembic
alexandrejastrow Mar 24, 2022
6da33be
save data in databases finish
alexandrejastrow Mar 24, 2022
482622d
create route xml by id NFe
alexandrejastrow Mar 24, 2022
6c21a51
update settings
alexandrejastrow Mar 24, 2022
9c3f9b1
create a templating of send files
alexandrejastrow Mar 24, 2022
e800a96
refining the templates
alexandrejastrow Mar 25, 2022
445721c
update runtime.txt
alexandrejastrow Mar 25, 2022
f79e83e
Url
alexandrejastrow Mar 25, 2022
a9b5ea0
Route file
alexandrejastrow Mar 25, 2022
88b992b
Route
alexandrejastrow Mar 25, 2022
9b1376a
update main.py
alexandrejastrow Mar 25, 2022
cc7c616
update update tamplate home
alexandrejastrow Mar 26, 2022
3b4c13c
Merge branch 'main' of github.com:alexandrejastrow/venhapararecomb in…
alexandrejastrow Mar 26, 2022
a9a714f
chage database config
alexandrejastrow Mar 26, 2022
c319ab1
add class body in base.html
alexandrejastrow Mar 26, 2022
491b7a4
dockerfile and docker-compose config finish
alexandrejastrow Mar 26, 2022
4c2544a
finish project
alexandrejastrow Mar 26, 2022
564dd77
update env settings
alexandrejastrow Mar 26, 2022
99d45ba
add folder images
alexandrejastrow Mar 26, 2022
cf60487
Delete images directory
alexandrejastrow Mar 26, 2022
56922b7
Add files via upload
alexandrejastrow Mar 26, 2022
cd92f91
update readme
alexandrejastrow Mar 26, 2022
8938d6d
Update README.md
alexandrejastrow Mar 26, 2022
4e2338c
Update README.md
alexandrejastrow Apr 11, 2022
2b39641
Update README.md
alexandrejastrow Apr 19, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.venv
.pytest_cache
9 changes: 9 additions & 0 deletions .envExemple
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#database envs
DATABASE_URL=""
DATABASE_URL_DOCKER=""

#app
APP_NAME=""
DEV=""
APP_DOCKER_RUN=""
APP_TEST=""
162 changes: 162 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/

# PyCharm
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/

requisitos_do_sistema

documento de requisitos

/data

.vscode

/venhapararecomb/static/xmlDocs/*
21 changes: 21 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
FROM python:3.10 as requirements-stage

WORKDIR /tmp

RUN pip install poetry

COPY ./pyproject.toml ./poetry.lock* /tmp/

RUN poetry export -f requirements.txt --output requirements.txt --without-hashes

FROM python:3.10

WORKDIR /venhapararecomb

COPY --from=requirements-stage /tmp/requirements.txt /venhapararecomb/requirements.txt

RUN pip install --no-cache-dir --upgrade -r /venhapararecomb/requirements.txt

COPY . /venhapararecomb

CMD ["uvicorn", "app.main:app", "--host=0.0.0.0", "--port=8000", "--reload"]
11 changes: 0 additions & 11 deletions NFe-002-3103.xml

This file was deleted.

1 change: 1 addition & 0 deletions Procfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
web: uvicorn app.main:app --host=0.0.0.0 --port=${PORT:-8000}
65 changes: 65 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,65 @@

<h1 align="center"> Projeto: Venha para Recomb</h1>

## Preview
![Exemple](https://github.com/alexandrejastrow/venhapararecomb/blob/main/images/exemple.gif)

## Badges
![Python](https://img.shields.io/badge/python-3670A0?style=for-the-badge&logo=python&logoColor=ffdd54)
![FastAPI](https://img.shields.io/badge/FastAPI-005571?style=for-the-badge&logo=fastapi)
![Docker](https://img.shields.io/badge/docker-%230db7ed.svg?style=for-the-badge&logo=docker&logoColor=white)
![Postgres](https://img.shields.io/badge/postgres-%23316192.svg?style=for-the-badge&logo=postgresql&logoColor=white)
![Heroku](https://img.shields.io/badge/heroku-%23430098.svg?style=for-the-badge&logo=heroku&logoColor=white)
![Bootstrap](https://img.shields.io/badge/bootstrap-%23563D7C.svg?style=for-the-badge&logo=bootstrap&logoColor=white)




## Índice

* [Preview](#preview)
* [Badges](#badges)
* [Índice](#índice)
* [Desafio](#desafio)
* [Configuração](#configuração)
* [Status do Projeto](#status-do-Projeto)
* [Tecnologias Ultilizadas](#tecnologias-ultilizadas)
* [Pessoas Desenvolvedoras do Projeto](#pessoas-desenvolvedoras)


## Status do Projeto

No momento o projeto se encontra finalizado, podendo no futuro ter alguma adição de funcionalidades.

![Badge Finalizado](https://img.shields.io/badge/Venha%20para%20Recomb-Finalizado-green)

## ⚙ Configuração

1- Para baixar o projeto:
> git clone https://github.com/alexandrejastrow/venhapararecomb.git

2- Variáveis de ambiente:
> Crie um arquivo .env e use o .envExemple como base

3- Para iniciar a aplicação:
> docker-compose up

## ✔️ Tecnologias Ultilizadas

- ``Python 3.10``
- ``FastAPI``
- ``Postgres``
- ``SQLAlchemy``
- ``Alembic``
- ``Jinja2``
- ``Docker``
- ``docker-compose``
- ``Bootstrap``
- ``HTML5``
- ``CSS3``
#

## Desafio
# Venha para Recomb

O desafio é desenvolver um programa que permita realizar as seguintes buscas:
Expand Down Expand Up @@ -60,3 +122,6 @@ O candidato será desclassifiado nas seguintes situações:



## Pessoas Desenvolvedoras do Projeto

[<img src="https://avatars.githubusercontent.com/u/52933958?v=4" width=115><br><sub>Alexandre Jastrow da Cruz</sub>](https://github.com/alexandrejastrow)
101 changes: 101 additions & 0 deletions alembic.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
# A generic, single database configuration.

[alembic]
# path to migration scripts
script_location = app/alembic

# template used to generate migration files
# file_template = %%(rev)s_%%(slug)s

# sys.path path, will be prepended to sys.path if present.
# defaults to the current working directory.
prepend_sys_path = .

# timezone to use when rendering the date within the migration file
# as well as the filename.
# If specified, requires the python-dateutil library that can be
# installed by adding `alembic[tz]` to the pip requirements
# string value is passed to dateutil.tz.gettz()
# leave blank for localtime
# timezone =

# max length of characters to apply to the
# "slug" field
# truncate_slug_length = 40

# set to 'true' to run the environment during
# the 'revision' command, regardless of autogenerate
# revision_environment = false

# set to 'true' to allow .pyc and .pyo files without
# a source .py file to be detected as revisions in the
# versions/ directory
# sourceless = false

# version location specification; This defaults
# to app/alembic/versions. When using multiple version
# directories, initial revisions must be specified with --version-path.
# The path separator used here should be the separator specified by "version_path_separator" below.
# version_locations = %(here)s/bar:%(here)s/bat:app/alembic/versions

# version path separator; As mentioned above, this is the character used to split
# version_locations. The default within new alembic.ini files is "os", which uses os.pathsep.
# If this key is omitted entirely, it falls back to the legacy behavior of splitting on spaces and/or commas.
# Valid values for version_path_separator are:
#
# version_path_separator = :
# version_path_separator = ;
# version_path_separator = space
version_path_separator = os # Use os.pathsep. Default configuration used for new projects.

# the output encoding used when revision files
# are written from script.py.mako
# output_encoding = utf-8
sqlalchemy.url = postgresql://postgres:123456@localhost:5432/postgres


[post_write_hooks]
# post_write_hooks defines scripts or Python functions that are run
# on newly generated revision scripts. See the documentation for further
# detail and examples

# format using "black" - use the console_scripts runner, against the "black" entrypoint
# hooks = black
# black.type = console_scripts
# black.entrypoint = black
# black.options = -l 79 REVISION_SCRIPT_FILENAME

# Logging configuration
[loggers]
keys = root,sqlalchemy,alembic

[handlers]
keys = console

[formatters]
keys = generic

[logger_root]
level = WARN
handlers = console
qualname =

[logger_sqlalchemy]
level = WARN
handlers =
qualname = sqlalchemy.engine

[logger_alembic]
level = INFO
handlers =
qualname = alembic

[handler_console]
class = StreamHandler
args = (sys.stderr,)
level = NOTSET
formatter = generic

[formatter_generic]
format = %(levelname)-5.5s [%(name)s] %(message)s
datefmt = %H:%M:%S
1 change: 1 addition & 0 deletions app/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__version__ = '0.1.0'
1 change: 1 addition & 0 deletions app/alembic/README
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Generic single-database configuration.
Loading