$ git clone https://github.com/Dayflt/Backend.git
Go to Backend/ directory
cd Backend
Make virtual environment
$ pip install virtualenv
$ virtualenv myenv # make virtual environment
Activate virtual environment
$ .\myenv\Scripts\activate
Go back to Backend directory and install requirements.txt
(myenv) $ cd ../../
(myenv) $ pip install -r requirements.txt
If you want to deactivate
(myenv) $ deactivate
Database setting
Change Backend/web/config.py
2 PORT= '(Enter your PORT)'
3 USERNAME='(Enter your USERNAME)'
4 PASSWORD='(Enter your PASSWORD)'
Create new database
(myenv) $ python run.py create_db
(myenv) $ python run.py run
Enter localhost:5000/swagger after Flask run
(myenv) $ python run.py create_db
(myenv) $ flask run
# open another terminal
(myenv) $ pytest
βββ Backend/ - λ°±μλ νλΌμ€ν¬ λλ ν 리
βββ test_endpoints.py - unit test μ€ν νμΌ
βββ run.py - Flask μ€ν μν νμΌ
βββ views.py - SQLAlchamyμ κΈ°λ₯μ μ μν νμΌ
βββ .flaskenv - Flask μ€νμ μν νκ²½λ³μ μ€μ νμΌ
βββ dayfly-318913-a4b443321e00.json - Google Cloud Bucketμ μ κ·ΌνκΈ° μν κΆν μ λ³΄κ° λ΄κΈ΄ νμΌ
βββ requirements.txt - λͺ¨λλ€μ μ 리ν νμΌ
βββ web/
βββ AI/ - AIλͺ¨λΈ μκ³ λ¦¬μ¦
βββ data/result/ - λ°±μλ λμμ μμ μ μ₯ λλ ν 리
βββ __init__.py - μ€νμν€λ €λ flask appμ΄ μ μλμ΄μλ νμΌ νλ‘μ νΈλ₯Ό μ€νμν€λ©΄ appμ ꡬλμν΄
βββ config.py - νμ configuration μ¬νλ€μ΄ μ μλ νμΌ
βββ gcp.py - google cloud bucketμ μ΄μ©ν΄ νμΌ μ
μΆλ ₯ μ€νΈλ¦Όμ λ€λ£¨κΈ° μν ν¨μκ° μ μλ νμΌ
βββ models.py - video_tableμ΄λΌλ database classκ° μ μλ νμΌ
βββ prdedictmix.py - AI λͺ¨λΈμ μ μ©ν΄μ μλΉμ€μ ν΅μ¬μΈ μμΈ μμ μμ±μ νκΈ° μν νμΌ
βββ routes.py - API λͺ
μΈμκ° λͺ¨λ μ μλ νμΌ
βββ views.py - database ORM μ μ νμΌ
βββ static/
βββ swagger.json -swagger μ μ νμΌ