-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #18 from wednesday-solutions/feat/restructuring-part2
feat - restructured the app structure to be more scalable
- Loading branch information
Showing
20 changed files
with
97 additions
and
101 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
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,11 +1,7 @@ | ||
from .config import get_secret_key | ||
from .db import create_local_session, engine | ||
from .redis_config import get_redis_pool | ||
|
||
|
||
__all__ = [ | ||
"get_secret_key", | ||
"create_local_session", | ||
"engine", | ||
"get_redis_pool", | ||
] |
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,25 @@ | ||
from pydantic import BaseSettings | ||
|
||
|
||
class DBSettings(BaseSettings): | ||
DB_HOSTNAME: str | ||
DB_PORT: str | ||
DB_NAME: str | ||
DB_USERNAME: str | ||
DB_PASSWORD: str | ||
|
||
class Config: | ||
env_file = ".env" | ||
|
||
|
||
class Settings(BaseSettings): | ||
SECRET_KEY: str | ||
REDIS_URL: str | ||
SLACK_WEBHOOK_URL: str | ||
|
||
class Config: | ||
env_file = ".env" | ||
|
||
|
||
db_settings = DBSettings() | ||
settings = Settings() |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,5 @@ | ||
import aioredis | ||
import os | ||
|
||
from .base import settings | ||
from redis import asyncio | ||
|
||
async def get_redis_pool(): | ||
redis_url = os.getenv("REDIS_URL", "redis://localhost:6379") | ||
return aioredis.from_url(redis_url) | ||
return asyncio.from_url(settings.REDIS_URL, encoding="utf-8", decode_responses=True) |
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,3 +0,0 @@ | ||
from .users import get_user, list_users, create_user, login | ||
|
||
__all__ = ["get_user", "list_users", "create_user", "login"] | ||
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 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,3 +0,0 @@ | ||
from .users import CreateUser, Login, UserOutResponse | ||
|
||
__all__ = ["CreateUser", "Login", "UserOutResponse"] | ||
Empty file.
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,14 @@ | ||
import re | ||
|
||
from pydantic import BaseModel | ||
from pydantic import Field | ||
|
||
|
||
class UserOutResponse(BaseModel): | ||
id: int = Field(alias="id") | ||
name: str | ||
email: str | ||
mobile: str | ||
|
||
class Config: | ||
orm_mode = True |
Empty file.
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.