-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* #24-backend: Put first fast-api crud * #24-backend-imp-crud-24-backend-imp-crud-feature-auth-repo-changes: renamed auth to user repo and files * 24-backend-imp-crud-for-users-model-feature-new-develop-docker-compose: add develop docker-compose to work out * 24-backend-imp-crud-feature-create-profile: separate auth and user, correct names, structure, imports * 24-backend-imp-crud-feature-create-profile: delete auth old files * 24-backend-imp-crud-feature-create-profile: change some global exceptions and correct verify_jwt exceptions, get_current_user exceptions and change return * 24-backend-imp-crud-feature-create-profile: add dev build extra * 24-backend-imp-crud-feature-create-profile: rebuild all models * 24-backend-imp-crud-feature-create-profile: push users image to storage * 24-backend-imp-crud-feature-create-profile: technic push to refactor all models with new redis pub/sub communicator * 24-backend-imp-24-backend-imp-crud-for-users-model: add develop docker and run app * 24-backend-imp-24-backend-imp-crud-for-users-model: add redis cache pub/sub for models * 24-backend-imp-crud-for-users-model: Recreate system to navigate pub/sub in classes * 24-backend-imp-crud-for-users-model: Correct endpoints in user service for change_password_view * 24-backend-imp-crud-for-users-model: Correct gh actions docker to dev docker-compose basic * 24-backend-imp-crud-for-users-model: first code review corrections * 24-backend-imp-crud-for-users-model: second code review corrections * 24-backend-imp-crud-for-users-model: remove image from profile_service.py * 224-backend-imp-crud-for-users-model: add schema to names * 224-backend-imp-crud-for-users-model: removed all image from users/profiles this created in media urls * 224-backend-imp-crud-for-users-model: remove delete profile because users do it with relations and profile image is not needed here * 224-backend-imp-crud-for-users-model: cleanup * 224-backend-imp-crud-for-users-model: returned read_version docs, removed abs from init cache handler, router remove unused import * 24-backend-imp-crud-for-users-model: returned read_version docs, removed abs from init cache handler, router remove unused import
- Loading branch information
1 parent
46ff705
commit 7b3a69d
Showing
79 changed files
with
2,072 additions
and
560 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
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,46 @@ | ||
# Develop app | ||
|
||
### enviroments: | ||
backend/.env | ||
|
||
````bash | ||
POSTGRES_HOST=postgres | ||
POSTGRES_USER=postgres | ||
POSTGRES_PASSWORD=triplane | ||
POSTGRES_DB=postgres-triplane | ||
POSTGRES_PORT=5432 | ||
|
||
SECRET_KEY=test | ||
ALGORITHM=HS256 | ||
ACCESS_TOKEN_EXPIRE_MINUTES=300 | ||
REFRESH_TOKEN_EXPIRE_DAYS=365 | ||
|
||
CORS_ORIGINS=http://localhost:8083 | ||
|
||
MINIO_HOST_URL=minio:9000 | ||
MINIO_ACCESS_KEY=superuser | ||
MINIO_SECRET_KEY=superuser | ||
MINIO_SECURE=False | ||
|
||
FASTAPI_HOST=localhost | ||
FASTAPI_PORT=8000 | ||
DEBUG=0 | ||
|
||
CACHE_STORAGE_HOST=redis | ||
CACHE_STORAGE_PORT=6379 | ||
CACHE_STORAGE_PASSWORD=redis | ||
CACHE_STORAGE_DB=1 | ||
CACHE_STORAGE_EXP=86400 | ||
```` | ||
|
||
### start app | ||
````bash | ||
docker-compose -f docker-compose.dev.yml up --build -d | ||
```` | ||
|
||
### debug | ||
you can use: | ||
````bash | ||
python ./web/src/run_app.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
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,5 +1,5 @@ | ||
```bash | ||
cd backend | ||
cd web | ||
``` | ||
|
||
```bash | ||
|
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,11 @@ | ||
FROM redis:7.2 | ||
|
||
WORKDIR /redis | ||
|
||
COPY init.sh ./ | ||
|
||
RUN chmod +x ./init.sh | ||
|
||
EXPOSE 6379 | ||
|
||
CMD ["./init.sh"] |
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,22 @@ | ||
#!/bin/bash | ||
# if any of the commands in your code fails for any reason, the entire script fails | ||
set -o errexit | ||
# fail exit if one of your pipe command fails | ||
set -o pipefail | ||
# exits if any of your variables is not set | ||
set -o nounset | ||
|
||
echo "Add sysctl vm.overcommit_memory=1" | ||
echo "1" > /proc/sys/vm/overcommit_memory | ||
|
||
export REDIS_PASSWORD="${CACHE_STORAGE_PASSWORD}" | ||
|
||
echo "Starting redis server..." | ||
|
||
echo "Redis server is up" | ||
|
||
# Start redis server | ||
redis-server --bind 0.0.0.0 --requirepass "${REDIS_PASSWORD}" --maxmemory 256mb --maxmemory-policy allkeys-lru --appendonly yes | ||
|
||
echo "Redis server started" | ||
|
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,16 @@ | ||
FROM python:3.11 AS base | ||
|
||
WORKDIR /app | ||
ADD . /app | ||
|
||
ENV PYTHONDONTWRITEBYTECODE 1 | ||
ENV PYTHONBUFFERED 1 | ||
|
||
COPY requirements.txt . | ||
|
||
RUN pip install --no-cache-dir -r requirements.txt | ||
|
||
COPY ./docker/web/backend.sh /backend.sh | ||
RUN sed -i 's/\r$//g' /backend.sh && chmod +x /backend.sh | ||
|
||
ENTRYPOINT ["/backend.sh"] |
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,16 @@ | ||
#!/bin/bash | ||
# if any of the commands in your code fails for any reason, the entire script fails | ||
set -o errexit | ||
# fail exit if one of your pipe command fails | ||
set -o pipefail | ||
# exits if any of your variables is not set | ||
set -o nounset | ||
|
||
export FASTAPI_HOST=$FASTAPI_HOST | ||
export FASTAPI_PORT=$FASTAPI_PORT | ||
|
||
if [ "${FASTAPI_HOST}" = "localhost" ]; then | ||
export FASTAPI_HOST=0.0.0.0 | ||
fi | ||
|
||
uvicorn src.main:app --host "${FASTAPI_HOST}" --port "${FASTAPI_PORT}" --reload |
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
Binary file not shown.
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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
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
Oops, something went wrong.