Skip to main content
This guide walks you through setting up the FoodTech Kitchen Service on your local machine for development and testing.

Prerequisites

Before you begin, ensure you have the following installed:
  • Java 17 or higher
  • Gradle 8.5 (included via Gradle wrapper)
  • Git for cloning the repository

Getting Started

1

Clone the Repository

First, clone the repository to your local machine:
git clone <repository-url>
cd FoodTech
2

Verify Java Installation

Confirm that Java 17 is installed and set as your default:
java -version
You should see output indicating Java 17 or higher.
3

Build the Project

Use the Gradle wrapper to build the project and download dependencies:
./gradlew clean build
This command will:
  • Download all project dependencies
  • Compile the source code
  • Run all tests
  • Generate the executable JAR file
4

Run the Application

Start the application using one of these methods:
./gradlew bootRun
The application will start on http://localhost:8080.
5

Verify the Application

Test the API by creating a sample order:
curl -X POST http://localhost:8080/api/orders \
  -H "Content-Type: application/json" \
  -d '{
    "tableNumber": "A1",
    "products": [
      {"name": "Coca Cola", "type": "DRINK"},
      {"name": "Pizza Margherita", "type": "HOT_DISH"},
      {"name": "Caesar Salad", "type": "COLD_DISH"}
    ]
  }'
Expected response:
{
  "tableNumber": "A1",
  "tasksCreated": 3,
  "message": "Order processed successfully"
}

Configuration

The application uses an embedded H2 database by default, configured in src/main/resources/application.yaml. No additional database setup is required for local development.

Default Configuration

  • Server Port: 8080
  • Database: H2 (in-memory)
  • CORS: Enabled for all origins (development only)
  • Security: Permissive configuration (development only)

Troubleshooting

Port Already in Use

If port 8080 is already in use, you can change it by setting the SERVER_PORT environment variable:
SERVER_PORT=8081 ./gradlew bootRun

Dependency Issues

If you encounter dependency resolution problems, try refreshing dependencies:
./gradlew --stop
./gradlew clean build --refresh-dependencies

IDE Integration

VS Code:
  1. Open Command Palette (Ctrl+Shift+P)
  2. Run Java: Restart Language Server
  3. If issues persist, run Java: Clean the Java Language Server Workspace
IntelliJ IDEA:
  1. Open the Gradle tool window
  2. Click the Refresh button (⟳)
  3. If issues persist, go to File → Invalidate Caches / Restart...

Next Steps

  • Learn how to run the application with Docker
  • Explore the Testing Guide to understand the test structure
  • Check out the API Reference for complete endpoint documentation

Build docs developers (and LLMs) love