Skip to content

AlexJauregui02/BreakableToyII

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

72 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🚀 Breakable Toy II

Flight offer search application, this web application makes use of Spring Boot and gradle for the backend, ReactJS with Vite for the frontend and a third party API called Amadeus that provides flights information for the application to consume.

📌 Content

🛠 Technologies

Backend (Spring Boot, Gradle - Groovy)

  • Java 17
  • Spring Boot 3.3.4
  • Spring Web (REST API)
  • Spring WebFlux (Reactive API)
  • Gradle (Build and dependency manag
  • Springdoc OpenAPI (Swagger UI for API documentation)er)
  • JUnit 5 (Unit testing With Spring Boot Starter Test)

Frontend (ReactJS + Vite)

  • React
  • TypeScript
  • Vite (build tool & dev server)
  • Tailwind CSS
  • Vitest (Testing)
  • Component Library(Shadcn..)

⚙ Installation

# Clone repository
https://github.com/AlexJauregui02/BreakableToyII.git

Backend

# From the root directory, go to the backend folder
% cd backend

# Build the spring boot app
% ./gradlew clean build

Frontend

# From the root directory, go to the frontend folder
% cd frontend

# Install dependencies
% npm install

🔧 Configuration

Backend

Create an .env file for storing the necessary variables:

BASE_URL=https://test.api.amadeus.com
CLIENT_ID={CLIENT_ID}
CLIENT_SECRET={CLIENT_SECRET}

Frontend

Create an .env file in the frontend root:

VITE_BACKEND_API_URL="http://{BACKEND_URL}/api"

🚀 Execution

Backend

You need to first build the application by running:

% ./gradlew clean build

Afterward, you can run it:

% ./gradlew clean bootRun

Frontend

# Start running the frontend
% npm run start

Access:

  • Backend: http://localhost:8080
  • Frontend: http://localhost:9090

🐳 Docker & Containerization

Both the frontend and backend folders include a Dockerfile.
Additionally, there is a root-level docker-compose.yml that builds and runs the containers together.

% docker compose build

Afterward, if you wish to containerize and run the generated images, run:

% docker compose up

💡 Note: You will need Docker running on your machine in order to build and run the containers. You can use Docker Desktop (Windows/macOS) or any other Docker-compatible runtime (e.g. Docker Engine on Linux, Rancher Desktop, Colima, Podman).

🧪 Testing

Backend (Spring Boot)

# Run unit tests (Junit)
./gradew test

To try the endpoints's available, use the link generated by swagger: http://localhost:8080/swagger-ui.html

Frontend

# Run unit tests (Vitest)
npm run test

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published