Code Monkey home page Code Monkey logo

kcal's People

Contributors

cdubz avatar megawubs avatar ryderforreal avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

kcal's Issues

Kcal with a HTTPS and a Reverse Proxy

Hi, I really like your app. However I have trouble getting it to work with a Reverse Proxy like NGINX and HTTPS. From issue I understand that this is because kcal doesn't know about the URL and is just "projecting" its js and css to the ip given in the .env file. I must say I am not a Frontend Dev by any means so please excuse my possible misunderstanding. Is there any workaround? Is it possible to implements such a solution such as offerd in link?
Screenshot from 2024-05-08 18-59-35

Recipe image doesn't show

After uploading a recipe image, it does not show up and instead 404s (when accessing my installation via its local IP) or straight up doesn't display without any errors (when accessing my installation via the url defined in .env).

Blank user edit page when profile image is uploaded

Once a user has an image uploaded and is saved the edit page becomes blank, both refreshing and backing out both result in the same behavior. Attempted on multiple users and the edit page is only blank after uploading an image, works flawlessly without it

Copy food/meal feature

Would appreciate the feature to copy a meal to another day. For example I always have the same PM snack and I'd like to copy what I usually have to the next day instead of looking for it each day.

SQL error

I use mariadb database and got such exception.

Illuminate\Database\QueryException:
SQLSTATE[42000]: Syntax error or access violation: 1055 'kcal.tags.name' isn't in GROUP BY (SQL: select `id`, `name`, count(*) as total from `tags` inner join `taggables` on `taggables`.`tag_id` = `id` where `taggables`.`taggable_type` = App\Models\Recipe group by `id` order by json_unquote(json_extract(`name`, '$."en"')) asc)

  at /home/taurus/develop/kcal/vendor/laravel/framework/src/Illuminate/Database/Connection.php:760
  at Illuminate\Database\Connection->runQueryCallback()
     (/home/taurus/develop/kcal/vendor/laravel/framework/src/Illuminate/Database/Connection.php:720)
  at Illuminate\Database\Connection->run()
     (/home/taurus/develop/kcal/vendor/laravel/framework/src/Illuminate/Database/Connection.php:405)
  at Illuminate\Database\Connection->select()
     (/home/taurus/develop/kcal/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php:2705)
  at Illuminate\Database\Query\Builder->runSelect()
     (/home/taurus/develop/kcal/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php:2694)
  at Illuminate\Database\Query\Builder->Illuminate\Database\Query\{closure}()
     (/home/taurus/develop/kcal/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php:3230)
  at Illuminate\Database\Query\Builder->onceWithColumns()
     (/home/taurus/develop/kcal/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php:2693)
  at Illuminate\Database\Query\Builder->get()
     (/home/taurus/develop/kcal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php:710)
  at Illuminate\Database\Eloquent\Builder->getModels()
     (/home/taurus/develop/kcal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php:694)
  at Illuminate\Database\Eloquent\Builder->get()
     (/home/taurus/develop/kcal/app/Models/Traits/Ingredient.php:59)
  at App\Models\Recipe::getTagTotals()
     (/home/taurus/develop/kcal/app/Http/Controllers/RecipeController.php:29)
  at App\Http\Controllers\RecipeController->index()
     (/home/taurus/develop/kcal/vendor/laravel/framework/src/Illuminate/Routing/Controller.php:54)
  at Illuminate\Routing\Controller->callAction()
     (/home/taurus/develop/kcal/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php:43)
  at Illuminate\Routing\ControllerDispatcher->dispatch()
     (/home/taurus/develop/kcal/vendor/laravel/framework/src/Illuminate/Routing/Route.php:259)
  at Illuminate\Routing\Route->runController()
     (/home/taurus/develop/kcal/vendor/laravel/framework/src/Illuminate/Routing/Route.php:205)
  at Illuminate\Routing\Route->run()
     (/home/taurus/develop/kcal/vendor/laravel/framework/src/Illuminate/Routing/Router.php:798)
  at Illuminate\Routing\Router->Illuminate\Routing\{closure}()
     (/home/taurus/develop/kcal/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:141)
  at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
     (/home/taurus/develop/kcal/app/Http/Middleware/DisableBrowserCache.php:27)
  at App\Http\Middleware\DisableBrowserCache->handle()
     (/home/taurus/develop/kcal/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:180)
  at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
     (/home/taurus/develop/kcal/vendor/spatie/laravel-csp/src/AddCspHeaders.php:13)
  at Spatie\Csp\AddCspHeaders->handle()
     (/home/taurus/develop/kcal/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:180)
  at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
     (/home/taurus/develop/kcal/vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php:50)
  at Illuminate\Routing\Middleware\SubstituteBindings->handle()
     (/home/taurus/develop/kcal/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:180)
  at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
     (/home/taurus/develop/kcal/vendor/laravel/framework/src/Illuminate/Auth/Middleware/Authenticate.php:44)
  at Illuminate\Auth\Middleware\Authenticate->handle()
     (/home/taurus/develop/kcal/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:180)
  at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
     (/home/taurus/develop/kcal/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php:78)
  at Illuminate\Foundation\Http\Middleware\VerifyCsrfToken->handle()
     (/home/taurus/develop/kcal/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:180)
  at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
     (/home/taurus/develop/kcal/vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php:49)
  at Illuminate\View\Middleware\ShareErrorsFromSession->handle()
     (/home/taurus/develop/kcal/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:180)
  at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
     (/home/taurus/develop/kcal/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php:121)
  at Illuminate\Session\Middleware\StartSession->handleStatefulRequest()
     (/home/taurus/develop/kcal/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php:64)
  at Illuminate\Session\Middleware\StartSession->handle()
     (/home/taurus/develop/kcal/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:180)
  at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
     (/home/taurus/develop/kcal/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/AddQueuedCookiesToResponse.php:37)
  at Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse->handle()
     (/home/taurus/develop/kcal/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:180)
  at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
     (/home/taurus/develop/kcal/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php:67)
  at Illuminate\Cookie\Middleware\EncryptCookies->handle()
     (/home/taurus/develop/kcal/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:180)
  at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
     (/home/taurus/develop/kcal/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:116)
  at Illuminate\Pipeline\Pipeline->then()
     (/home/taurus/develop/kcal/vendor/laravel/framework/src/Illuminate/Routing/Router.php:797)
  at Illuminate\Routing\Router->runRouteWithinStack()
     (/home/taurus/develop/kcal/vendor/laravel/framework/src/Illuminate/Routing/Router.php:776)
  at Illuminate\Routing\Router->runRoute()
     (/home/taurus/develop/kcal/vendor/laravel/framework/src/Illuminate/Routing/Router.php:740)
  at Illuminate\Routing\Router->dispatchToRoute()
     (/home/taurus/develop/kcal/vendor/laravel/framework/src/Illuminate/Routing/Router.php:729)
  at Illuminate\Routing\Router->dispatch()
     (/home/taurus/develop/kcal/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:190)
  at Illuminate\Foundation\Http\Kernel->Illuminate\Foundation\Http\{closure}()
     (/home/taurus/develop/kcal/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:141)
  at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
     (/home/taurus/develop/kcal/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php:21)
  at Illuminate\Foundation\Http\Middleware\TransformsRequest->handle()
     (/home/taurus/develop/kcal/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ConvertEmptyStringsToNull.php:31)
  at Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull->handle()
     (/home/taurus/develop/kcal/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:180)
  at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
     (/home/taurus/develop/kcal/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php:21)
  at Illuminate\Foundation\Http\Middleware\TransformsRequest->handle()
     (/home/taurus/develop/kcal/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TrimStrings.php:40)
  at Illuminate\Foundation\Http\Middleware\TrimStrings->handle()
     (/home/taurus/develop/kcal/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:180)
  at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
     (/home/taurus/develop/kcal/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php:27)
  at Illuminate\Foundation\Http\Middleware\ValidatePostSize->handle()
     (/home/taurus/develop/kcal/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:180)
  at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
     (/home/taurus/develop/kcal/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/PreventRequestsDuringMaintenance.php:86)
  at Illuminate\Foundation\Http\Middleware\PreventRequestsDuringMaintenance->handle()
     (/home/taurus/develop/kcal/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:180)
  at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
     (/home/taurus/develop/kcal/vendor/fruitcake/laravel-cors/src/HandleCors.php:38)
  at Fruitcake\Cors\HandleCors->handle()
     (/home/taurus/develop/kcal/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:180)
  at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
     (/home/taurus/develop/kcal/vendor/laravel/framework/src/Illuminate/Http/Middleware/TrustProxies.php:39)
  at Illuminate\Http\Middleware\TrustProxies->handle()
     (/home/taurus/develop/kcal/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:180)
  at Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
     (/home/taurus/develop/kcal/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:116)
  at Illuminate\Pipeline\Pipeline->then()
     (/home/taurus/develop/kcal/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:165)
  at Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter()
     (/home/taurus/develop/kcal/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:134)
  at Illuminate\Foundation\Http\Kernel->handle()
     (/home/taurus/develop/kcal/public/index.php:51)      

For myself I fixed it here

    public static function getTagTotals(string $locale = null): DatabaseCollection {
        $locale = $locale ?? app()->getLocale();
        return Tag::query()->join('taggables', 'taggables.tag_id', '=', 'id')
            ->select(['id', 'name', DB::raw('count(*) as total')])
            ->where('taggables.taggable_type', '=', static::class)
            ->groupBy(['id', 'name'])
            ->orderBy("name->{$locale}")
            ->get();
    }

Error means when you use GROUP BY you can select only aggregate columns or columns from GROUP BY.

Add multiples of food to journal

Adding multiple serves of a food is possible, but has to be done one at a time. Having a quantity dropdown next to the meal selector would allow more effective use of servings

Recipe serving name wrong when food serving size is less than 1

The recipe ingredient list will use the food serving name if the food is entered using servings and the food serving size is less than one. E.g. food with 1/4 cup serving size added to a recipe as 1/2 serving will show up incorrectly as 1/2 cup no instead of 1/8 cup.

Related it #19. Seems a specific recipe summary method should be added to the Food model.

Unable to build on raspberry pi

Hi, thanks for making this service. I'm looking forward to using it. Has anyone built this on a raspberry pi? I'm unable to get it to work. The app container keeps crashes immediately after boot. I'm assuming it has something to do with the binary that's being run not being arm compatible.

I also had other issues getting redis, elasticsearch and mysql running on the raspberry pi, but I've been able to slowly work through them by using various different images. Here is the docker compose file that I'm currently using:

  kcal-app:
    image: kcalapp/kcal
    container_name: kcal-app
    restart: unless-stopped
    security_opt:
      - no-new-privileges:true
    tty: true
    working_dir: /app
    env_file: ./kcal/.env
    volumes:
      - './kcal/app/public:/app/public/'
      - './kcal/etc/php/php.ini:/usr/local/etc/php/conf.d/local.ini'
    networks:
      - net
    depends_on:
      - kcal-db

  kcal-db:
    image: hypriot/rpi-mysql
    container_name: kcal-db
    restart: unless-stopped
    tty: true
    privileged: true
    security_opt:
      - no-new-privileges:true
    ports:
      - '${DB_PORT:-3306}:3306'
    environment:
      MYSQL_ROOT_PASSWORD: '${DB_PASSWORD:-kcal}'
      MYSQL_DATABASE: '${DB_DATABASE:-kcal}'
      MYSQL_USER: '${DB_USERNAME:-kcal}'
      MYSQL_PASSWORD: '${DB_PASSWORD:-kcal}'
      MYSQL_ALLOW_EMPTY_PASSWORD: 'yes'
    volumes:
      - './kcal/db/data:/var/lib/mysql/'
      - './kcal/etc/mysql/my.cnf:/etc/mysql/my.cnf'
    networks:
      - net

  kcal-web:
    image: nginx:alpine
    container_name: kcal-web
    security_opt:
      - no-new-privileges:true
    restart: unless-stopped
    tty: true
    working_dir: /app
    volumes:
      - './kcal/app/public:/app/public/'
      - './kcal/etc/nginx/conf.d/:/etc/nginx/conf.d/'
    networks:
      - net
    depends_on:
      - kcal-app
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.kcal-web.rule=Host(`kcal.$DOMAIN`)"
      - "traefik.http.routers.kcal-web.entrypoints=https"

  kcal-elasticsearch:
    image: 'ind3x/rpi-elasticsearch'
    container_name: kcal-elasticsearch
    security_opt:
      - no-new-privileges:true
    environment:
      - xpack.security.enabled=false
      - discovery.type=single-node
    ulimits:
      memlock:
        soft: -1
        hard: -1
      nofile:
        soft: 65536
        hard: 65536
    cap_add:
      - IPC_LOCK
    volumes:
      - './kcal/elasticsearch/data:/usr/share/elasticsearch/data'
    ports:
      - '${ELASTIC_PORT:-9200}:9200'
    networks:
      - net

  kcal-redis:
    image: 'redis:latest'
    container_name: kcal-redis
    privileged: true
    security_opt:
      - no-new-privileges:true
    ports:
      - '${REDIS_PORT:-6379}:6379'
    volumes:
      - './kcal/redis/data:/data'
    networks:
      - net

I also tried cloning the kcal repo and building an image using the Dockerfile, but changing the php image, but I had no luck. The Dockerfile uses apk, so I had to use the alpine image specified in the file, however I ran into various issues with that while building.

Remove unused tags

Tags that are no longer used remain in the system forever and should instead be purged.

Recipes api returns 500 error. Other queries seem fine.

192.168.1.102 - - [28/Sep/2023:18:58:10 +0000] "GET /api/v1/foods?page[number]=1&page[size]=12 HTTP/1.1" 200 11706 "http://192.168.1.238/foods" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:109.0) Gecko/20100101 Firefox/117.0" 192.168.1.102 - - [28/Sep/2023:18:58:13 +0000] "GET /recipes HTTP/1.1" 200 15598 "http://192.168.1.238/foods" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:109.0) Gecko/20100101 Firefox/117.0" 192.168.1.102 - - [28/Sep/2023:18:58:13 +0000] "GET /api/v1/recipes?page[number]=1&page[size]=12 HTTP/1.1" 500 6628 "http://192.168.1.238/recipes" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:109.0) Gecko/20100101 Firefox/117.0"

Navigation seems to be fine; however, the api is returning 500 causing recipes page to spool endlessly. Trying to dig up more details, but I'm just now diggin in.

Restarting host & containers doesn't seem to resolve.

Host details:
Operating System: Ubuntu 20.04.5 LTS
Kernel: Linux 5.4.0-163-generic
Architecture: x86-64

Appreciate any help!

Capital letters inconsistent

Word capitalisation is inconsistent, some instances always display lowercase, some display capitals depending if another field is not empty (details for food), some are captialised such as the journal.

An option to disable all changes and display as entered would be much appreciated, if not a setting to choose.

Recommendation by meal

Is it possible to have the search results filter by common foods logged for that meal?

For example if I have a shake for breakfast, could the results begin with common foods logged at the meal first so they could be quickly selected, rather than searching 'shake' and then scrolling through options.

HTTPS behind another reverse proxy

Hello, I have deployed your app in a proxmox container and set it up behind a reverse proxy (nginx proxy manager) with SSL connection but when I go on the link, the CSS and the JS doesn't load... if I go directly on the ip adress this works perfectly. There is a screenshot of the chromium error logs in attached files. Can you help me ?
unknown

installation issue

Hello,

I have not been successful installing kcal manual type on an Ubuntu Server 22.04.4 LTS with Apache.

There is an issue on step 12 second line

... php artisan elastic:migrate ...

which yields the following error message:

Migrating: 2021_03_04_193043_create_foods_index

In 2021_03_04_193043_create_foods_index.php line 9:

Interface "ElasticMigrations\MigrationInterface" not found

Any hep would be appreciated.

SQLSTATE[22003]: Numeric value out of range:

Trying to edit a recipe and adding above 99 grams of something gives error:

SQLSTATE[22003]: Numeric value out of range: 1264 Out of range value for column 'amount' at row 1 (SQL: update ingredient_amounts set amount = 100, ingredient_amounts.updated_at = 2021-10-31 15:03:27 where id = 7)

Options to add, hide, convert, and reorder nutrition units

In Australia dietary information is standardised (online and on packaging examples included) so having the option to change the formatting to match would save a lot of time.

Add: Some other units may be applicable on a user by user basis. For example: Saturated and Trans fats (in addition to Total fat), Sugars, Dietary Fibre, Caffeine, Vitamins, etc.

Reorder: For example the order is ALWAYS Energy>Protein>Fat>Carbs>Sugars>Fibre>Sodium so being able to reorganise them in a settings page would allow copying the values straight over.

Convert: Energy in Australia is often showed in kilojoules and only is sometimes converted to calories on the packaging, 1 calorie is 4.184 Kilojoules so having an option that switches the input to the opposite unit and does the math would save a lot of time.

Hide: Cholesterol is not included on these nutritional fact sheets so having the option to hide this section would clean the interface.

image
image

Improve journal UX

The journal UX is clunky. Two key changes that would help a lot —

  1. Immediate feedback on day macros effect of making a change.
  2. Ability to quickly edit existing entries.

The current system was designed to be flexible with respect to added data for multiple days at once but that seems like an edge case that isn’t worth building for. Implementing these improvements should be easier if that feature can be sacrificed (or at least deprioritized).

SQL error causing 500 Internal Server Error on both /recipes and /foods

When I browse to both /recipes and /food, I get the 500 SERVER ERROR page and see an accompanying error and stack trace in the Laravel logs. I've included both that stack trace and my redacted .env file.

Expand .env file
APP_NAME=kcal
APP_ENV=production
APP_KEY=[REDACTED]
APP_DEBUG=false
APP_URL=https://[REDACTED]
APP_PORT=80
APP_SERVICE=app
APP_TIMEZONE=UTC
DB_CONNECTION=mysql
DB_HOST=localhost
DB_PORT=3306
DB_DATABASE=kcal
DB_USERNAME=kcal
DB_PASSWORD=[REDACTED]
REDIS_HOST=localhost
REDIS_PORT=6379
SCOUT_DRIVER=algolia
ALGOLIA_APP_ID=[REDACTED]
ALGOLIA_SECRET=[REDACTED]
MEDIA_DISK=media
QUEUE_CONVERSIONS_BY_DEFAULT=false
Expand stacktrace
[2023-12-12 00:57:20] production.ERROR: SQLSTATE[42000]: Syntax error or access violation: 1055 'kcal.tags.name' isn't in GROUP BY (SQL: select `id`, `name`, count(*) as total from `tags` inner join `taggables` on `taggables`.`tag_id` = `id` where `taggables`.`taggable_type` = App\Models\Food group by `id` order by json_unquote(json_extract(`name`, '$."en"')) asc) {"userId":12,"exception":"[object] (Illuminate\\Database\\QueryException(code: 42000): SQLSTATE[42000]: Syntax error or access violation: 1055 'kcal.tags.name' isn't in GROUP BY (SQL: select `id`, `name`, count(*) as total from `tags` inner join `taggables` on `taggables`.`tag_id` = `id` where `taggables`.`taggable_type` = App\\Models\\Food group by `id` order by json_unquote(json_extract(`name`, '$.\"en\"')) asc) at /var/www/kcal/vendor/laravel/framework/src/Illuminate/Database/Connection.php:760)
[stacktrace]
#0 /var/www/kcal/vendor/laravel/framework/src/Illuminate/Database/Connection.php(720): Illuminate\\Database\\Connection->runQueryCallback()
#1 /var/www/kcal/vendor/laravel/framework/src/Illuminate/Database/Connection.php(405): Illuminate\\Database\\Connection->run()
#2 /var/www/kcal/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(2705): Illuminate\\Database\\Connection->select()
#3 /var/www/kcal/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(2694): Illuminate\\Database\\Query\\Builder->runSelect()
#4 /var/www/kcal/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(3230): Illuminate\\Database\\Query\\Builder->Illuminate\\Database\\Query\\{closure}()
#5 /var/www/kcal/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(2693): Illuminate\\Database\\Query\\Builder->onceWithColumns()
#6 /var/www/kcal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php(710): Illuminate\\Database\\Query\\Builder->get()
#7 /var/www/kcal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php(694): Illuminate\\Database\\Eloquent\\Builder->getModels()
#8 /var/www/kcal/app/Models/Traits/Ingredient.php(59): Illuminate\\Database\\Eloquent\\Builder->get()
#9 /var/www/kcal/app/Http/Controllers/FoodController.php(21): App\\Models\\Food::getTagTotals()
#10 /var/www/kcal/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(54): App\\Http\\Controllers\\FoodController->index()
#11 /var/www/kcal/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(43): Illuminate\\Routing\\Controller->callAction()
#12 /var/www/kcal/vendor/laravel/framework/src/Illuminate/Routing/Route.php(259): Illuminate\\Routing\\ControllerDispatcher->dispatch()
#13 /var/www/kcal/vendor/laravel/framework/src/Illuminate/Routing/Route.php(205): Illuminate\\Routing\\Route->runController()
#14 /var/www/kcal/vendor/laravel/framework/src/Illuminate/Routing/Router.php(798): Illuminate\\Routing\\Route->run()
#15 /var/www/kcal/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(141): Illuminate\\Routing\\Router->Illuminate\\Routing\\{closure}()
#16 /var/www/kcal/app/Http/Middleware/DisableBrowserCache.php(27): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#17 /var/www/kcal/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): App\\Http\\Middleware\\DisableBrowserCache->handle()
#18 /var/www/kcal/vendor/spatie/laravel-csp/src/AddCspHeaders.php(13): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#19 /var/www/kcal/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Spatie\\Csp\\AddCspHeaders->handle()
#20 /var/www/kcal/vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php(50): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#21 /var/www/kcal/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Routing\\Middleware\\SubstituteBindings->handle()
#22 /var/www/kcal/vendor/laravel/framework/src/Illuminate/Auth/Middleware/Authenticate.php(44): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#23 /var/www/kcal/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Auth\\Middleware\\Authenticate->handle()
#24 /var/www/kcal/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php(78): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#25 /var/www/kcal/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Foundation\\Http\\Middleware\\VerifyCsrfToken->handle()
#26 /var/www/kcal/vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php(49): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#27 /var/www/kcal/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\View\\Middleware\\ShareErrorsFromSession->handle()
#28 /var/www/kcal/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(121): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#29 /var/www/kcal/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(64): Illuminate\\Session\\Middleware\\StartSession->handleStatefulRequest()
#30 /var/www/kcal/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Session\\Middleware\\StartSession->handle()
#31 /var/www/kcal/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/AddQueuedCookiesToResponse.php(37): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#32 /var/www/kcal/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Cookie\\Middleware\\AddQueuedCookiesToResponse->handle()
#33 /var/www/kcal/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php(67): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#34 /var/www/kcal/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Cookie\\Middleware\\EncryptCookies->handle()
#35 /var/www/kcal/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(116): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#36 /var/www/kcal/vendor/laravel/framework/src/Illuminate/Routing/Router.php(797): Illuminate\\Pipeline\\Pipeline->then()
#37 /var/www/kcal/vendor/laravel/framework/src/Illuminate/Routing/Router.php(776): Illuminate\\Routing\\Router->runRouteWithinStack()
#38 /var/www/kcal/vendor/laravel/framework/src/Illuminate/Routing/Router.php(740): Illuminate\\Routing\\Router->runRoute()
#39 /var/www/kcal/vendor/laravel/framework/src/Illuminate/Routing/Router.php(729): Illuminate\\Routing\\Router->dispatchToRoute()
#40 /var/www/kcal/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(190): Illuminate\\Routing\\Router->dispatch()
#41 /var/www/kcal/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(141): Illuminate\\Foundation\\Http\\Kernel->Illuminate\\Foundation\\Http\\{closure}()
#42 /var/www/kcal/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#43 /var/www/kcal/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ConvertEmptyStringsToNull.php(31): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle()
#44 /var/www/kcal/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Foundation\\Http\\Middleware\\ConvertEmptyStringsToNull->handle()
#45 /var/www/kcal/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#46 /var/www/kcal/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TrimStrings.php(40): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle()
#47 /var/www/kcal/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Foundation\\Http\\Middleware\\TrimStrings->handle()
#48 /var/www/kcal/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php(27): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#49 /var/www/kcal/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Foundation\\Http\\Middleware\\ValidatePostSize->handle()
#50 /var/www/kcal/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/PreventRequestsDuringMaintenance.php(86): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#51 /var/www/kcal/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Foundation\\Http\\Middleware\\PreventRequestsDuringMaintenance->handle()
#52 /var/www/kcal/vendor/fruitcake/laravel-cors/src/HandleCors.php(38): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#53 /var/www/kcal/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Fruitcake\\Cors\\HandleCors->handle()
#54 /var/www/kcal/vendor/laravel/framework/src/Illuminate/Http/Middleware/TrustProxies.php(39): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#55 /var/www/kcal/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Http\\Middleware\\TrustProxies->handle()
#56 /var/www/kcal/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(116): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#57 /var/www/kcal/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(165): Illuminate\\Pipeline\\Pipeline->then()
#58 /var/www/kcal/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(134): Illuminate\\Foundation\\Http\\Kernel->sendRequestThroughRouter()
#59 /var/www/kcal/public/index.php(51): Illuminate\\Foundation\\Http\\Kernel->handle()
#60 {main}

I'm happy to help debug further, but I don't know any of the frameworks in use or even PHP.

Shopping List + Journal expansion

Hi, it's me again with some suggestions:

  • While kcal is currently more leaning towards a diet tracker, I think that adding shopping list functionality would be great. E.g. a "add to shopping list" button on recipes which then adds the ingredients to the shopping list.
  • Adding a food "schedule" functionality to the journal would be a great feature as well. (from what I've seen in my short time using kcal, you can "skip forward in time" on your journal, but something like an "add to schedule" on recipes button that opens a date selector GUI and then adds the recipe to that day's schedule would be great)

Sorry if this sounds unstructured/whatever, it's 23:37 for me and my brain is half asleep. If you need clarifications, I'll gladly respond tomorrow.

Add SECURITY.md

Hey there!

I belong to an open source security research community, and a member (@0xAmal) has found an issue, but doesn’t know the best way to disclose it.

If not a hassle, might you kindly add a SECURITY.md file with an email, or another contact method? GitHub recommends this best practice to ensure security issues are responsibly disclosed, and it would serve as a simple instruction for security researchers in the future.

Thank you for your consideration, and I look forward to hearing from you!

(cc @huntr-helper)

Add fragments and history state to list pages

The recipe and food listings are annoying to navigate beyond a single filter and the first page. These views should be modified to use URL fragments and update history state for easier back-and-forth navigation and link sharing.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.