-
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 branch 'main' of https://github.com/JusJira/10days-project-2023
- Loading branch information
Showing
19 changed files
with
524 additions
and
151 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,36 +1,37 @@ | ||
This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app). | ||
## Introduction | ||
|
||
## Getting Started | ||
This is our project ChadMart | ||
|
||
First, run the development server: | ||
The beginning of this project came from a Hackathon called 10 days project where each teams have 10 days to build a product from a given problem. | ||
|
||
```bash | ||
npm run dev | ||
# or | ||
yarn dev | ||
# or | ||
pnpm dev | ||
# or | ||
bun dev | ||
``` | ||
|
||
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. | ||
This was the given problem | ||
|
||
You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file. | ||
``` | ||
Problem Statement | ||
This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font. | ||
Chulalongkorn University has a digital cash giveaway policy for all students, with each receiving 10,000 Bulbs to stimulate the economy within the country. | ||
In this regard, Chulalongkorn University seeks to support a platform that enables the buying and selling of Bulbs to thrive in the Country. Therefore, we task everyone with creating a product that can promote the exchange of Bulbs between Chulalongkorn students. | ||
``` | ||
|
||
## Learn More | ||
So we created an E-Commerce product that uses digital money to buy stuff | ||
|
||
To learn more about Next.js, take a look at the following resources: | ||
## Tech Used | ||
|
||
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API. | ||
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial. | ||
These are the techs that we used in this project | ||
|
||
You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome! | ||
- [Next.js](https://nextjs.org/) - Feature rich framework for Frontend and Backed | ||
- [Kinde](https://kinde.com) - Authentication as a service | ||
- [Uploadthing](https://uploadthing.com/) - Files upload | ||
- [Prisma](https://prisma.io) - Database ORM | ||
- [PostgreSQL](https://www.postgresql.org/) - Open source database | ||
- [shadcn UI](https://ui.shadcn.com) - Next.Js UI Library | ||
- [TailwindCSS](https://tailwindcss.com) - Styling | ||
|
||
## Deploy on Vercel | ||
## Meet Our Team | ||
|
||
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js. | ||
Our team is called ![Static Badge](https://img.shields.io/badge/Chad-GPT-orange) | ||
|
||
Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details. | ||
Here are the members | ||
- [Justin](https://github.com/jusjira) - Full-Stack, UX&UI, PM | ||
- [Nick](https://github.com/creampiney)- Full-Stack, UX&UI | ||
- [V](https://github.com/hellp002)- Full-Stack, UX&UI |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import ProductBox from "@/components/productBox"; | ||
import { db } from "@/lib/db"; | ||
import { getKindeServerSession } from "@kinde-oss/kinde-auth-nextjs/server"; | ||
import React from "react"; | ||
import pluralize from "pluralize"; | ||
|
||
export default async function Page() { | ||
const { getUser } = getKindeServerSession(); | ||
const user = await getUser(); | ||
const wished = await db.user.findUnique({ | ||
where: { | ||
id: user.id as string, | ||
}, | ||
select: { | ||
wishlists: { | ||
select: { | ||
product: { | ||
select: { | ||
id: true, | ||
price: true, | ||
image: true, | ||
name: true, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}); | ||
|
||
return ( | ||
<div className="relative flex min-h-full flex-col gap-3 bg-neutral-100 p-3 dark:bg-neutral-800"> | ||
<div> | ||
<p> | ||
There are {pluralize("product", wished?.wishlists.length, true)} is | ||
your wishlist | ||
</p> | ||
</div> | ||
<div className="grid-container"> | ||
{wished?.wishlists.map((p, index) => ( | ||
<ProductBox | ||
key={index} | ||
name={p.product.name} | ||
id={p.product.id} | ||
image={p.product.image} | ||
price={p.product.price} | ||
/> | ||
))} | ||
</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
Oops, something went wrong.