Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#24-backend-imp-crud-for-users-model #109

Merged
merged 36 commits into from
Mar 22, 2024
Merged
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
45e6848
#24-backend: Put first fast-api crud
radthenone Jan 23, 2024
f405b37
update branch with dev
radthenone Jan 30, 2024
dbddb2f
#24-backend-imp-crud-24-backend-imp-crud-feature-auth-repo-changes: r…
radthenone Jan 30, 2024
b0f949a
Merge branch 'dev' of https://github.com/bh-coders/trip-planer into 2…
radthenone Feb 1, 2024
41dc684
24-backend-imp-crud-for-users-model-feature-new-develop-docker-compos…
radthenone Feb 2, 2024
8fa58e2
24-backend-imp-crud-feature-create-profile: merge with 24-backend-imp…
radthenone Feb 2, 2024
47e2efc
24-backend-imp-crud-feature-create-profile: separate auth and user, c…
radthenone Feb 2, 2024
c1f31b3
24-backend-imp-crud-feature-create-profile: delete auth old files
radthenone Feb 2, 2024
cd97bbe
24-backend-imp-crud-feature-create-profile: change some global except…
radthenone Feb 2, 2024
903ff27
24-backend-imp-crud-feature-create-profile: add dev build extra
radthenone Feb 2, 2024
9780dd0
24-backend-imp-crud-feature-create-profile: rebuild all models
radthenone Feb 8, 2024
2397a47
24-backend-imp-crud-feature-create-profile: merge with dev
radthenone Feb 8, 2024
eb355cd
24-backend-imp-crud-feature-create-profile: merge with 24-backend-imp…
radthenone Feb 8, 2024
a69e289
24-backend-imp-crud-feature-create-profile: push users image to storage
radthenone Feb 8, 2024
29f3454
24-backend-imp-crud-feature-create-profile: technic push to refactor …
radthenone Feb 8, 2024
5cca67a
24-backend-imp-24-backend-imp-crud-for-users-model: add develop docke…
radthenone Feb 11, 2024
66a68e1
24-backend-imp-24-backend-imp-crud-for-users-model: add redis cache p…
radthenone Feb 15, 2024
59dfa81
24-backend-imp-24-backend-imp-crud-for-users-model: create events for…
radthenone Feb 24, 2024
2878edd
24-backend-imp-crud-for-users-model: Recreate system to navigate pub/…
radthenone Feb 29, 2024
9fdc082
24-backend-imp-crud-for-users-model: Correct endpoints in user servic…
radthenone Feb 29, 2024
ad25b0f
24-backend-imp-crud-for-users-model: Merge conflicts resolved
radthenone Feb 29, 2024
83b57f1
24-backend-imp-crud-for-users-model: Correct gh actions docker to dev…
radthenone Feb 29, 2024
bb1d76f
24-backend-imp-crud-for-users-model: first code review corrections
radthenone Mar 6, 2024
3204ec0
24-backend-imp-crud-for-users-model: second code review corrections
radthenone Mar 8, 2024
ab39d13
24-backend-imp-crud-for-users-model: remove image from profile_servic…
radthenone Mar 8, 2024
a5d4c79
224-backend-imp-crud-for-users-model: add schema to names
radthenone Mar 9, 2024
333380d
224-backend-imp-crud-for-users-model: removed all image from users/pr…
radthenone Mar 9, 2024
94226b5
224-backend-imp-crud-for-users-model: update from dev branch
radthenone Mar 9, 2024
783c7f2
224-backend-imp-crud-for-users-model: remove delete profile because u…
radthenone Mar 9, 2024
f00a1bc
224-backend-imp-crud-for-users-model: cleanup
radthenone Mar 9, 2024
a8e27dd
Merge branch 'dev' of https://github.com/bh-coders/trip-planer into 2…
radthenone Mar 11, 2024
3e4f3ec
224-backend-imp-crud-for-users-model: returned read_version docs, rem…
radthenone Mar 18, 2024
3a02dc0
24-backend-imp-crud-for-users-model: returned read_version docs, remo…
radthenone Mar 18, 2024
d5f60a1
Merge remote-tracking branch 'origin/24-backend-imp-crud-for-users-mo…
radthenone Mar 18, 2024
ebd1dfd
#24-backend-imp-crud-for-users-model: returned read_version docs, rem…
radthenone Mar 18, 2024
ff4122b
Merge remote-tracking branch 'origin/24-backend-imp-crud-for-users-mo…
radthenone Mar 18, 2024
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
46 changes: 46 additions & 0 deletions README.DEV.md
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 ./backend/src/run_app.py
````

16 changes: 16 additions & 0 deletions backend/docker/fastapi/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM python:3.11

WORKDIR /app
ADD . /app

ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONBUFFERED 1

COPY requirements.txt .


RUN pip install --no-cache-dir -r requirements.txt

EXPOSE 8000

CMD ["uvicorn", "src.main:app", "--host", "0.0.0.0", "--reload", "--port", "8000"]
13 changes: 13 additions & 0 deletions backend/docker/redis/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM redis:7.2

WORKDIR /redis

COPY redis.conf /usr/local/etc/redis/redis.conf

COPY init.sh ./

RUN chmod +x ./init.sh

EXPOSE 6379

CMD ["./init.sh"]
22 changes: 22 additions & 0 deletions backend/docker/redis/init.sh
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 --loglevel warning --appendonly yes --requirepass ${REDIS_PASSWORD} --save 10 1 --maxmemory 100mb --bind 0.0.0.0

echo "Redis server started"

Loading