Java / SpringIn Progress

Project TPD · SmartChef

SmartChef is a cooking and food-planning platform with a Java/Spring Boot API, a React interface and PostgreSQL storage. The repository documents pantry management, recipes, meal plans, shopping lists, dietary preferences, AI recipe suggestions, optional fridge-image analysis, and a retrieval-augmented culinary knowledge service.

JavaSpring BootMavenPostgreSQLHibernateReact 19ViteDockerJWTBCryptOpenAI APIChromaDB
TPProject TPD · SmartChef
JavaMain technology
194Tracked files*
14Stack items
—Additional metric

*Verified tracked source and project files (build directories excluded)

01 · What it does

What the application does

Capabilities documented in the repository; the supporting sources and project configuration determine how they run.

01

Ingredient and recipe management with role-based API endpoints

Ingredient and recipe management with role-based API endpoints.

02

User pantry, shopping lists, meal plans and dietary restrictions

User pantry, shopping lists, meal plans and dietary restrictions.

03

JWT authentication and BCrypt password hashing

JWT authentication and BCrypt password hashing.

04

Documented capability

AI recipe suggestions with configurable usage limits and manual confirmation of vision results.

05

Optional culinary RAG using ChromaDB and a separate Spring microservice

Optional culinary RAG using ChromaDB and a separate Spring microservice.

06

Docker Compose for database, backend and web client; Mockito-based service tests

Docker Compose for database, backend and web client; Mockito-based service tests.

02 · Technical structure

How the system works

01

Spring Boot REST controllers delegate to services and JPA repositories.

02

Hibernate validates a PostgreSQL model; Flyway can bootstrap fresh schemas in a Docker development setup.

03

React/Vite consumes the API; a separate RAG service enriches AI context with culinary documents.

04 · Source and design

Implementation examples and code walkthrough

Selected fragments from project source files with an explanation of the responsibility they implement.

AI request rate limiting

Java

Requests are throttled in a rolling one-hour window per user; cost limits are in the application service layer.

Project-TPD/src/main/java/org/projectTPD/service/AiRateLimitService.javaSelected source excerpt
public void check(String userKey) {
    if (requestsPerHour <= 0) return;
    Deque<Instant> timestamps = requests.computeIfAbsent(userKey, ignored -> new ArrayDeque<>());
    synchronized (timestamps) {
        Instant cutoff = Instant.now().minus(Duration.ofHours(1));
        while (!timestamps.isEmpty() && timestamps.peekFirst().isBefore(cutoff)) timestamps.removeFirst();
        if (timestamps.size() >= requestsPerHour) throw new AiRateLimitExceededException();
        timestamps.addLast(Instant.now());
    }
}

Image validation before AI interpretation

Java

The refrigerator-image workflow validates uploads before calling an AI model and returns uncertain ingredient matches for manual confirmation.

Project-TPD/src/main/java/org/projectTPD/service/FridgeVisionService.javaSelected source excerpt
private void validate(MultipartFile photo) {
    if (photo == null || photo.isEmpty())
        throw new InvalidImageException("Please upload a refrigerator photo.");
    if (!ALLOWED_IMAGE_TYPES.contains(photo.getContentType()))
        throw new InvalidImageException("Use a JPEG, PNG, or WebP image.");
}
STATUS & SOURCE NOTES

Status & source limitations

Descriptions and examples are based on the repository documentation and selected source files. Build settings, external services, assets and project-specific configuration may be required to run the application.