PersonaPrep is an AI-powered communication coaching platform that helps users improve their interpersonal skills through interactive practice sessions. The application provides personalized coaching for various communication scenarios including interview preparation, networking, small talk, presentations, negotiation, and conflict resolution.
- Real-time AI Coaching: Interactive conversations with AI-powered feedback
- Multiple Communication Types: Interview prep, networking, presentations, small talk, and more
- Confidence Level Tracking: Adaptive coaching based on user skill level (Beginner to Expert)
- Personalized Feedback: AI analyzes communication patterns and provides targeted suggestions
- Conversation History: Track progress across multiple coaching sessions
- WebSocket Support: Real-time messaging for seamless interaction
- Responsive UI: Modern, mobile-friendly interface
- Backend: Java 17, Spring Boot 3.5.4
- Database: MongoDB (Atlas)
- AI Integration: Google Gemini API
- Frontend: HTML5, CSS3, JavaScript (Vanilla)
- Build Tool: Gradle
- Testing: JUnit, Embedded MongoDB
Before running this project locally, ensure you have the following installed:
- Java 17 or higher
- MongoDB Atlas account (or local MongoDB instance)
- Google Gemini API key
- Git (for cloning the repository)
git clone <repository-url>
cd PersonaPrepCreate environment variables for the required configurations. You can set these in your system or create a .env file:
# MongoDB Configuration
export MONGODB_URI="mongodb+srv://username:[email protected]/?retryWrites=true&w=majority"
export MONGODB_DATABASE="personaprep"
# Gemini AI Configuration
export GEMINI_API_KEY="your-gemini-api-key-here"
export GEMINI_BASE_URL="https://generativelanguage.googleapis.com/v1beta"- Create a free account at MongoDB Atlas
- Create a new cluster
- Create a database user with read/write permissions
- Get your connection string and replace
<username>and<password> - Whitelist your IP address in Network Access
- Go to Google AI Studio
- Create a new API key
- Copy the key for use in your environment variables
# Make gradlew executable (Linux/Mac)
chmod +x gradlew
# Build the project
./gradlew build./gradlew bootRun# Build JAR file
./gradlew build
# Run the JAR
java -jar build/libs/personaprep-0.0.1-SNAPSHOT.jar# For MongoDB Atlas (recommended)
./env.sh
# For embedded MongoDB (testing only)
./env-embedded.shOnce the application starts successfully, you can access it at:
- Web Interface: http://localhost:8080
- API Base URL: http://localhost:8080/api
- Open http://localhost:8080 in your browser
- Click "Register" and create a new account
- Fill in all fields including password
- After registration, you'll be redirected to the dashboard
- Click on any conversation type (e.g., "Interview Prep")
- Start chatting with the AI coach
curl -X POST http://localhost:8080/api/users/register \
-H "Content-Type: application/json" \
-d '{"username":"testuser","email":"[email protected]","firstName":"Test","lastName":"User","password":"password123"}'curl -X POST http://localhost:8080/api/conversations/start \
-H "Content-Type: application/json" \
-d '{"userId":"USER_ID_FROM_REGISTRATION","title":"Interview Practice","type":"INTERVIEW_PREP"}'curl -X POST http://localhost:8080/api/conversations/CONVERSATION_ID/messages \
-H "Content-Type: application/json" \
-d '{"content":"Hello, I need help with interview preparation"}'PersonaPrep/
βββ src/
β βββ main/
β β βββ java/com/personaprep/
β β β βββ controller/ # REST & WebSocket controllers
β β β βββ model/ # Domain entities
β β β βββ repository/ # Data access layer
β β β βββ service/ # Business logic
β β β βββ config/ # Configuration classes
β β βββ resources/
β β βββ static/ # Frontend assets (HTML, CSS, JS)
β β βββ application.properties
β βββ test/ # Test classes
βββ build.gradle # Build configuration
βββ env.sh # Environment setup script
βββ README.md # This file
POST /api/users/register- Register new userPOST /api/users/login- User loginGET /api/users/{id}- Get user details
POST /api/conversations/start- Start new conversationGET /api/conversations/{id}- Get conversation detailsGET /api/conversations/user/{userId}- Get user's conversationsPOST /api/conversations/{id}/messages- Send messageGET /api/conversations/{id}/messages- Get conversation messages
POST /api/personality/assess- Create personality profileGET /api/personality/user/{userId}- Get user's personality profile
Error: MongoTimeoutException
Solution:
- Check your MongoDB URI and credentials
- Ensure your IP is whitelisted in MongoDB Atlas
- Verify network connectivity
Error: 401 Unauthorized
Solution:
- Verify your Gemini API key is correct
- Check if the API key has proper permissions
- Ensure the key is properly set in environment variables
Error: Port 8080 was already in use
Solution:
# Kill process using port 8080
sudo lsof -t -i:8080 | xargs kill -9
# Or run on different port
./gradlew bootRun --args='--server.port=8081'# Clean and rebuild
./gradlew clean build
# Skip tests if needed
./gradlew build -x test# Run all tests
./gradlew test
# Run specific test class
./gradlew test --tests "UserControllerTest"
# Run tests with coverage
./gradlew test jacocoTestReportFor production deployment, ensure you:
- Set production MongoDB URI
- Use production Gemini API key
- Configure proper CORS origins
- Set up proper logging levels
- Use environment-specific profiles
FROM openjdk:17-jdk-slim
COPY build/libs/personaprep-0.0.1-SNAPSHOT.jar app.jar
EXPOSE 8080
ENTRYPOINT ["java", "-jar", "/app.jar"]- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
If you encounter any issues or have questions:
- Check the troubleshooting section above
- Review the application logs for error details
- Ensure all environment variables are properly set
- Verify your MongoDB and Gemini API configurations
After successfully running the application:
- Explore different conversation types
- Test the AI coaching feedback
- Try the personality assessment feature
- Experiment with the WebSocket real-time messaging
- Review the conversation history functionality
Happy Coding! π