Skip to content
Merged
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: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ LOG_LEVEL=DEBUG
JWT_SECRET_KEY=
JWT_ALGORITHM=HS256
JWT_EXPIRE_MINUTES=15
CORS_ALLOWED_HOSTS="http://localhost:8081"
CORS_ALLOWED_HOSTS="http://localhost:8081,http://localhost:8082"
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ It is a microservice for user administration and authenication, using JWT tokens
- Python 3.12+
- FastApi 0.124+

> [!IMPORTANT]
> It is necessary to complete the configuration file(.env), and create the PEM files and place them in the root folder

## Installing
1. Create a virtual environment
```bash
Expand Down Expand Up @@ -35,9 +38,9 @@ Use the private key file to extract the public key in PEM format
```bash
openssl rsa -in private_key.pem -pubout -out public_key.pem
```
5. Set configurations files (.env) for different purposes (mongodb, JWT, CORS, logs)
5. Set configuration file (.env)

The microservice uses mongoDB as its database, so the connection string and other configurations must be included in the configuration file
The microservice uses mongoDB as its database, so the connection string and other configurations (mongodb, JWT, CORS, logs) must be included

6. Run local development server
```bash
Expand All @@ -63,8 +66,5 @@ docker pull ghcr.io/ablogo/authfastapi:latest
docker run -p 8000:80 --env-file .env auth-service:latest
```

> [!IMPORTANT]
> It is necessary to complete the configuration file(.env), and create the PEM files and place them in the root folder

> [!NOTE]
> Since the project is used for learning, it does not strictly follow the concept of microservices, where each microservice should have its own realm of responsability
2 changes: 1 addition & 1 deletion src/dependency_injection/containers.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class Container(containers.DeclarativeContainer):
"src.routers.users_router",
"src.routers.admin.users_router",
"src.services.user_service",
"src.services.chat_service",
"src.services.login_service",
"src.services.jwt_service",
"src.routers.products_router"
])
Expand Down
5 changes: 2 additions & 3 deletions src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from dotenv import load_dotenv
import os

from src.routers import auth_router, products_router, users_router, chat_router
from src.routers import auth_router, products_router, users_router
from src.routers.admin import users_router as admin_user_router
from src.middlewares.jwt_middleware import JWTMiddleware
from src.middlewares.http_middleware import HttpMiddleware
Expand Down Expand Up @@ -34,14 +34,13 @@ async def shutdown():
allow_origins = origins,
allow_methods = ["*"],
allow_headers = ["*"])
app.add_middleware(HttpMiddleware)
#app.add_middleware(HttpMiddleware)
#app.add_middleware(JWTMiddleware, secret_key= SECRET_KEY, algorithm= ALGORITHM)

app.include_router(auth_router.router)
app.include_router(users_router.router)
app.include_router(products_router.router)
app.include_router(admin_user_router.router)
app.include_router(chat_router.router)

#Root route
@app.get("/")
Expand Down
20 changes: 0 additions & 20 deletions src/models/friends_model.py

This file was deleted.

25 changes: 0 additions & 25 deletions src/models/message_model.py

This file was deleted.

132 changes: 0 additions & 132 deletions src/routers/chat_router.py

This file was deleted.

Loading