Skip to content

Commit

Permalink
Merge pull request projectcauchy#15 from gryAI/app-server-directory
Browse files Browse the repository at this point in the history
App Server Folder Structure
  • Loading branch information
projectcauchy authored Aug 7, 2024
2 parents 93f530d + b8ed297 commit 1ecd876
Show file tree
Hide file tree
Showing 10 changed files with 48 additions and 511 deletions.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,14 @@ uvicorn server.app:app
2. All FastAPI logic should live on `game-server/server` directory.
3. All modules in `games-server/games` should return a dataclass. Converting it to `json` will be handled by `games-server/server`
4. We can *intentionally* introduce errors into the game logic so that, when using machine learning, we can detect suspicious transactions.

### Developing the `app-server`
```bash
cd app-server
# run in a virtual environment
pip install -r requirements.txt
python server/app.py
```

1. ETL Pipeline logic should live on `app-server/games` directory
2. All invocation of ETL Pipeline for each game should live on `app-server/server` directory.
1 change: 1 addition & 0 deletions app-server/games/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from .baccarat import pipeline_baccarat
1 change: 1 addition & 0 deletions app-server/games/baccarat/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from .pipeline import pipeline_baccarat
4 changes: 4 additions & 0 deletions app-server/games/baccarat/extract.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import pandas as pd

def extract():
pass
4 changes: 4 additions & 0 deletions app-server/games/baccarat/load.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import pandas as pd

def load():
pass
11 changes: 11 additions & 0 deletions app-server/games/baccarat/pipeline.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import pandas as pd
from .extract import extract
from .transform import transform
from .load import load


def pipeline_baccarat():
extract()
transform()
load()
print('Pipeline completed')
4 changes: 4 additions & 0 deletions app-server/games/baccarat/transform.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import pandas as pd

def transform():
pass
Empty file added app-server/server/__init__.py
Empty file.
12 changes: 12 additions & 0 deletions app-server/server/app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import os
import sys
import pandas as pd

# Add the parent directory of 'games' (i.e., 'app-server') to sys.path
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))

# Import modules
from games.baccarat import pipeline_baccarat


pipeline_baccarat()
Loading

0 comments on commit 1ecd876

Please sign in to comment.