A simple, fast calorie tracking app focused on Malaysian cuisine. Search our database of 100+ Malaysian foods with accurate nutritional information.
π Production: https://kalori-api.my
| Document | Description |
|---|---|
| API Documentation | REST API endpoints, authentication, and examples |
| Contributing Guidelines | How to contribute, branch strategy, PR process |
| GitHub Actions CI/CD | CI/CD pipeline and deployment workflow |
| Linting Guide | ESLint and Prettier configuration |
| VPS Setup | Self-hosted deployment guide |
- Instant Search - Find any food in milliseconds
- Macro Tracking - Calories, protein, carbs, and fat
- Category Filters - Browse by Rice, Noodles, Roti, Meat, and more
- No Sign-up Required - Just search and track
- Mobile Friendly - Works on any device
| Layer | Technology |
|---|---|
| Frontend | Next.js 14, React, Tailwind CSS |
| Backend | Node.js, Express, tRPC |
| Database | MongoDB |
| Monorepo | Turborepo, pnpm |
Kal-Monorepo/
βββ packages/
β βββ kal-frontend/ # Next.js frontend app
β βββ kal-backend/ # tRPC backend API
β βββ kal-db/ # Database migrations & seeds
β βββ kal-shared/ # Shared types & schemas
βββ docker/ # Docker compose for local dev
βββ docs/ # Documentation
βββ .env.example # Environment variables template
βββ pnpm-workspace.yaml # pnpm workspace config
βββ turbo.json # Turborepo config
- Node.js >= 18
- pnpm >= 8 (
npm install -g pnpm) - Docker (for local MongoDB)
git clone https://github.com/Zen0space/Kal-Monorepo.git
cd Kal-Monorepopnpm installcp .env.example .envEdit .env with your configuration (defaults work for local dev).
cd docker
docker-compose up -dcd packages/kal-db
pnpm migrate:up # Run migrations
pnpm seed # Seed Malaysian foods# Terminal 1: Backend
cd packages/kal-backend
pnpm dev
# Terminal 2: Frontend
cd packages/kal-frontend
pnpm devOpen http://localhost:3000 in your browser.
[!IMPORTANT] > Always create your branch from
dev, notmain!
| Branch | Purpose |
|---|---|
main |
Production - deployed automatically |
dev |
Development - merge PRs here first |
-
Create feature branch from
dev:git checkout dev git pull origin dev git checkout -b feature/your-feature-name
-
Make your changes and commit:
git add . git commit -m "feat: add your feature"
-
Push and create PR to
dev:git push origin feature/your-feature-name
-
After PR is approved and merged to
dev, it will be tested before merging tomain.
Want to add more Malaysian foods? Edit the seed file:
packages/kal-db/scripts/seed.tsEach food entry requires:
{
name: "Food Name",
calories: 300,
protein: 10,
carbs: 40,
fat: 8,
serving: "1 plate",
category: "Rice" // Rice, Noodles, Roti, Meat, Seafood, Vegetables, Soups, Snacks, Desserts, Drinks, Basics
}After adding, run:
pnpm seed # Force reseed (clears existing data)The backend uses tRPC. Key endpoints:
| Endpoint | Description |
|---|---|
food.search |
Search foods by name |
food.allPaginated |
Get paginated foods with category filter |
food.categories |
Get all food categories |
food.create |
Add food entry (requires auth) |
food.list |
List user's food entries (requires auth) |
# Type check all packages
pnpm typecheck
# Lint
pnpm lintThe app is deployed using Coolify to a self-hosted server.
π Production URL: https://kalori-api.my
| Environment | Trigger | URL |
|---|---|---|
| Production | Merge to main |
kalori-api.my |
| Preview | PR to dev |
CI runs only |
- CI/CD: GitHub Actions - see docs/github-actions.md
- Backend: Docker container with entrypoint running migrations
- Frontend: Static build via Next.js
We welcome contributions! Please see our Contributing Guidelines for detailed instructions.
- Fork the repository
- Create branch from
dev(notmain) - Make your changes
- Run
pnpm lint:fixto auto-fix issues - Run
pnpm typecheckto verify types - Submit PR to
devbranch - Wait for review
Tip
See docs/contributing.md for the full guide including issue templates and PR process.
Tip
See docs/linting.md for the linting guide.
feat: add new feature
fix: bug fix
docs: documentation update
style: code formatting
refactor: code refactoring
MIT License - see LICENSE for details.
- Kai - Creator & Maintainer
Made with β€οΈ in Malaysia