• Blog
  • Docs
  • Pricing
  • We’re hiring!
Log inSign up
yawnxyz

yawnxyz

calpics

Public
Like
calpics
Home
Code
5
backend
3
frontend
5
shared
2
README.md
H
index.ts
Branches
1
Pull requests
Remixes
History
Environment variables
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Sign up now
Code
/
backend
/
README.md
Code
/
backend
/
README.md
Search
4/22/2025
README.md

FoodVision Backend

This directory contains the backend code for the FoodVision app.

Structure

  • database/: Database schema and queries
    • schema.ts: Defines the database tables and types
    • queries.ts: Contains functions for interacting with the database
  • services/: External service integrations
    • vision.ts: Integration with Groq API for Llama 4 Maverick vision
  • index.ts: Main entry point for the HTTP API

API Endpoints

  • POST /api/analyze: Analyze a food image

    • Accepts: multipart/form-data with image file and optional userId
    • Returns: Analysis results including calories, description, and tags
  • GET /api/entries: Get food entry history

    • Query params: userId (optional), limit (optional), offset (optional)
    • Returns: List of food entries
  • GET /api/stats: Get calorie statistics

    • Query params: userId (optional), days (optional)
    • Returns: Daily calories, total calories, average calories, and common tags

Environment Variables

  • GROQ_API_KEY: API key for Groq (required for vision analysis)
FeaturesVersion controlCode intelligenceCLIMCP
Use cases
TeamsAI agentsSlackGTM
DocsShowcaseTemplatesNewestTrendingAPI examplesNPM packages
PricingNewsletterBlogAboutCareers
We’re hiring!
Brandhi@val.townStatus
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Open Source Pledge
Terms of usePrivacy policyAbuse contact
Β© 2025 Val Town, Inc.