feat(backend): replace fastapi backend with micronaut/java + mybatis
This commit fully replaces the legacy Python FastAPI backend with a new Java-based Micronaut + MyBatis CRUD backend: - add Maven build configuration and project dependencies - implement database config, auto data initialization, and custom error handling - add CRUD controllers, repository, mapper, and entity classes - include Swagger UI static resources and configuration - update README.md to reflect new backend setup and execution steps - remove old Python backend files (main.py, requirements.txt, init_db.py) - add Java/Maven-specific gitignore rules
This commit is contained in:
@@ -98,20 +98,20 @@ skillDesk/
|
||||
|
||||
- [docs/test-scenarios.md](./docs/test-scenarios.md)
|
||||
|
||||
## SQLite + FastAPI + Vue CRUD 예제 실행
|
||||
## SQLite + Micronaut + MyBatis + Vue CRUD 예제 실행
|
||||
|
||||
현재 저장소에는 SQLite의 `messages` 테이블 데이터를 FastAPI가 읽고 쓰며, Vue 화면에서 조회, 추가, 수정, 삭제할 수 있는 최소 CRUD 예제가 포함되어 있습니다.
|
||||
현재 저장소에는 SQLite의 `messages` 테이블 데이터를 Micronaut + MyBatis 가 읽고 쓰며, Vue 화면에서 조회, 추가, 수정, 삭제할 수 있는 최소 CRUD 예제가 포함되어 있습니다.
|
||||
|
||||
### 1. 백엔드 실행
|
||||
|
||||
```bash
|
||||
python3 -m venv .venv
|
||||
source .venv/bin/activate
|
||||
pip install -r backend/requirements.txt
|
||||
python backend/init_db.py
|
||||
uvicorn backend.main:app --host 127.0.0.1 --port 8000 --reload
|
||||
# backend 디렉토리에서 실행
|
||||
cd backend
|
||||
mvn exec:java -Dexec.mainClass=skilldesk.Application -Dmicronaut.server.port=8000
|
||||
```
|
||||
|
||||
DB와 테이블, 초기 데이터(`hello world`)는 최초 실행 시 자동 생성됩니다.
|
||||
|
||||
### 2. 프론트엔드 실행
|
||||
|
||||
새 터미널에서 아래 명령을 실행합니다.
|
||||
@@ -135,7 +135,7 @@ python3 -m http.server 5173 -d frontend
|
||||
#### 백엔드 대체 포트 예시
|
||||
|
||||
```bash
|
||||
uvicorn backend.main:app --host 127.0.0.1 --port 8001 --reload
|
||||
mvn exec:java -Dexec.mainClass=skilldesk.Application -Dmicronaut.server.port=8001
|
||||
```
|
||||
|
||||
#### 프론트엔드 대체 포트 예시
|
||||
|
||||
Reference in New Issue
Block a user