Skip to content

Commit 0bb0371

Browse files
author
EliuX
committed
Extract DAL from time_tracker_api #50
1 parent 3767cda commit 0bb0371

30 files changed

+56
-34
lines changed

.env.template

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1-
# Package where the app is located
1+
# API
2+
## Package where the app is located
23
export FLASK_APP=time_tracker_api
34

4-
# The database connection URI. Check out the README.md for more details
5+
6+
# Common attributes
7+
## The database connection URI. Check out the README.md for more details
58
DATABASE_URI=mssql+pyodbc://<user>:<password>@time-tracker-srv.database.windows.net/<database>?driver\=ODBC Driver 17 for SQL Server

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@ ENV FLASK_APP time_tracker_api
2727

2828
EXPOSE 5000
2929

30-
CMD ["gunicorn", "-b 0.0.0.0:5000", "run:app"]
30+
CMD ["gunicorn", "-b 0.0.0.0:5000", "api:app"]

README.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# time-tracker-api
22

3-
The API of the TSheets killer app.
3+
This is the mono-repository for the backend services and common codebase
44

55
## Getting started
66
Follow the following instructions to get the project ready to use ASAP.
@@ -30,10 +30,16 @@ automatically [pip](https://pip.pypa.io/en/stable/) as well.
3030
3131
- Install the requirements:
3232
```
33-
python3 -m pip install -r requirements/<stage>.txt
33+
python3 -m pip install -r requirements/<app>/<stage>.txt
3434
```
3535
36-
The `stage` can be `dev` or `prod`.
36+
Where <app> is one of the executable app namespace, e.g. `time_tracker_api`.
37+
The `stage` can be
38+
39+
* `dev`: Used for working locally
40+
* `prod`: For anything deployed
41+
42+
3743
Remember to do it with Python 3.
3844
3945

run.py renamed to api.py

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

requirements/sql_db_serverless.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# requirements/sql_db_serverless.txt
2+
3+
# For SQL database serverless (MS SQL)
4+
5+
6+
# SQL Server driver
7+
pyodbc==4.0.30
8+
9+
# ORM
10+
SQLAlchemy==1.3.15
11+
SQLAlchemy-Utils==0.36.3
12+
flask_sqlalchemy==2.4.1

requirements/dev.txt renamed to requirements/time_tracker_api/dev.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
# requirements/dev.txt
1+
# requirements/time_tracker_api/dev.txt
22

3+
# Include the prod resources
34
-r prod.txt
45

56
# For development

0 commit comments

Comments
 (0)