A Spring Boot application that connects university students and faculty to exchange skills, similar to Tinder but for skill-sharing.
SkillSwap is a platform where university students and faculty can:
- Create detailed profiles with skills, interests, and career information
- Discover other users based on filters (year, interests, skills)
- Swipe right to like or left to pass on profiles
- Message matched users
- Manage their profile with languages, skills, organizations, and more
- Backend: Spring Boot 3.3.4 (Java 21)
- Database: PostgreSQL 16
- Frontend:
- React Web Application (see
FRONTEND.md) - React Native Mobile App with Expo 54 (see
FRONTEND.md) - Legacy: HTML, CSS, JavaScript (Vanilla) in
src/main/resources/static/
- React Web Application (see
- Build Tool: Maven
- Containerization: Docker & Docker Compose
- Additional Services: Redis, MailHog (for email testing)
Note: For detailed frontend documentation, see
FRONTEND.md
Before you begin, ensure you have the following installed:
- Java 21 (JDK) - Download here
- Maven 3.6+ (or use the included Maven wrapper
mvnw.cmd) - Docker Desktop - Download here
- Git - Download here
This is the recommended approach for active development as it provides:
- Fast hot-reload for frontend changes
- Fast hot-reload for backend changes (with Spring Boot DevTools)
- Easy database management via Docker
- No need to rebuild Docker images for code changes
# Start only the database container
docker-compose up -d dbThis will:
- Start PostgreSQL on
localhost:5432 - Create the database
skillswapautomatically - Run the schema initialization script on first startup
- Keep your data persistent in a Docker volume
# Check if container is running
docker ps
# You should see: skillswap-db# Clean, compile, and run
.\mvnw.cmd clean spring-boot:runOr in two steps:
# Step 1: Clean and compile
.\mvnw.cmd clean compile
# Step 2: Run the application
.\mvnw.cmd spring-boot:run- Frontend: http://localhost:8080
- Homepage: http://localhost:8080/index.html
- API Base: http://localhost:8080/api
The application will be available at http://localhost:8080 once you see:
Started SkillswapApplication
- Press
Ctrl + Cin the terminal where Spring Boot is running - To stop the database:
docker stop skillswap-db
This approach runs everything in Docker containers. Useful for:
- Testing the full production setup
- Ensuring consistency across environments
- CI/CD pipelines
# Build and start all containers (app, db, redis, mailhog)
docker-compose up --buildThis will:
- Build the Spring Boot application Docker image
- Start PostgreSQL database
- Start Redis
- Start MailHog (email testing)
- Start the Spring Boot application
- Frontend: http://localhost:8080
- API Base: http://localhost:8080/api
- MailHog UI: http://localhost:8025 (for testing emails)
# Stop all containers
docker-compose down
# Stop and remove volumes (β οΈ This deletes database data)
docker-compose down -vSkillSwapSpringbootApp/
βββ src/
β βββ main/
β β βββ java/com/example/skillswap/
β β β βββ controller/ # REST API controllers
β β β βββ model/ # JPA entities
β β β βββ repository/ # Spring Data repositories
β β β βββ config/ # Configuration classes (CORS, etc.)
β β β βββ SkillswapApplication.java
β β βββ resources/
β β βββ static/ # Legacy frontend files (HTML, CSS, JS)
β β β βββ index.html
β β β βββ discover.html
β β β βββ profile.html
β β β βββ matches.html
β β β βββ messages.html
β β β βββ login.html
β β β βββ register.html
β β β βββ view-profile.html
β β β βββ css/
β β β βββ js/
β β βββ schema.sql # Database schema
β β βββ application.properties
β β βββ migration-*.sql # Database migration scripts
β βββ test/ # Test files
βββ frontend-web/ # React web application
β βββ src/ # React source code
β βββ package.json
βββ frontend-mobile/ # React Native mobile app (Expo)
β βββ app/ # Expo Router pages
β βββ src/ # React Native source code
β βββ package.json
βββ docker-compose.yml # Docker services configuration
βββ Dockerfile # Spring Boot app Docker image
βββ pom.xml # Maven dependencies
βββ README.md # This file
βββ FRONTEND.md # Frontend documentation
βββ TROUBLESHOOTING.md # Troubleshooting guide
βββ CHANGELOG.md # Update history
βββ SETUP_GUIDE.md # Quick setup guide
The application uses PostgreSQL with the following main tables:
- users - User accounts (email, password, name, university)
- profile - User profiles (bio, major, year, location, career info, etc.)
- user_skill - Skills users offer or seek
- user_interest - User interests
- user_organization - Organizations/clubs users belong to
- user_language - Languages users speak
- swipe - Swipe actions (like/pass)
- match - Matched users
- message - Messages between matched users
See src/main/resources/schema.sql for the complete schema.
The application connects to PostgreSQL. Configuration is in src/main/resources/application.properties:
spring.datasource.url=jdbc:postgresql://localhost:5432/skillswap
spring.datasource.username=postgres
spring.datasource.password=postgresIf running the database in Docker (Option 1), the connection is:
- Host: localhost
- Port: 5432
- Database: skillswap
- Username: postgres
- Password: postgres
- Navigate to http://localhost:8080/register.html
- Fill in the registration form
- Submit to create your account
- Navigate to http://localhost:8080/login.html
- Enter your email (password validation is not yet implemented)
- You'll be redirected to the Discover page
- Go to http://localhost:8080/profile.html
- Fill in your information:
- Name (First & Last)
- Bio
- Major & Year
- Location
- Career Goals
- Skills (add multiple)
- Interests (add multiple)
- Organizations
- Languages
- Career, Experience, Research, Awards
- Social Links (LinkedIn, GitHub, Portfolio)
- Click "Save Profile"
- Go to http://localhost:8080/discover.html
- Use filters to find users
- Click "View Full Profile" to see details
- Use β€οΈ to like or β to pass
- Go to http://localhost:8080/matches.html
- See users you've matched with
- Go to http://localhost:8080/messages.html
- Select a match
- Send messages
If you get an error that port 8080 is already in use:
# Find the process using port 8080
netstat -ano | findstr :8080
# Kill the process (replace PID with the actual process ID)
taskkill /PID <PID> /FError: Connection refused or Connection timed out
Solutions:
-
Make sure the database container is running:
docker ps # Should show skillswap-db -
If not running, start it:
docker-compose up -d db
-
Check if PostgreSQL is accessible:
docker exec -it skillswap-db psql -U postgres -d skillswap
Solution: Make sure you're logged in. Go to http://localhost:8080/login.html and log in first.
If you see errors about tables already existing:
- The schema uses
CREATE TABLE IF NOT EXISTSfor most tables - If you still get errors, you can reset the database:
# Stop and remove the database container and volume docker-compose down -v # Start fresh docker-compose up -d db
-
Check Java version:
java -version # Should be Java 21
-
Clean and rebuild:
.\mvnw.cmd clean compile
-
Check for compilation errors in the console output
-
Verify database is running (see Database Connection Errors above)
GET /api/users- Get all usersGET /api/users/{id}- Get user by IDPOST /api/users- Create new userPUT /api/users/{id}- Update user
GET /api/profiles- Get all profilesGET /api/profiles/{id}- Get profile by IDPOST /api/profiles- Create profilePUT /api/profiles/{id}- Update profile
GET /api/user-skills- Get all user skillsPOST /api/user-skills- Add user skill
GET /api/interests- Get all interestsPOST /api/interests- Add interestDELETE /api/interests/{id}- Delete interest
GET /api/languages- Get all languagesPOST /api/languages- Add languageDELETE /api/languages/{id}- Delete language
GET /api/organizations- Get all organizationsPOST /api/organizations- Add organizationDELETE /api/organizations/{id}- Delete organization
GET /api/swipes- Get all swipesGET /api/swipes/user/{userId}- Get swipes by userPOST /api/swipes- Create swipe (like/pass)
GET /api/matches- Get all matchesGET /api/matches/{id}- Get match by ID
GET /api/messages- Get all messagesGET /api/messages/match/{matchId}- Get messages for a matchPOST /api/messages- Send message
Current Status: Basic authentication is implemented using localStorage. Password verification is not yet implemented (will be added with JWT authentication).
How it works:
- User logs in with email
- System finds user by email
- User object is stored in localStorage
- All subsequent requests use the stored user ID
Future: JWT-based authentication will be implemented for secure password verification and session management.
- Password verification (currently only checks if email exists)
- JWT authentication
- Profile photo upload (AWS S3 integration)
- Real-time messaging (WebSocket)
- Email verification
- Advanced filtering (backend implementation)
- Swipe gestures (drag left/right on profile cards)
-
Clone the repository:
git clone <repository-url> cd SkillSwapSpringbootApp
-
Choose your setup option (see Quick Start above):
- Option 1 (Recommended): Database in Docker, app locally
- Option 2: Everything in Docker
-
Start the database:
docker-compose up -d db
-
Run the application:
.\mvnw.cmd spring-boot:run
-
Access the app: http://localhost:8080
-
Start the database (if not already running):
docker start skillswap-db # Or: docker-compose up -d db
-
Run the application:
.\mvnw.cmd spring-boot:run
-
Make changes to code - Spring Boot DevTools will auto-reload
-
Refresh browser to see frontend changes
-
Stop when done:
- Press
Ctrl + Cto stop Spring Boot docker stop skillswap-dbto stop database (optional)
- Press
If new database fields are added:
- Check for migration files in
src/main/resources/ - Run the migration:
Get-Content src/main/resources/migration-*.sql | docker exec -i skillswap-db psql -U postgres -d skillswap
# Database
docker start skillswap-db # Start database
docker stop skillswap-db # Stop database
docker ps # List running containers
docker logs skillswap-db # View database logs
# Application
.\mvnw.cmd clean compile # Clean and compile
.\mvnw.cmd spring-boot:run # Run application
.\mvnw.cmd clean spring-boot:run # Clean, compile, and run
# Docker Compose
docker-compose up -d db # Start only database
docker-compose up --build # Build and start all services
docker-compose down # Stop all services
docker-compose down -v # Stop and remove volumes (β οΈ deletes data)If you encounter issues:
- Check the Troubleshooting section above
- Check
TROUBLESHOOTING.mdfor detailed troubleshooting guides - Check
FRONTEND.mdfor frontend-specific documentation - Check the console/terminal for error messages
- Verify all prerequisites are installed
- Ensure the database container is running
- Try cleaning and rebuilding:
.\mvnw.cmd clean compile
- FRONTEND.md - Complete frontend documentation (web & mobile)
- TROUBLESHOOTING.md - Comprehensive troubleshooting guide
- CHANGELOG.md - Update history and changelog
- SETUP_GUIDE.md - Quick setup guide for team members
[Add your license information here]
Happy Coding! π