Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Student Management API

A RESTful API for managing student records.

Prerequisites

  • Docker and Docker Compose

Setup

  1. Clone the repository:
git clone <repository-url>
cd <project-directory>
  1. Build and start the containers:
docker-compose up -d --build
  1. Create the database table:
docker exec -it soa_mysql mysql -u root -proot soa -e "CREATE TABLE IF NOT EXISTS estudiante (
    cedula VARCHAR(20) PRIMARY KEY,
    nombre VARCHAR(100) NOT NULL,
    apellido VARCHAR(100) NOT NULL,
    direccion TEXT,
    telefono VARCHAR(20)
);"

Running the API

  1. The API will be available at:

  2. To test the API endpoints, run:

chmod +x tests/api_test.sh
./tests/api_test.sh

API Endpoints

GET /api/students.php

Returns a list of all students.

POST /api/students.php

Creates a new student.

{
    "cedula": "12345",
    "nombre": "John",
    "apellido": "Doe",
    "direccion": "123 Main St",
    "telefono": "555-0123"
}

DELETE /api/students.php?cedula=XXX

Deletes a student by their cedula.

Docker Commands

  • Start containers: docker-compose up -d
  • Stop containers: docker-compose down
  • View logs: docker-compose logs -f
  • Rebuild containers: docker-compose up -d --build

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages