Skip to content

GaileAlex/cv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1,077 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

CV - AI-Powered Chat & Learning Platform

🌐 Website: https://gaile.ee/

A comprehensive web application featuring AI-powered chat, language learning tools, and various interactive features. Built with Spring Boot, Angular, and integrated with Ollama for AI capabilities.

πŸš€ Features

  • AI Chat System: Interactive chat with AI models supporting English and Estonian languages
  • Language Learning: English vocabulary building and grammar checking
  • Speech Processing: Text-to-speech and speech-to-text capabilities
  • Blog System: Content management and publishing
  • Proxy Management: Proxy list management and monitoring
  • Statistics: Visit statistics and user analytics
  • Interactive Games: Minesweeper and learning-to-count modules
  • User Authentication: Secure JWT-based authentication system

πŸ›  Technologies

Backend

  • Java 25 with Spring Boot 4.0.5
  • Spring Security - JWT authentication
  • Spring Data JPA - Database access
  • Spring WebFlux - Reactive programming
  • Liquibase - Database migrations
  • PostgreSQL with pgvector extension - Vector database for AI embeddings
  • Ollama - AI model integration (GPU & CPU versions)
  • MapStruct - Bean mapping
  • Lombok - Code generation
  • Apache POI - Document processing
  • Swagger/OpenAPI - API documentation

Frontend

  • Angular 21 with Angular Material
  • Bootstrap 5 - UI framework
  • Socket.IO - Real-time communication
  • Chart.js - Data visualization
  • ngx-translate - Internationalization

Infrastructure

  • Docker & Docker Compose - Containerization
  • Nginx - Reverse proxy and static file serving
  • PostgreSQL Backup - Automated database backups

πŸ“‹ Prerequisites

  • Java 25 or higher
  • Maven 3.8+
  • Node.js 22+ and npm
  • Docker and Docker Compose
  • PostgreSQL 18 with pgvector extension
  • NVIDIA GPU (for GPU-accelerated Ollama, optional)

πŸ— Project Structure

CV/
β”œβ”€β”€ common/              # Shared utilities and models
β”œβ”€β”€ persistence/         # Database layer (entities, repositories)
β”œβ”€β”€ security/            # Security configuration and JWT
β”œβ”€β”€ services/            # Business logic layer
β”‚   β”œβ”€β”€ blog/           # Blog service
β”‚   β”œβ”€β”€ chat/           # AI chat service
β”‚   β”œβ”€β”€ email/          # Email service
β”‚   β”œβ”€β”€ english/        # English learning service
β”‚   β”œβ”€β”€ proxy/          # Proxy management
β”‚   β”œβ”€β”€ statistics/     # Statistics service
β”‚   └── user/           # User management
β”œβ”€β”€ web-api/             # REST API controllers
β”œβ”€β”€ frontend/            # Angular application
β”œβ”€β”€ docker-compose.yml   # Docker services configuration
β”œβ”€β”€ Dockerfile           # Backend Docker image
└── pom.xml             # Maven configuration

πŸ”§ Installation

1. Clone the repository

git clone <repository-url>
cd CV

2. Configure environment variables

Create a .env file in the root directory:

# Database
SPRING_DATASOURCE_URL=jdbc:postgresql://cv-postgres/db
SPRING_DATASOURCE_USERNAME=your_username
SPRING_DATASOURCE_PASSWORD=your_password
POSTGRES_DB=cv_db

# Security
SECURITY_JWT_KEY=your_jwt_secret_key

# Email (optional)
SPRING_MAIL_USERNAME=your_email@gmail.com
SPRING_MAIL_PASSWORD=your_app_password

# Ollama
OLLAMA_MODEL=hf.co/kyx0r/L3-Evil-Stheno-v3.2-8B-GGUF:Q8_0
OLLAMA_MODEL_EMBEDDING=qwen3-embedding:4b

3. Create Docker network

docker network create kokoro-net

4. Build and start services

docker-compose up -d

πŸš€ Running the Application

Using Docker Compose (Recommended)

# Start all services
docker-compose up -d

# View logs
docker-compose logs -f

# Stop services
docker-compose down

Manual Development Setup

Backend

# Build the project
mvn clean install

# Run the application
cd web-api
mvn spring-boot:run

The backend API will be available at http://localhost:8399/api/v1

Frontend

cd frontend

# Install dependencies
npm install --legacy-peer-deps

# Start development server
npm start

The frontend will be available at http://localhost:4405

Access Points

πŸ“š API Documentation

The application uses Swagger/OpenAPI for API documentation. Once the backend is running, access the Swagger UI at:

http://localhost:8399/api/v1/swagger-ui.html

Main API Endpoints

  • Authentication: /api/v1/auth/*
  • Chat: /api/v1/chat/*
  • Blog: /api/v1/blog/*
  • User: /api/v1/user/*
  • Statistics: /api/v1/statistics/*
  • Proxy: /api/v1/proxy/*

πŸ” Security

  • JWT-based authentication
  • Token expiration: 30 minutes (access token), 60 minutes (refresh token)
  • Password encryption
  • CORS configuration
  • Role-based access control

πŸ—„ Database

Database Migrations

The project uses Liquibase for database migrations. Migration files are located in:

persistence/src/main/resources/db/changelog/

Backup Strategy

Automatic backups are scheduled daily at 2:00 AM (Europe/Tallinn timezone) and retained for 60 days.

πŸ§ͺ Testing

Backend Tests

mvn test

Frontend Tests

cd frontend
npm test

πŸ“¦ Building for Production

Backend

mvn clean package -Dmaven.test.skip

The executable JAR will be created at web-api/target/cv-exec.jar

Frontend

cd frontend
npm run build --configuration production

The production build will be in the dist/ directory.

Docker Images

# Build backend image
docker build -t cv-app:latest .

# Build frontend image
cd frontend
docker build -t cv-ui:latest .

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ“ Configuration

Application Properties

Main configuration is in web-api/src/main/resources/application.properties:

  • Server Port: 8399
  • Context Path: /api/v1
  • File Upload Limit: 20MB
  • Database: PostgreSQL with connection pooling
  • Async Request Timeout: 600 seconds (for AI operations)

Ollama Configuration

  • GPU Instance: Supports NVIDIA GPUs with CUDA
  • CPU Instance: Fallback for systems without GPU
  • Parallel Requests: 4 concurrent requests
  • Thread Count: 8 threads
  • Model Keep Alive: 30 minutes

πŸ” Troubleshooting

Common Issues

  1. Port already in use: Change ports in docker-compose.yml
  2. Database connection failed: Check PostgreSQL container logs
  3. Ollama not responding: Verify Ollama container is running and model is downloaded
  4. Frontend build fails: Try using --legacy-peer-deps flag with npm install

Viewing Logs

# All services
docker-compose logs

# Specific service
docker-compose logs cv-app
docker-compose logs cv-postgres
docker-compose logs cv-ollama

πŸ“„ License

This project is licensed under the MIT License.

πŸ‘₯ Authors

  • Gaile - Project Owner

πŸ™ Acknowledgments

  • Spring Boot team
  • Angular team
  • Ollama project
  • PostgreSQL community
  • All open-source contributors

About

CV - AI-Powered Chat & Learning Platform

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors