Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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 .bandit
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[bandit]
exclude = .venv
Binary file removed .coverage
Binary file not shown.
36 changes: 0 additions & 36 deletions .env

This file was deleted.

33 changes: 33 additions & 0 deletions .env.local
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
ENV=local

SERVER_NAME=localhost
HOSTNAME=localhost
DOMAIN=localhost
PROJECT_NAME=MongoTech
STACK_NAME=app.mongo.one
SERVER_HOST=http://localhost

SECRET_KEY=99d3b1f01aa639e4a76f4fc281fc834747a543720ba4c8a8648ba755aef9be7f
FIRST_SUPERUSER=admin@mongo.one
FIRST_SUPERUSER_PASSWORD=letmein

EMAIL_TEMPLATES_DIR=email-templates/build
EMAILS_FROM_EMAIL=info@mongo.one
EMAILS_FROM_NAME=MongoTech

SMTP_HOST=mongo.one
SMTP_USER=info
SMTP_PASSWORD=T3ip2info
SMTP_TLS=True
SMTP_PORT=25

SENTRY_DSN=https://d70ad76a32f44847b6d6bcb96b1862e3@o4504791095246848.ingest.sentry.io/4504898621734912

MONGO_USER=trader
MONGO_PASS=trader
MONGO_HOST=trader.uzfplyn.mongodb.net
MONGO_DB=mongo_local
MONGO_PORT=27017

CLIENT_ID=1010403550433-qneirdioe5pnujs5694mdrb5n5o1gqdn.apps.googleusercontent.com
CLIENT_SECRET=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
30 changes: 30 additions & 0 deletions .env.prod
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
ENV=production

SERVER_NAME=app.mongo.one
HOSTNAME=app.mongo.one
DOMAIN=app.mongo.one
PROJECT_NAME=MongoTech
STACK_NAME=app.mongo.one
SERVER_HOST=http://app.mongo.one

SECRET_KEY=99d3b1f01aa639e4a76f4fc281fc834747a543720ba4c8a8648ba755aef9be7f
FIRST_SUPERUSER=admin@mongo.one
FIRST_SUPERUSER_PASSWORD=letmein

EMAIL_TEMPLATES_DIR=email-templates/build
EMAILS_FROM_EMAIL=info@mongo.one
EMAILS_FROM_NAME=MongoTech

SMTP_HOST=mongo.one
SMTP_USER=info
SMTP_PASSWORD=T3ip2info
SMTP_TLS=True
SMTP_PORT=25

SENTRY_DSN=https://d70ad76a32f44847b6d6bcb96b1862e3@o4504791095246848.ingest.sentry.io/4504898621734912

MONGO_USER=trader
MONGO_PASS=trader
MONGO_HOST=trader.uzfplyn.mongodb.net
MONGO_DB=mongo_prod
MONGO_PORT=27017
30 changes: 30 additions & 0 deletions .env.stage
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
ENV=stage

SERVER_NAME=app-stage.mongo.one
HOSTNAME=app-stage.mongo.one
DOMAIN=app-stage.mongo.one
PROJECT_NAME=MongoTech
STACK_NAME=app.mongo.one
SERVER_HOST=http://app-stage.mongo.one

SECRET_KEY=99d3b1f01aa639e4a76f4fc281fc834747a543720ba4c8a8648ba755aef9be7f
FIRST_SUPERUSER=admin@mongo.one
FIRST_SUPERUSER_PASSWORD=letmein

EMAIL_TEMPLATES_DIR=email-templates/build
EMAILS_FROM_EMAIL=info@mongo.one
EMAILS_FROM_NAME=MongoTech

SMTP_HOST=mongo.one
SMTP_USER=info
SMTP_PASSWORD=T3ip2info
SMTP_TLS=True
SMTP_PORT=25

SENTRY_DSN=https://d70ad76a32f44847b6d6bcb96b1862e3@o4504791095246848.ingest.sentry.io/4504898621734912

MONGO_USER=trader
MONGO_PASS=trader
MONGO_HOST=trader.uzfplyn.mongodb.net
MONGO_DB=mongo_stage
MONGO_PORT=27017
2 changes: 2 additions & 0 deletions backend/app/.flake8 → .flake8
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
[flake8]
ignore = E226,E302,E41
max-line-length = 160
exclude = .venv
max-complexity = 10
2 changes: 1 addition & 1 deletion .github/workflows/bandit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ jobs:
- uses: jpetrucciani/bandit-check@master
with:
path: "./backend/app/app"
bandit_flags: '-x ./backend/app/app/tests'
bandit_flags: '-x ./backend/app/app/tests -iii -lll'
2 changes: 1 addition & 1 deletion .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
poetry install
- name: Build coverage percentage
run: |
echo COVERAGE=$(export $(cat .env|xargs);cd backend/app/app;../../../venv/bin/pytest --cache-clear --cov --cov-report term | grep "TOTAL" | awk '{print $4}') >> $GITHUB_ENV
echo COVERAGE=$(export $(cat .env.local|xargs);cd backend/app/app;../../../venv/bin/pytest --cache-clear --cov --cov-report term | grep "TOTAL" | awk '{print $6}') >> $GITHUB_ENV
- name: Create coverage Badge
uses: schneegans/dynamic-badges-action@v1.4.0
with:
Expand Down
8 changes: 5 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
.venv
.idea
.vscode
.mypy_cache
docker-stack.yml
frontent/node_modules
__pycache__
app.egg-info
.mypy_cache
.coverage
htmlcov
94 changes: 0 additions & 94 deletions .gitlab-ci.yml

This file was deleted.

30 changes: 30 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
repos:
- repo: local
hooks:
- id: black
name: black
entry: black .
language: system
pass_filenames: false

- repo: local
hooks:
- id: flake8
name: flake8
entry: flake8 . --max-line-length=120 --exclude=.venv
language: system
pass_filenames: false
- repo: local
hooks:
- id: isort
name: isort
entry: isort . --recursive --check-only --profile black
language: system
pass_filenames: false
- repo: local
hooks:
- id: mypy
name: mypy
entry: mypy .
language: system
pass_filenames: false
18 changes: 18 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python: Current File",
"type": "python",
"request": "launch",
"program": "/home/dg/web/mongotech/backend/app/app/main.py",
"cwd": "/home/dg/web/mongotech",
"console": "integratedTerminal",
"justMyCode": false,
"envFile": "${workspaceFolder}/.env.local"
}
]
}
8 changes: 8 additions & 0 deletions .vscode/mongotech.code-workspace
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"folders": [
{
"path": ".."
}
],
"settings": {}
}
6 changes: 6 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true,
"python.analysis.typeCheckingMode": "off",
"python.testing.cwd": "/home/dg/web/mongotech/backend/app/app"
}
2 changes: 1 addition & 1 deletion CHANGELOG
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Version 0.0.0
Version 0.0.1
15 changes: 4 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

* [Docker+Docker Compose](https://www.docker.com/ + https://docs.docker.com/compose/install/).
* [Git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git)
* [Python 3.9](https://www.python.org/downloads/release/python-3913/)
* [Python 3.10](https://www.python.org/downloads/release/python-3913/)
* pip install --upgrade pip

Later you will need:
Expand All @@ -24,13 +24,13 @@ You need add keys [here](https://gitlab.com/-/profile/keys) [instruction how to

## Install venv
`cd app` <br />
`python3.9 -m venv venv` <br />
`python3.10 -m venv venv` <br />
`source ./venv/bin/activate`

## Verfify python version

`python --version` <br />
`Python 3.9.12`
`Python 3.10`

## Run docker-compose
`docker-compose up -d`
Expand Down Expand Up @@ -62,13 +62,6 @@ In enviroment you need to define HOST = http://localhost:8001/api/v1 and pickup
`./test.sh`
This run all linters and pytest

## Deploy all stack in docker containers

For Intel cpu
`docker-compose -f docker-compose.dev.yml --env-file .env up --build -d`

For Arm64 cpu
`docker-compose -f docker-compose.dev64.yml --env-file .env up --build -d`

After up and running all containers, exec in backend container and run
`python3.9 app/initial_data.py`
`python app/initial_data.py`
2 changes: 0 additions & 2 deletions backend/.gitignore

This file was deleted.

Loading