demo / readme.txt
tekville's picture
Initial commit
ff72db3
# ํ”„๋กœ์ ํŠธ ๊ตฌ์„ฑ (Windows ํ™˜๊ฒฝ)
# 1. ํ”„๋กœ์ ํŠธ ํด๋” ์ƒ์„ฑ ๋ฐ ํŒŒ์ผ ๊ตฌ์„ฑ (Windows ๋ช…๋ น์–ด)
# - ํ”„๋กœ์ ํŠธ ํด๋”: fastapi_upload_project
# - ํด๋” ๊ตฌ์กฐ:
RAG/
โ”œโ”€โ”€ .venv/ # ๊ฐ€์ƒํ™˜๊ฒฝ ํด๋”
โ”œโ”€โ”€ .vscode/ # VSCode ์„ค์ • ํด๋”
โ”œโ”€โ”€ app/ # FastAPI ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ํด๋”
โ”‚ โ”œโ”€โ”€ __pycache__/ # ์บ์‹œ ํŒŒ์ผ (์ž๋™ ์ƒ์„ฑ)
โ”‚ โ”œโ”€โ”€ resources/ # ์ถ”๊ฐ€์ ์ธ ๋ฆฌ์†Œ์Šค (XML ๋“ฑ)
โ”‚ โ”œโ”€โ”€ routers/ # ๋ผ์šฐํ„ฐ ํด๋”
โ”‚ โ”‚ โ”œโ”€โ”€ __init__.py # ๋ผ์šฐํ„ฐ ์ดˆ๊ธฐํ™” ํŒŒ์ผ
โ”‚ โ”‚ โ”œโ”€โ”€ user.py # ์‚ฌ์šฉ์ž ๊ด€๋ จ ๋ผ์šฐํ„ฐ
โ”‚ โ”‚ โ”œโ”€โ”€ search.py # ๊ฒ€์ƒ‰ ๊ด€๋ จ ๋ผ์šฐํ„ฐ
โ”‚ โ”‚ โ”œโ”€โ”€ upload.py # ์—…๋กœ๋“œ ๊ด€๋ จ ๋ผ์šฐํ„ฐ
โ”‚ โ”œโ”€โ”€ templates/ # HTML ํ…œํ”Œ๋ฆฟ ํด๋”
โ”‚ โ”‚ โ”œโ”€โ”€ upload.html # ์—…๋กœ๋“œ ํŽ˜์ด์ง€
โ”‚ โ”‚ โ”œโ”€โ”€ search.html # ๊ฒ€์ƒ‰ ํŽ˜์ด์ง€
โ”‚ โ”œโ”€โ”€ main.py # FastAPI ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ์ง„์ž…์ 
โ”œโ”€โ”€ config/ # ์„ค์ • ๊ด€๋ จ ํด๋”
โ”‚ โ”œโ”€โ”€ __pycache__/ # ์บ์‹œ ํŒŒ์ผ (์ž๋™ ์ƒ์„ฑ)
โ”‚ โ”œโ”€โ”€ database.py # SQLAlchemy ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค ์„ค์ •
โ”‚ โ”œโ”€โ”€ mybatis_manager.py # XML ๋งคํผ ๋ฐ SQL ์‹คํ–‰ ๊ด€๋ฆฌ
โ”œโ”€โ”€ mapper/ # MyBatis XML ๋งคํผ ํด๋”
โ”‚ โ”œโ”€โ”€ user_mapper.xml # ์‚ฌ์šฉ์ž ๋งคํผ XML
โ”‚ โ”œโ”€โ”€ order_mapper.xml # ์ฃผ๋ฌธ ๋งคํผ XML
โ”‚ โ”œโ”€โ”€ product_mapper.xml # ์ƒํ’ˆ ๋งคํผ XML
โ”œโ”€โ”€ models/ # ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค ๋ชจ๋ธ ํด๋”
โ”‚ โ”œโ”€โ”€ __pycache__/ # ์บ์‹œ ํŒŒ์ผ (์ž๋™ ์ƒ์„ฑ)
โ”‚ โ”œโ”€โ”€ user_info.py # ์‚ฌ์šฉ์ž ์ •๋ณด ๋ชจ๋ธ
โ”œโ”€โ”€ uploaded_files/ # ์—…๋กœ๋“œ๋œ ํŒŒ์ผ ์ €์žฅ์†Œ
โ”œโ”€โ”€ .gitignore # Git ๋ฌด์‹œ ํŒŒ์ผ
โ”œโ”€โ”€ requirements.txt # Python ํŒจํ‚ค์ง€ ์˜์กด์„ฑ
โ”œโ”€โ”€ readme.txt # ํ”„๋กœ์ ํŠธ ์„ค๋ช… ํŒŒ์ผ
# ๋ผ์šฐํ„ฐ ์ถ”๊ฐ€
# main.py ํŒŒ์ผ์— ๋ผ์šฐํ„ฐ ์ถ”๊ฐ€
app.include_router(upload.router)
# FastAPI ๋ผ์šฐํ„ฐ ํŒŒ์ผ ์ž‘์„ฑ
# app/routers/upload.py ํŒŒ์ผ์— ํŒŒ์ผ ์—…๋กœ๋“œ ๊ด€๋ จ ๋ผ์šฐํ„ฐ ์ž‘์„ฑ
-------------------------------------------------------------------------
# ๊ฐ€์ƒ ํ™˜๊ฒฝ ์ƒ์„ฑ ๋ฐ ํŒจํ‚ค์ง€ ์„ค์น˜ (Windows)
# Python ๊ฐ€์ƒ ํ™˜๊ฒฝ์„ ์ƒ์„ฑํ•˜๊ณ  ํ•„์š”ํ•œ ํŒจํ‚ค์ง€๋ฅผ ์„ค์น˜ํ•˜์„ธ์š”.
#
# python -m venv rag
# rag\Scripts\activate
# ./rag/scripts/activate.ps1(powershell evn switching)
# pip install -r requirements.txt
# FastAPI ์„œ๋ฒ„ ์‹คํ–‰
# FastAPI ์„œ๋ฒ„๋ฅผ ์‹คํ–‰ํ•˜์„ธ์š”.
# uvicorn app.main:app --reload
# pytorch ์„ค์น˜๋ฅผ ์œ„ํ•ด ํŒŒ์ด์ฌ ๋ฒ„์ „ 3.11๋กœ ๋‚ฎ์ถค
pip install torch --extra-index-url https://download.pytorch.org/whl/cpu
-------------------------------------------------------------------------
# 7. Docker ์ด๋ฏธ์ง€ ๋นŒ๋“œ&์‹คํ–‰
# docker build -t app .
# docker run -d -p 8000:8000 app