Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation


🇧🇷 Sobre o projeto

O CoffeeLab nasceu como projeto prático do meu MBA em Engenharia de Software e é, honestamente, um dos projetos que mais me orgulho de ter desenvolvido.

A ideia surgiu de uma realidade que acho injusta: pequenos produtores de café especial colocam meses de trabalho, cuidado e técnica em cada lote, e o consumidor final não faz ideia disso. Ele compra um café gourmet no mercado e não sabe nada sobre quem plantou, em que altitude, com qual processo.

O CoffeeLab tenta resolver isso. O produtor preenche um formulário com as informações técnicas do lote: altitude, variedade, processo pós-colheita, notas sensoriais, e a plataforma faz o resto, a IA usa esses dados como insumo para gerar automaticamente um texto narrativo, acessível e envolvente, sem que o produtor precise escrever uma linha sequer. O resultado é uma página pública com QR Code, pronta para ser impressa na embalagem. Quando o consumidor escaneia, não encontra uma ficha técnica fria, ele encontra a história daquele lote, explicada de um jeito que qualquer pessoa consegue entender e se conectar. A IA aqui não é o produto: é a ferramenta que transforma dados técnicos em narrativa humana.


🇺🇸 About the project

CoffeeLab was built as the practical project for my MBA in Software Engineering, and it's honestly one of the projects I'm most proud of.

The idea came from something I find genuinely unfair: small specialty coffee producers put months of work, care, and technique into each batch, and the end consumer has no idea. They buy a premium coffee at the store and know nothing about who grew it, at what altitude, with what process.

CoffeeLab tries to fix that. The producer fills out a form with the technical details of the batch: altitude, variety, post-harvest process, sensory notes, and the platform handles everything else. The AI takes that data as input and automatically generates a narrative text that is accessible, engaging, and personal, without the producer having to write a single word. The result is a public page with a QR Code, ready to print on the packaging. When the consumer scans it, they don't find a cold spec sheet, they find the story of that batch, told in a way that anyone can understand and connect with. AI here isn't the product: it's the tool that turns technical data into human storytelling.


✨ Features

Feature Descrição / Description
🤖 AI Storytelling Narrativa gerada por LLaMA 3.3 com base nos dados do lote / LLaMA 3.3 generated narrative based on batch data
📱 QR Code Gerado automaticamente, pronto para imprimir na embalagem / Auto-generated, ready to print on packaging
🌍 Landing page pública Página do consumidor acessível por qualquer pessoa / Consumer page accessible by anyone
🔐 Autenticação JWT Login seguro com token de 8h / Secure login with 8h token
📸 Upload de fotos Foto do lote exibida na landing page / Batch photo displayed on landing page
📋 Gestão de lotes Listar, criar e excluir lotes / List, create and delete batches

🛠️ Stack

Backend

  • Node.js + Express
  • PostgreSQL
  • JWT + bcryptjs
  • Multer (upload de imagens)
  • Groq SDK (LLaMA 3.3 70B)
  • QRCode

Frontend

  • React 18 + Vite
  • React Router DOM v6
  • Axios
  • CSS Modules

🚀 Rodando localmente / Running locally

Pré-requisitos / Prerequisites


1. Clone o repositório / Clone the repository

git clone https://github.com/carolfons/coffee_lab.git
cd coffee_lab

2. Banco de dados / Database

Crie o banco no PostgreSQL / Create the database in PostgreSQL:

CREATE DATABASE coffelab;

Execute as migrations / Run the migrations:

# Windows
$env:PGPASSWORD = 'sua_senha'; & "C:\Program Files\PostgreSQL\18\bin\psql.exe" -U postgres -d coffelab -f "coffe-lab-backend/migrations/001_create_tables.sql"
$env:PGPASSWORD = 'sua_senha'; & "C:\Program Files\PostgreSQL\18\bin\psql.exe" -U postgres -d coffelab -f "coffe-lab-backend/migrations/002_add_lote_fields.sql"

# Linux/macOS
psql -U postgres -d coffelab -f coffe-lab-backend/migrations/001_create_tables.sql
psql -U postgres -d coffelab -f coffe-lab-backend/migrations/002_add_lote_fields.sql

3. Variáveis de ambiente / Environment variables

Crie o arquivo .env dentro de coffe-lab-backend/:

DATABASE_URL=postgresql://postgres:sua_senha@localhost:5432/coffelab
JWT_SECRET=uma_string_longa_e_aleatoria_aqui
GROQ_API_KEY=gsk_suachaveaqui
PORT=3001
BASE_URL=http://localhost:3001
FRONTEND_URL=http://localhost:3000

4. Instale as dependências / Install dependencies

# Backend
cd coffe-lab-backend
npm install

# Frontend
cd ../coffe-lab-frontend
npm install

5. Inicie os servidores / Start the servers

Abra dois terminais separados / Open two separate terminals:

Terminal 1 — Backend:

npm --prefix coffe-lab-backend run dev
# Aguarde: "Servidor rodando na porta 3001"

Terminal 2 — Frontend:

npm --prefix coffe-lab-frontend run dev
# Aguarde: "Local: http://localhost:3000"

6. Acesse / Access

URL Descrição
http://localhost:3000/login Login do produtor / Producer login
http://localhost:3000/register Cadastro / Sign up
http://localhost:3000/dashboard Painel do produtor / Producer dashboard
http://localhost:3000/lote/:id Landing page pública / Public landing page

📁 Estrutura / Structure

coffee_lab/
├── coffe-lab-backend/
│   ├── migrations/          # SQL migrations
│   ├── src/
│   │   ├── config/          # Database, multer, Groq
│   │   ├── controllers/     # Route handlers
│   │   ├── middlewares/     # Auth, error handling
│   │   ├── models/          # Database queries
│   │   ├── routes/          # API routes
│   │   └── services/        # Business logic + AI prompt
│   └── uploads/             # Imagens enviadas (gitignored)
│
├── coffe-lab-frontend/
│   └── src/
│       ├── components/      # LoteForm
│       ├── context/         # AuthContext (JWT)
│       ├── pages/           # Login, Register, Dashboard, LandingPage
│       └── services/        # Axios + API calls
│
└── docs/                    # TCC document

⚠️ Status do projeto / Project status

Este projeto é um MVP e foi construído como prova de conceito para o TCC e funciona de ponta a ponta, mas tem muito espaço para evoluir.

Next Steps:

  • Deploy em produção com armazenamento de imagens na nuvem (Cloudinary)
  • Edição de lotes já cadastrados
  • Página de perfil do produtor
  • Múltiplos idiomas na landing page do consumidor
  • Testes automatizados (unitários e de integração)
  • Rate limiting e proteção mais robusta na API
  • Dashboard com métricas de acesso à landing page (quantas vezes o QR foi escaneado)

This project is an MVP — built as a proof of concept for my thesis and works end-to-end, but there's a lot of room to grow. Some things I've already identified as next steps are listed above. Contributions and suggestions are always welcome.


👩‍💻 Autora / Author

Caroline Fonseca MBA em Engenharia de Software

GitHub Linkedin


Built with lots of coffee and a few late nights of code.

About

Projeto de conclusão de curso do MBA Engenharia de Software

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages