Skip to main content

Local Development Setup

This guide will walk you through setting up Kin Conecta on your local machine for development purposes.
This installation guide is for developers who want to run and modify the Kin Conecta platform locally. If you’re a tourist or guide looking to use the platform, please visit the live application instead.

Prerequisites

Before you begin, ensure you have the following installed:

Required Software

Java Development Kit

Java JDK 21+The backend requires Java 21 or higher.Verify installation:
java -version

MySQL Server

MySQL 8.0+Required for the database layer.Verify installation:
mysql --version

Build Tool

Gradle (included via wrapper)The project uses Gradle for builds. The wrapper scripts are included.

Version Control

GitRequired to clone the repository.Verify installation:
git --version
  • MySQL Workbench - GUI tool for database management
  • Postman or Insomnia - For testing API endpoints
  • Modern web browser - Chrome, Firefox, or Edge
  • Code editor - VS Code, IntelliJ IDEA, or Eclipse

Database Setup

Set up the MySQL database before running the application.
1

Start MySQL Server

Ensure your MySQL server is running:
# Check if MySQL service is running
net start | findstr MySQL

# Start MySQL if needed
net start MySQL80
2

Create Database Schema

Run the database creation script located at KinConecta/kinConnect.sql:
mysql -u root -p < KinConecta/kinConnect.sql
This creates the kin_conecta schema with all required tables:
  • users - User accounts (tourists and guides)
  • tours - Tour offerings
  • tour_categories - Tour category definitions
  • destinations - Destination locations
  • reviews - User reviews and ratings
  • trip_bookings - Booking records
  • guide_profiles - Extended guide information
  • tourist_profiles - Extended tourist information
  • And 30+ additional tables for complete functionality
3

Load Sample Data (Optional)

To populate the database with sample data for testing:
mysql -u root -p kin_conecta < KinConecta/seed_kinconecta_5_registros.sql
Or for more comprehensive seed data:
mysql -u root -p kin_conecta < backendKC/kin_conecta_seed_data.sql
Sample data includes example users, tours, destinations, and reviews for testing purposes.
4

Verify Database Creation

Connect to MySQL and verify the schema:
mysql -u root -p

USE kin_conecta;

SHOW TABLES;

-- You should see 30+ tables
-- Verify a few key tables:
DESCRIBE users;
DESCRIBE tours;
DESCRIBE guide_profiles;

Backend Setup

Configure and run the Spring Boot backend API.
1

Clone the Repository

Clone the Kin Conecta repository to your local machine:
git clone <repository-url>
cd backendKC
2

Configure Database Connection

Edit the src/main/resources/application.properties file:
spring.application.name=KCv2

# Database connection
spring.datasource.url=jdbc:mysql://localhost:3306/kin_conecta?useSSL=false&allowPublicKeyRetrieval=true
spring.datasource.username=root
spring.datasource.password=YOUR_MYSQL_PASSWORD
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver

# JPA/Hibernate settings
spring.jpa.hibernate.ddl-auto=none
spring.jpa.show-sql=true
spring.jpa.properties.hibernate.format_sql=true
Important Configuration Notes:
  • The script creates the database as kin_conecta (with underscore)
  • Make sure your spring.datasource.url matches: kin_conecta
  • Set spring.jpa.hibernate.ddl-auto=none to prevent auto-schema modification
  • Update spring.datasource.password with your MySQL root password
3

Build the Project

Build the backend using the Gradle wrapper:
.\gradlew.bat build
The build process will:
  • Download dependencies
  • Compile Java source code
  • Run unit tests
  • Create executable JAR file
4

Run the Backend Server

Start the Spring Boot application:
.\gradlew.bat bootRun
You should see output indicating the server has started:
Started SocialNetworkApplication in X.XXX seconds
Tomcat started on port(s): 8080 (http)
The API will be available at: http://localhost:8080
5

Verify API is Running

Test that the backend is working by making a request:
curl http://localhost:8080/api/users
You should receive a JSON response with user data (or empty array if no seed data).

Running Tests

To run the backend test suite:
./gradlew test --no-daemon --console=plain

Frontend Setup

Set up the frontend application to connect with the backend.
1

Navigate to Frontend Directory

The frontend is located in the KinConecta directory:
cd KinConecta
2

Configure API Endpoint

Update the API base URL in the frontend configuration if needed.Edit frontend/src/scripts/api/http-client.js to ensure it points to your backend:
// Default configuration
const API_BASE_URL = 'http://localhost:8080/api';
3

Serve the Frontend

You can serve the frontend using any static file server:
# Using Python's built-in server
python -m http.server 3000

# Or with Python 2
python -m SimpleHTTPServer 3000
4

Access the Application

Open your web browser and navigate to:
http://localhost:3000
You should see the Kin Conecta homepage with:
  • Navigation header
  • Hero section
  • Login and registration options
  • Explore destinations section
5

Test User Flows

Test the complete user flows:Tourist Flow:
  1. Click “Registrarse” (Register)
  2. Select “Turista” role
  3. Complete registration form
  4. Login with credentials
  5. Explore tours and guides
Guide Flow:
  1. Register as “Guía”
  2. Complete guide profile
  3. Create a tour plan
  4. Set availability
  5. View dashboard statistics

API Endpoints Reference

The backend exposes 195 REST endpoints across 39 controllers. Here are some key endpoints:

User Management

POST http://localhost:8080/api/users
Content-Type: application/json

{
  "role": "TOURIST",
  "fullName": "Ana Pérez",
  "dateOfBirth": "1998-04-17",
  "email": "ana@example.com",
  "passwordHash": "hashed_password",
  "countryCode": "MX",
  "phoneNumber": "5512345678",
  "phoneE164": "+525512345678",
  "preferredLanguageCode": "es",
  "accountStatus": "ACTIVE"
}

Tours & Destinations

GET http://localhost:8080/api/tours

Guide Profiles

GET http://localhost:8080/api/guide_profiles
For a complete list of all 195 endpoints, refer to the ENDPOINTS.md file in the backendKC directory.

Troubleshooting

Common Issues

Solution:
  1. Verify the database schema was created:
mysql -u root -p -e "SHOW DATABASES;"
  1. Ensure the name matches in application.properties:
spring.datasource.url=jdbc:mysql://localhost:3306/kin_conecta
  1. Re-run the database creation script if needed
Solution:
  1. Verify MySQL credentials are correct
  2. Update application.properties with correct username/password:
spring.datasource.username=your_mysql_user
spring.datasource.password=your_mysql_password
  1. Test connection in MySQL Workbench first
Solution:Option 1: Stop the process using port 8080Option 2: Change the server port in application.properties:
server.port=8081
Solution:
  1. Verify backend is running on port 8080
  2. Check for CORS issues in browser console
  3. Ensure API_BASE_URL in frontend points to correct backend
  4. Verify CORS configuration in CorsConfiguration.java
Solution:
  1. Verify Java version is 21 or higher:
java -version
  1. Update JAVA_HOME environment variable if needed
  2. Check build.gradle toolchain configuration:
java {
    toolchain {
        languageVersion = JavaLanguageVersion.of(21)
    }
}

Next Steps

Now that you have Kin Conecta running locally:

Explore the API

Browse the complete API documentation

Database Setup

Learn about the database schema and setup

User Guides

Understand how to use the platform

Core Concepts

Learn how to contribute to the project

Development Tools

Useful Commands

# Backend commands
./gradlew build          # Build the project
./gradlew bootRun        # Run the application
./gradlew test           # Run tests
./gradlew clean          # Clean build artifacts

# Database commands
mysql -u root -p kin_conecta              # Connect to database
mysqldump -u root -p kin_conecta > backup.sql  # Backup database

API Testing

Use Postman or cURL to test endpoints. Example requests are provided in the INSTRUCTIONS.md file.
The backend includes Spring Security configuration. Some endpoints may require authentication tokens in production.

Build docs developers (and LLMs) love