SOY NV AI commited on
Commit
b55a977
·
0 Parent(s):

Initial commit: SOY NV AI 신규 프로젝트 생성

Browse files
Files changed (8) hide show
  1. .gitignore +37 -0
  2. README.md +39 -0
  3. app/__init__.py +22 -0
  4. app/database.py +6 -0
  5. app/routes.py +8 -0
  6. requirements.txt +4 -0
  7. run.py +15 -0
  8. templates/index.html +63 -0
.gitignore ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+ *.so
6
+ .Python
7
+ venv/
8
+ env/
9
+ ENV/
10
+
11
+ # Flask
12
+ instance/
13
+ .webassets-cache
14
+
15
+ # IDE
16
+ .vscode/
17
+ .idea/
18
+ *.swp
19
+ *.swo
20
+ *~
21
+
22
+ # OS
23
+ .DS_Store
24
+ Thumbs.db
25
+
26
+ # Logs
27
+ *.log
28
+
29
+ # Database
30
+ *.db
31
+ *.sqlite
32
+ *.sqlite3
33
+
34
+ # Uploads
35
+ uploads/*
36
+ !uploads/.gitkeep
37
+
README.md ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # SOY NV AI
2
+
3
+ 신규 프로젝트
4
+
5
+ ## 설치 방법
6
+
7
+ 1. 가상환경 활성화:
8
+ ```bash
9
+ .\venv\Scripts\Activate.ps1
10
+ ```
11
+
12
+ 2. 의존성 설치:
13
+ ```bash
14
+ pip install -r requirements.txt
15
+ ```
16
+
17
+ 3. 서버 실행:
18
+ ```bash
19
+ python run.py
20
+ ```
21
+
22
+ ## 프로젝트 구조
23
+
24
+ ```
25
+ SOY NV AI/
26
+ ├── app/
27
+ │ ├── __init__.py
28
+ │ ├── database.py
29
+ │ └── routes.py
30
+ ├── templates/
31
+ │ └── index.html
32
+ ├── uploads/
33
+ ├── instance/
34
+ ├── venv/
35
+ ├── requirements.txt
36
+ ├── run.py
37
+ └── README.md
38
+ ```
39
+
app/__init__.py ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from flask import Flask
2
+ from app.database import db
3
+ import os
4
+
5
+ def create_app():
6
+ # 템플릿 폴더 경로 명시적 설정
7
+ template_folder = os.path.join(os.path.dirname(os.path.abspath(__file__)), '..', 'templates')
8
+ app = Flask(__name__, template_folder=template_folder)
9
+ app.config['SECRET_KEY'] = os.getenv('SECRET_KEY', 'dev-secret-key-change-in-production')
10
+ app.config['SQLALCHEMY_DATABASE_URI'] = os.getenv('DATABASE_URL', 'sqlite:///finance_analysis.db')
11
+ app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
12
+
13
+ db.init_app(app)
14
+
15
+ from app.routes import main_bp
16
+ app.register_blueprint(main_bp)
17
+
18
+ with app.app_context():
19
+ db.create_all()
20
+
21
+ return app
22
+
app/database.py ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ from flask_sqlalchemy import SQLAlchemy
2
+
3
+ db = SQLAlchemy()
4
+
5
+ # 데이터베이스 모델은 여기에 추가
6
+
app/routes.py ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ from flask import Blueprint, render_template
2
+
3
+ main_bp = Blueprint('main', __name__)
4
+
5
+ @main_bp.route('/')
6
+ def index():
7
+ return render_template('index.html')
8
+
requirements.txt ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ Flask==3.0.0
2
+ flask-sqlalchemy==3.1.1
3
+ python-dotenv==1.0.0
4
+
run.py ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import sys
2
+ import os
3
+
4
+ # UTF-8 인코딩 강제 설정 (Windows cp949 오류 방지)
5
+ if sys.platform == 'win32':
6
+ sys.stdout.reconfigure(encoding='utf-8')
7
+ sys.stderr.reconfigure(encoding='utf-8')
8
+
9
+ from app import create_app
10
+
11
+ app = create_app()
12
+
13
+ if __name__ == '__main__':
14
+ app.run(host='0.0.0.0', port=5000, debug=True)
15
+
templates/index.html ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="ko">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>SOY NV AI</title>
7
+ <style>
8
+ * {
9
+ margin: 0;
10
+ padding: 0;
11
+ box-sizing: border-box;
12
+ }
13
+
14
+ body {
15
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
16
+ background-color: #f5f5f5;
17
+ color: #333;
18
+ }
19
+
20
+ .container {
21
+ max-width: 1200px;
22
+ margin: 0 auto;
23
+ padding: 20px;
24
+ }
25
+
26
+ .header {
27
+ background: white;
28
+ padding: 30px;
29
+ border-radius: 10px;
30
+ box-shadow: 0 2px 10px rgba(0,0,0,0.1);
31
+ margin-bottom: 30px;
32
+ text-align: center;
33
+ }
34
+
35
+ .header h1 {
36
+ color: #2563eb;
37
+ font-size: 2.5em;
38
+ margin-bottom: 10px;
39
+ }
40
+
41
+ .content {
42
+ background: white;
43
+ padding: 40px;
44
+ border-radius: 10px;
45
+ box-shadow: 0 2px 10px rgba(0,0,0,0.1);
46
+ }
47
+ </style>
48
+ </head>
49
+ <body>
50
+ <div class="container">
51
+ <div class="header">
52
+ <h1>SOY NV AI</h1>
53
+ <p>신규 프로젝트</p>
54
+ </div>
55
+
56
+ <div class="content">
57
+ <h2>환영합니다!</h2>
58
+ <p>이 프로젝트는 SOY NV AI입니다.</p>
59
+ </div>
60
+ </div>
61
+ </body>
62
+ </html>
63
+