Giter Club home page Giter Club logo

kcalcalc's Introduction

kcalCalc

A free calorie counting app made to fit my needs.

Give it a shot at kcal-calc.vercel.app

Mobile Day View Item Selection Mobile Week View
DayView SelectItemSearch WeekGraph
Desktop Unified View
Unified View

Self Hosting

kcalCalc can be self-hosted for free using Firebase and a Cloud Host like Vercel.

Setup Firebase

  • Create new Firebase Project
  • Create Web App
  • Copy following env values for later:
    • VITE_APIKEY
    • VITE_AUTHDOMAIN
    • VITE_PROJECTID
    • VITE_STORAGEBUCKET
    • VITE_MESSAGINGSENDERID
    • VITE_APPID
  • Enable Auth: Go to "Authentication" > "Get started" > "Google" > "Enable" > set "Project support email" field > "Save"
    • Also set up your hosted app Domain under "Authentication" > "Settings" > "Authorized domains"
  • Enable Firestore: Go to "Firestore Database" > "Create database" > "Start in test mode" > "Next" > set "Cloud Firestore location" field near you > "Enable"
  • Setup Rules: "Firestore Database" > "Rules" > paste following
    • rules_version = '2';
      service cloud.firestore {
        match /databases/{database}/documents {
            match /Users/{userId}/{documents=**} {
            allow read, write: if userId == request.auth.uid;
          }
        }
      }

Host frontend

  • You can use a service like Vercel to host the frontend.
  • Fork the repo and login to Vercel via GitHub
  • Create a new project using the forked repo and add the env variables from above

Development

  • Copy env variables in a .env file

  • pnpm i

  • pnpm dev

  • firebase emulator usage can be toggled via VITE_USE_EMULATION=true.

  • firebase cli

    • install curl -sL https://firebase.tools | bash
    • firebase login
    • firebase emulators:start

Svelte Style Guide

  • Layout: Script, Markup, Styles
  • Script Layout: Imports, createEventDispatcher, export props, local state, reactive statements, functions.
  • Hints that you component is too complicated:
    • If you feel like you want to organize script differently
    • ~6 Levels of Indentation max
    • ~300LOC max

kcalcalc's People

Contributors

sarcevicantonio avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

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.