Kitkatnik / ks-MealMind

Revolutionize your meal planning and enjoy eating again with MealMind, the open-source app for people with picky eating habits and ADHD.
https://mealmind.app
MIT License
9 stars 0 forks source link
material-ui nextjs open-source refine supabase typescript

MealMind

![33837_MealMind_Banner](https://user-images.githubusercontent.com/5871075/221132705-25a49e61-1f9b-432a-95c8-41b540436479.png) [Click Here to Demo](https://www.mealmind.app) You can tour this app's repo using [CodeSee](https://app.codesee.io/maps/public/5db76fa0-b54f-11ed-a159-e35b74d3b925). See the [Refine Hackathon submission here](https://devpost.com/software/food-tracking-app). Checkout our [Roadmap](https://mealmind.hellonext.co/roadmap) and [Changelog](https://mealmind.hellonext.co/changelog)

About

💼 Project Description

MealMind is a food tracking & meal planning app that helps people with Avoidant/Restrictive Food Intake Disorder (ARFID) and Attention Deficit Hyperactivity Disorder (ADHD) improve their eating habits. As someone who suffers from both ARFID and ADHD, I know first-hand how difficult it is to just eat... especially when certain foods or textures are a struggle to eat... or when I just forget to eat all day for no other reason than "I forgot" (oops). That's why I created MealMind, to make meal planning an enjoyable and stress-free experience.

I wanted to challenge myself and learn a new tech stack that I've never used before, so I chose to build MealMind using Nextjs/Typescript, Material UI (and a tiny bit of Ant Design), and Supabase. I went through superplate's set up of Refine.dev and also set up React Hook Forms and light/dark mode. While I didn't have time to fully utilize the i18n (important for me as a spanish speaker) and kbar interface, I plan to incorporate them more in the future to make MealMind even more user-friendly.

Creating MealMind has been the most important project for me. I wanted to build a tool that not only helps me manage my own eating habits, but also helps others with similar struggles. That's why I'm excited to make this an open-source project (my very first one as well), so that others can benefit from it and contribute to its development. I hope that MealMind can help those with ARFID and ADHD feel more confident in their ability to plan and enjoy their meals, and I'm excited to see how it evolves as a community-driven project :)

🖥 Tech Stack

HTML5 Badge CSS3 Badge Material Design Badge Material Design Icons Badge Ant Design Badge styled-components Badge JavaScript Badge TypeScript Badge Next.js Badge React Badge React Hook Form Badge React Table Badge React Query Badge Supabase Badge PostgreSQL Badge Postman Badge Vercel Badge Node.js Badge Yarn Badge

This refine project was generated with superplate.

🧠 What I learned

👤 Hackathon & Participant Info

refine Open Source Hackathon:

refine is a React-based framework for the rapid ✨ development of CRUD web applications. It eliminates the repetitive tasks demanded by CRUD operations and provides industry standard solutions for critical parts like authentication, access control, routing, networking, state management, and i18n. refine shines on data-intensive applications like admin panels, dashboards, internal tools and storefronts.

We're proud to have reached thousands of developers who used refine in our first year, and we couldn't have done it without an open source community! To celebrate this achievement with the community, we are excited to announce the launch of the first hackathon event.

This hackathon is an excellent opportunity for developers to showcase their skills and learn refine!

PARTICIPANT

Katya Sarmiento

GitHub | LinkedIn | Twitter (not active)

HACKATHON RESULT

ANNOUNCEMENT: https://refine.dev/blog/refine-hackathon-winners/

WON: Most Visually Pleasing

blog_2023-02-28-hackathon-january-winners_Group 768

👀 Preview

Sign in or create a new account to start using MealMind:

MealMind sign in page


DARK MODE: Sign in or create a new account to start using MealMind:

MealMind dark mode sign in page


See a list of all your foods and quickly see what you've rated them:

MealMind list of food items page


DARK MODE: See a list of all your foods and quickly see what you've rated them:

MealMind dark mode list of food items page


Filter through all your food items with categories:

MealMind filter food items


Create new food items with categories, eating & purchase locations, and notes:

MealMind adding new food items


Add new food items directly from the categories menu:

MealMind categories page with adding new food items


DARK MODE: Add new food items directly from the categories menu:

MealMind dark mode categories page with adding new food items


See all your foods organized into category buckets:

MealMind food items in category buckets


See a list of all your meal plans and date:

MealMind list of meal plans page


DARK MODE: See a list of all your meal plans and dates:

MealMind dark mode list of meal plans page


Create a new meal plan for any day:

MealMind create a new meal plan


Click into your meal plan to see more information and plan meals for breakfast, lunch, and dinner:

MealMind meal plan info page


DARK MODE: Click into your meal plan to see more information and plan meals for breakfast, lunch, and dinner:

MealMind dark mode meal plan info page


Roadmap

You can check out our up-to-date roadmap here.

Set up Project

Database Set up

Sign up for a Supabase account

Create the following tables, triggers, functions, and RLS policies...

PROFILES

TABLE

FUNCTION

begin
  insert into public.profiles (user_auth, email, created_at, updated_at)
  values (new.id, new.email, new.created_at, new.updated_at);
  return new;
end;

TRIGGER

RLS POLICIES

SELECT - Profiles are viewable by users who created them

BEGIN;
  ALTER POLICY "Profiles are viewable by users who created them." ON "public"."profiles" USING ((auth.uid() = user_auth);
COMMIT;

UPDATE - Users can update their own profile

BEGIN;
  ALTER POLICY "Users can update own profile." ON "public"."profiles" USING ((auth.uid() = user_auth);
COMMIT;

CATEGORIES

TABLE

ROWS

Add the following categories or create your own:

RLS POLICIES

Disabled

FOODS

RLS POLICIES

INSERT - All users can insert foods

BEGIN;
  ALTER POLICY "All users can insert foods" ON "public"."foods" WITH CHECK (true);
COMMIT;

SELECT - Users can see foods they've entered

BEGIN;
  ALTER POLICY "Users can see foods they've entered" ON "public"."foods" USING ((auth.uid() = added_by_auth);
COMMIT;

UPDATE - Users can update foods they've entered

BEGIN;
  ALTER POLICY "Users can update foods they've entered" ON "public"."foods" USING ((auth.uid() = added_by_auth);
COMMIT;

MEAL PLANS

TABLE

RLS POLICIES

ALL - Enable all meal plan actions for user based on id

BEGIN;
  ALTER POLICY "Enable all meal plan actions for user based on id." ON "public"."meal_plans" USING ((auth.uid() = added_by_auth);
COMMIT;

MEAL PLAN MEALS

TABLE

RLS POLICIES

INSERT - Users can add meals to meal plans

BEGIN;
  ALTER POLICY "Users can add meals to meal plans" ON "public"."meal_plan_meals" WITH CHECK (true);
COMMIT;

SELECT - Users can see the meals they've entered

BEGIN;
  ALTER POLICY "Users can see the meals they've entered" ON "public"."meal_plan_meals" USING ((auth.uid() = added_by_auth);
COMMIT;

Authentication

Set up Authentication with Supabase - Click Here for Docs

Prerequisites

Install Project

cd directory
npm install

Set up local env variables

Add your Supabase API URL and KEY

Environments

Running the development server.

    yarn dev

Building for production.

    yarn build

Running the production server.

    yarn start

Learn More

To learn more about refine, please check out the Documentation

License

MIT