# Based_AI_MBTI **Repository Path**: long0908/based_ai_mbti ## Basic Information - **Project Name**: Based_AI_MBTI - **Description**: 基于SpringAI+Ollama+Vue的MBTI性格测试系统 - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 0 - **Created**: 2026-04-05 - **Last Updated**: 2026-07-25 ## Categories & Tags **Categories**: Uncategorized **Tags**: SpringBoot, Vue, SpringAI ## README # Based AI MBTI An AI-based MBTI Personality Assessment System ## Project Overview Based AI MBTI is a backend application for an MBTI personality assessment that integrates artificial intelligence. The backend is built using the Spring Boot framework with Ollama local large language models, while the frontend is developed with Vue 3 to provide users with intelligent MBTI personality analysis services. ## Technology Stack ### Backend - Java 17+ - Spring Boot - Spring Data JPA - MySQL - Langchain4j-Ollama (AI Integration) ### Frontend - Vue 3 - Vite - Vue Router ## Features - User Management: Create and manage test users - MBTI Question Bank: Questions covering four dimensions (E/I, S/N, T/F, J/P) - Answer Logging: Save users' test responses - AI Analysis: Perform intelligent personality analysis via local Ollama large models - Streamed Output: Support for SSE server-side events to deliver real-time responses ## Project Structure ``` ├── Vue/ # Frontend Project │ ├── src/ │ │ ├── components/ # Vue Components │ │ │ ├── ChatInterface.vue │ │ │ ├── Home.vue │ │ │ └── MbtiTest.vue │ │ ├── App.vue │ │ └── main.js │ └── vite.config.js ├── src/main/java/com/AI/test/ # Backend Source Code │ ├── controller/ # Controllers │ ├── service/ # Service Layer │ ├── entity/ # Entity Classes │ ├── dto/ # Data Transfer Objects │ ├── repository/ # Data Access Layer │ └── config/ # Configuration Classes ├── database.sql # Database Initialization Script └── pom.xml # Maven Configuration ``` ## Quick Start ### Prerequisites - JDK 17+ - Maven 3.8+ - MySQL 8.0+ - Node.js 16+ - Ollama (running locally) ### Backend Configuration 1. Create the database: ```sql CREATE DATABASE based_ai_mbti; ``` 2. Modify the database connection settings in `src/main/resources/application.yaml` 3. Run the backend: ```bash ./mvnw spring-boot:run ``` ### Frontend Configuration 1. Install dependencies: ```bash cd Vue npm install ``` 2. Start the development server: ```bash npm run dev ``` ## API Endpoints ### MBTI Endpoints | Method | Path | Description | |--------|------|-------------| | GET | /api/mbti/questions | Retrieve all test questions | | POST | /api/mbti/user | Create a new user | | POST | /api/mbti/test | Initiate a new test | | POST | /api/mbti/answer | Save user answers | | POST | /api/mbti/result | Calculate test results | | GET | /api/mbti/ai-analysis/{resultId} | Retrieve AI analysis results | ### AI Chat Endpoints | Method | Path | Description | |--------|------|-------------| | GET | /ai/chat | AI chat conversation | | GET | /ai/analyze-mbti | AI-based MBTI analysis | | GET | /ai/analyze-user-answers | Analyze user responses | ## Key Classes Overview ### Entity Classes - `MbtiDimension`: MBTI dimension definitions - `MbtiQuestion`: Test questions - `MbtiOption`: Question options with scoring values - `Users`: User information - `UserTest`: User test records - `UserAnswer`: User responses - `UserMbtiResult`: MBTI test results ### Service Classes - `MbtiService`: Core business logic for retrieving questions, saving answers, and calculating results ## License MIT License