-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from timia2109/feature/ui-improvements
UI improvements
- Loading branch information
Showing
21 changed files
with
263 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,5 @@ | ||
# Since .env is gitignored, you can use .env.example to build a new `.env` file when you clone the repo. | ||
# Keep this file up-to-date when you add new variables to `.env`. | ||
|
||
# This file will be committed to version control, so make sure not to have any secrets in it. | ||
# If you are cloning this repo, create a copy of this file named `.env` and populate it with your secrets. | ||
|
||
# When adding additional env variables, the schema in /env/schema.mjs should be updated accordingly | ||
|
||
# Prisma | ||
DATABASE_URL=file:./db.sqlite | ||
DATABASE_URL=mysql://root:root@db/simple-meal-plan | ||
INVITATION_VALIDITY=P30D | ||
NEXTAUTH_SECRET=A_SECRET | ||
ROOT_URL=https://example.com | ||
NEXT_PUBLIC_PRIVACY_URL=https://example.com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,27 @@ | ||
# Simple Meal Plan | ||
|
||
This is a very simple meal planner which I build in two hours. | ||
I want to replace the Excel Sheet, my girlfriend was using. | ||
Currently there a no authentication build in. So this should only deployed on private networks. | ||
Work in Progress. | ||
This is a very simple meal planner. It's main purpose is to host it as a free SaaS solution. | ||
You can use it [here](https://example.com). Anyway you can deploy it using Docker. | ||
|
||
I want to replace the Excel Sheet, my girlfriend was using. | ||
|
||
## Features | ||
|
||
![Example Screenshot](public/example.png) | ||
|
||
- Plan Meal for any date | ||
- (Tablet, Desktop): See a complete calendar of the month which is editable | ||
- Share meal plans with magic links to other users to collaborate (household, etc.) | ||
- Manage multiple meal plans per user | ||
|
||
## Techstack | ||
|
||
- [Next.js](https://nextjs.org) | ||
- [Prisma](https://prisma.io) | ||
- [Tailwind CSS](https://tailwindcss.com) | ||
- [tRPC](https://trpc.io) | ||
- [DaisyUI](https://daisyui.com) | ||
|
||
## Deployment | ||
|
||
## Screenshot | ||
![Example Screenshot](docs/example.png) | ||
You'll need a MySQL / MariaDB database. | ||
Have a look at [`.env.example`](./.env.example) or at the [schema](./src/env/schema.mjs) |
Binary file not shown.
2 changes: 2 additions & 0 deletions
2
prisma/migrations/20240805194021_remove_userid_constrant/migration.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
-- DropConstraint | ||
ALTER TABLE Account DROP KEY Account_userId_key; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import Image from "next/image"; | ||
import type { FC } from "react"; | ||
import type { Feature } from "./Features"; | ||
import { isImageFeature } from "./Features"; | ||
|
||
type Props = { | ||
feature: Feature; | ||
}; | ||
|
||
export const FeatureBox: FC<Props> = ({ feature }) => ( | ||
<div className="card bg-base-300 shadow-2xl"> | ||
{isImageFeature(feature) && ( | ||
<figure> | ||
<Image | ||
src={feature.image} | ||
alt={feature.alt} | ||
width={feature.width} | ||
height={feature.height} | ||
/> | ||
</figure> | ||
)} | ||
<div className="card-body"> | ||
<h2 className="card-title flex justify-center">{feature.heading}</h2> | ||
{feature.body.map((paragraph, index) => ( | ||
<p key={index}>{paragraph}</p> | ||
))} | ||
{feature.link && ( | ||
<div className="card-actions justify-end"> | ||
<a | ||
href={feature.link} | ||
target="_blank" | ||
className="btn btn-outline btn-secondary" | ||
> | ||
More Infos | ||
</a> | ||
</div> | ||
)} | ||
</div> | ||
</div> | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
// In this files we define the features of the landing page | ||
|
||
import { getScopedI18n } from "@/locales/server"; | ||
|
||
type Description = string; | ||
|
||
type PlainFeature = { | ||
heading: Description; | ||
body: Description[]; | ||
link?: string; | ||
}; | ||
|
||
type ImageFeature = PlainFeature & { | ||
image: string; | ||
alt: string; | ||
width: number; | ||
height: number; | ||
}; | ||
|
||
export type Feature = PlainFeature | ImageFeature; | ||
|
||
export const getFeatures: () => Promise<Feature[]> = async () => { | ||
const t = await getScopedI18n("features"); | ||
|
||
return [ | ||
{ | ||
heading: t("featureA"), | ||
image: "/example.png", | ||
alt: t("featureAImgAlt"), | ||
width: 288, | ||
height: 119, | ||
body: [t("featureADescription")], | ||
}, | ||
{ | ||
heading: t("featureB"), | ||
body: [t("featureBDescription1"), t("featureBDescription2")], | ||
image: "undraw_real_time_sync_re_nky7.svg", | ||
alt: t("featureBImgAlt"), | ||
height: 200, | ||
width: 200, | ||
}, | ||
{ | ||
heading: t("featureC"), | ||
body: [t("featureCDescription")], | ||
image: "undraw_eating_together_re_ux62.svg", | ||
alt: t("featureCImgAlt"), | ||
height: 200, | ||
width: 200, | ||
}, | ||
{ | ||
heading: t("featureD"), | ||
body: [t("featureDDescription")], | ||
}, | ||
{ | ||
heading: t("featureE"), | ||
body: [t("featureEDescription")], | ||
link: "https://github.com/timia2109/simple-meal-plan", | ||
}, | ||
]; | ||
}; | ||
|
||
export const isImageFeature = (feature: Feature): feature is ImageFeature => | ||
"image" in feature; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.