Carbohydrate Calculator for people with diabetes
2.2K
CarbWise is a lightweight web application that facilitates the consultation and management of carbohydrates for people with diabetes. It provides an agile way to consult the carbohydrate values of most food products based on official data sources, helping users calculate the necessary insulin dosage by easily accessing accurate carbohydrate information. The application can be easily deployed using Docker.
The food database is based on official and reliable sources:
Check out the live demo at: https://cibrandocampo.github.io/carbwise
The easiest way to deploy CarbWise is using Docker Compose:
make prod-docker
The application will be available at http://localhost:8080 (or the port configured in your .env file).
To stop the application:
make prod-docker-down
You can also run CarbWise directly with Docker:
docker pull cibrandocampo/carbwise:latest
docker run -d -p 8080:80 --name carbwise cibrandocampo/carbwise:latest
The application will be available at http://localhost:8080.
For more detailed deployment instructions and all available commands, see the Installation section below or run make help.
Quick Carbohydrate Lookup:
Easily search for carbohydrate values across a wide range of food products.
Dynamic Filtering:
Fast search functionality with accent-insensitive filtering to enhance usability.
Categorized Display:
Products are grouped by category, making it easier to locate specific items.
Multi-Language Support:
The application supports multiple languages. The JSON data includes translations for product names and categories, ensuring a localized experience for users.
Glycemic Index Display:
Shows the glycemic index for each product with color-coded indicators (green for low, orange for moderate, red for high).
Reliable Data Source:
All the information is based on official and reliable sources. The displayed data is derived from the Fundación para la Diabetes, Roche, Novo Nordisk, and Serafín Murillo (Dietista-Nutricionista, Especialista en Diabetes). See the Data Sources section above for detailed references.
Responsive Design:
Optimized for both desktop and mobile devices, ensuring a smooth user experience on all screen sizes.
Easy Deployment:
Deploy the project quickly using Docker and docker-compose.
git clone https://github.com/cibrandocampo/carbwise.git
cd carbwise
make dev
Open your browser and visit http://localhost:8080
For development with hot reload:
Configure Environment (Optional):
Copy .env.example to .env and adjust settings if needed:
cp .env.example .env
Start Development Container:
make dev-docker
Access the Application:
Navigate to http://localhost:8080 (or the port configured in your .env file).
The project includes Docker configuration for production deployment.
Configure Environment:
Copy .env.example to .env and adjust settings:
cp .env.example .env
Build and Run with Docker Compose:
make prod-docker
Or Build Docker Image:
make build-docker
docker run -d -p 8080:80 --name carbwise carbwise:latest
For detailed deployment instructions, see DEPLOY.md.
You can see all available commands with:
make help
carbwise/
├── .github/
│ └── workflows/ # GitHub Actions workflows
├── dev/
│ ├── docker-compose.yaml # Development Docker Compose
│ └── README.md # Development documentation
├── src/
│ ├── css/
│ │ └── styles.css
│ ├── data/
│ │ └── food.json # Food data with translations
│ ├── js/
│ │ ├── main.js # Application entry point
│ │ ├── data.js # Data loading and processing
│ │ ├── translations.js # Translation management
│ │ ├── ui.js # UI rendering and interactions
│ │ └── utils.js # Utility functions
│ ├── index.html
│ └── translations.json
├── .dockerignore
├── .env.example
├── docker-compose.yaml # Production Docker Compose
├── Dockerfile # Production Docker image
├── DEPLOY.md # Deployment guide
├── nginx.conf # Nginx configuration
├── package.json
└── README.md
Search Bar:
Type in the search input to filter products by name or category. The search function is designed to ignore accents, providing a seamless search experience.
Dynamic Table:
The table is dynamically populated from a JSON file containing product data. Products are sorted alphabetically by category and by product name within each category.
Multi-Language Interface:
Thanks to the JSON file containing translations, the application automatically displays category and product names in the user's browser language, falling back to Spanish if the preferred language is not available.
Fixed Header:
The header—including the title, slogan, search bar, and table header—remains fixed at the top of the page, ensuring key information is always visible.
Glycemic Index:
The glycemic index is displayed with color coding: green for low (≤55), orange for moderate (56-69), and red for high (≥70).
The application is available as a Docker image on Docker Hub:
docker pull cibrandocampo/carbwise:latest
docker run -d -p 8080:80 --name carbwise cibrandocampo/carbwise:latest
This project is licensed under the MIT License.
For any inquiries or feedback, please contact [Cibrán Docampo] at [[email protected]].
Content type
Image
Digest
sha256:e57fd1e04…
Size
24.7 MB
Last updated
8 months ago
docker pull cibrandocampo/carbwise