Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/miagv/PlataformaEduca/llms.txt

Use this file to discover all available pages before exploring further.

PlataformaEduca is a Spring Boot REST API for educational institutions. This guide walks you through cloning the project, configuring your local database, starting the server, and making your first authenticated API call. The whole process takes under ten minutes.

Prerequisites

Java 21

The application targets Java 21. Confirm your version with java -version.

Maven

Maven is bundled via the mvnw wrapper. Maven 3.8+ is recommended if using a local install.

MySQL 8+

A running MySQL 8 instance is required. Create the schema before starting the server.

Set up the project

1

Clone the repository

git clone https://github.com/your-org/plataforma-educa.git
cd plataforma-educa
2

Create the database

Log in to MySQL and create the schema:
mysql -u root -p -e "CREATE DATABASE plataforma_educativa;"
3

Configure application.properties

Open src/main/resources/application.properties and set your database credentials and JWT settings:
spring.datasource.url=jdbc:mysql://localhost:3306/plataforma_educativa
spring.datasource.username=root
spring.datasource.password=yourpassword
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver

spring.jpa.hibernate.ddl-auto=update
spring.jpa.show-sql=true
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQLDialect

jwt.secret=esta_es_una_clave_secreta_super_larga_y_segura_de_mas_de_32_caracteres_para_la_plataforma
jwt.expiration=86400000
Do not commit application.properties with real credentials to version control. Use environment variables or a secrets manager in production.
4

Build the project

./mvnw clean package -DskipTests
5

Start the server

./mvnw spring-boot:run
The server starts on port 8080. On first startup, the DataInitializer component automatically seeds the database with roles, grade levels, classrooms, sample courses, and the following user accounts:
EmailPasswordRole
admin@gmail.comadmin123ADMIN
coord@gmail.comcoord123COORDINADOR
profe@gmail.comprofe123DOCENTE
alumno@gmail.comalumno123ESTUDIANTE

Make your first API call

With the server running, authenticate with the seeded coordinator account and then retrieve the list of courses.

Log in and obtain a token

curl -s -X POST http://localhost:8080/api/auth/login \
  -H "Content-Type: application/json" \
  -d '{"email": "coord@gmail.com", "password": "coord123"}'
A successful response returns a JWT token:
{
  "token": "eyJhbGciOiJIUzI1NiJ9...",
  "email": "coord@gmail.com",
  "roles": ["ROLE_COORDINADOR"]
}
Copy the value of token.

Call GET /api/cursos

curl -s http://localhost:8080/api/cursos \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiJ9..."
The response lists the seeded courses, including Matemáticas and Comunicación.
Tokens are valid for 24 hours. After expiry, repeat the login call to obtain a new token.

Explore the API

Swagger UI is available at http://localhost:8080/swagger-ui.html once the server is running. It lists all available endpoints, their required roles, and lets you execute requests directly in the browser after pasting your token.

Authentication

Learn how to register new users, obtain tokens, and handle token expiry.

Configuration

Full reference for application.properties and deployment options.

Build docs developers (and LLMs) love