Skip to content

Commit b3fab3e

Browse files
committed
Initial commit for reviews.io website
1 parent b9d2bf9 commit b3fab3e

File tree

84 files changed

+10923
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+10923
-0
lines changed

.eslintrc.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": "next/core-web-vitals"
3+
}

.gitignore

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
node_modules
6+
/.pnp
7+
.pnp.js
8+
9+
# testing
10+
/coverage
11+
12+
# next.js
13+
/.next/
14+
/out/
15+
16+
# production
17+
/build
18+
19+
# misc
20+
.DS_Store
21+
*.pem
22+
23+
# debug
24+
npm-debug.log*
25+
yarn-debug.log*
26+
yarn-error.log*
27+
28+
# local env files
29+
.env*.local
30+
.env
31+
32+
# vercel
33+
.vercel
34+
35+
# typescript
36+
*.tsbuildinfo
37+
next-env.d.ts

README.md

Lines changed: 174 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,174 @@
1+
<br/>
2+
<p align="center">
3+
<a href="https://github.com/Kaushik612/reviews.io">
4+
<img src="images/banner-1.jpg" alt="Logo" width="80" height="80">
5+
</a>
6+
<h3 align="center">Reviews.io</h3>
7+
8+
<p align="center">
9+
A Modern website which accumulates crowd-sourced reviews about restaurants
10+
<br/>
11+
</p>
12+
</p>
13+
14+
![Forks](https://img.shields.io/github/forks/Kaushik612/reviews.io?style=social) ![Stargazers](https://img.shields.io/github/stars/Kaushik612/reviews.io?style=social) ![License](https://img.shields.io/github/license/Kaushik612/reviews.io)
15+
16+
## Table Of Contents
17+
18+
- [Screenshots](#screenshots)
19+
- [About the Project](#about-the-project)
20+
- [Built With](#built-with)
21+
- [Getting Started](#getting-started)
22+
- [Prerequisites](#prerequisites)
23+
- [Installation](#installation)
24+
- [License](#license)
25+
- [Authors](#authors)
26+
27+
## Screenshots
28+
29+
![HomePage-Dark](images/screenshots/homepage1.png)
30+
31+
![HomePage-Light](images/screenshots/homepage-light.png)
32+
33+
![Restaurant-Detail](images/screenshots/restaurant-detail-page.png)
34+
35+
![Clerk-Auth](images/screenshots/clerk-auth.png)
36+
37+
![Post-Review](images/screenshots/post-review.png)
38+
39+
![Pagination](images/screenshots/pagination.png)
40+
41+
![Mobile-Responsive](images/screenshots/mobile-responsive-1.png)
42+
43+
## About The Project
44+
45+
A Modern website for reviewing your favorite Restaurants and checking out reviews from other customers.
46+
47+
The idea behind building this website is to get a good understanding of developing a fully functional Full stack application using Next.js framework and MongoDB as a backend database.
48+
49+
This application is built using all the new Next.js 13 features and also features TypeScript which makes everything just better!
50+
51+
I use Clerk for authentication which I feel makes setting up auth for your Next.js projects a breeze.
52+
53+
### Built With
54+
55+
- [![Next][Next.js]][Next-url]
56+
- [![React][React.js]][React-url]
57+
- [![Tailwind][Tailwind.css]][Tailwind-url]
58+
- [![Typescript][Typescript]][Typescript-url]
59+
- [![Prisma][Prisma]][Prisma-url]
60+
- [![MongoDB][MongoDB]][MongoDB-url]
61+
62+
### Features:
63+
64+
- Tailwind design and Framer-motion animations
65+
- Fully Responsive
66+
- Clerk Authentication (Email, Google, 9+ Social Logins)
67+
- Client form validation and handling using react-hook-form & zod
68+
- Server error handling using react-toast
69+
- Page loading state
70+
- How to write POST, DELETE, and GET routes in route handlers (app/api)
71+
- How to fetch data in server react components by directly accessing database (WITHOUT API! like Magic!)
72+
- How to handle relations between Server and Child components!
73+
- How to reuse layouts
74+
- Folder structure in Next 13 App Router
75+
- Sample About and Contact page that can be expanded as required
76+
77+
<p align="right">(<a href="#readme-top">back to top</a>)</p>
78+
79+
## Getting Started
80+
81+
### Prerequisites
82+
83+
**Node version 18.x.x**
84+
85+
### Cloning the repository
86+
87+
```shell
88+
git clone https://github.com/Kaushik612/reviews.io.git
89+
```
90+
91+
### Install packages
92+
93+
```sh
94+
npm install
95+
```
96+
97+
### Setup .env file
98+
99+
```js
100+
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=
101+
CLERK_SECRET_KEY=
102+
103+
NEXT_PUBLIC_CLERK_SIGN_IN_URL=/sign-in
104+
NEXT_PUBLIC_CLERK_SIGN_UP_URL=/sign-up
105+
NEXT_PUBLIC_CLERK_AFTER_SIGN_IN_URL=/dashboard
106+
NEXT_PUBLIC_CLERK_AFTER_SIGN_UP_URL=/dashboard
107+
108+
DATABASE_URL=
109+
110+
NEXT_PUBLIC_APP_URL="http://localhost:3000"
111+
```
112+
113+
### Setup Prisma
114+
115+
Add MongoDb Database (I am using Mongo Atlas)
116+
117+
```shell
118+
npx prisma init
119+
npx prisma generate
120+
npx prisma db push
121+
```
122+
123+
Seed Data:
124+
125+
I am using ChatGPT to generate seed data that will be fed to the database and I would suggest you do the same too. This saves a lot of time in creating test data and you can use this time to work on the UI development.
126+
127+
```shell
128+
node lib/seed.ts
129+
```
130+
131+
### Start the app
132+
133+
```shell
134+
npm run dev
135+
```
136+
137+
<p align="right">(<a href="#readme-top">back to top</a>)</p>
138+
139+
## License
140+
141+
Distributed under the MIT License. See [LICENSE](https://github.com/Kaushik612/reviews.io/blob/main/LICENSE.md) for more information.
142+
143+
## Authors
144+
145+
**Kaushik Ravikumar** - _Full Stack Web Developer_ - [Kaushik Ravikumar](https://github.com/kaushik612)
146+
147+
<!-- MARKDOWN LINKS & IMAGES -->
148+
<!-- https://www.markdownguide.org/basic-syntax/#reference-style-links -->
149+
150+
[contributors-shield]: https://img.shields.io/github/contributors/github_username/repo_name.svg?style=for-the-badge
151+
[contributors-url]: https://github.com/github_username/repo_name/graphs/contributors
152+
[forks-shield]: https://img.shields.io/github/forks/github_username/repo_name.svg?style=for-the-badge
153+
[forks-url]: https://github.com/github_username/repo_name/network/members
154+
[stars-shield]: https://img.shields.io/github/stars/github_username/repo_name.svg?style=for-the-badge
155+
[stars-url]: https://github.com/github_username/repo_name/stargazers
156+
[issues-shield]: https://img.shields.io/github/issues/github_username/repo_name.svg?style=for-the-badge
157+
[issues-url]: https://github.com/github_username/repo_name/issues
158+
[license-shield]: https://img.shields.io/github/license/github_username/repo_name.svg?style=for-the-badge
159+
[license-url]: https://github.com/github_username/repo_name/blob/master/LICENSE.txt
160+
[linkedin-shield]: https://img.shields.io/badge/-LinkedIn-black.svg?style=for-the-badge&logo=linkedin&colorB=555
161+
[linkedin-url]: https://linkedin.com/in/linkedin_username
162+
[product-screenshot]: images/screenshot.png
163+
[Next.js]: https://img.shields.io/badge/next.js-000000?style=for-the-badge&logo=nextdotjs&logoColor=white
164+
[Next-url]: https://nextjs.org/
165+
[React.js]: https://img.shields.io/badge/React-20232A?style=for-the-badge&logo=react&logoColor=61DAFB
166+
[React-url]: https://reactjs.org/
167+
[Tailwind.css]: https://img.shields.io/badge/Tailwind_CSS-38B2AC?style=for-the-badge&logo=tailwind-css&logoColor=white
168+
[Tailwind-url]: https://tailwindcss.com/
169+
[Typescript]: https://img.shields.io/badge/TypeScript-007ACC?style=for-the-badge&logo=typescript&logoColor=white
170+
[Typescript-url]: https:/typescript.org
171+
[Prisma]: https://img.shields.io/badge/Prisma-3982CE?style=for-the-badge&logo=Prisma&logoColor=white
172+
[Prisma-url]: https:/prisma.io
173+
[MongoDB]: https://img.shields.io/badge/MongoDB-4EA94B?style=for-the-badge&logo=mongodb&logoColor=white
174+
[MongoDB-url]: https:/mongodb.com

app/(auth)/(routes)/layout.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
export default function AuthLayout({
2+
children,
3+
}: {
4+
children: React.ReactNode;
5+
}) {
6+
return (
7+
<div className="flex items-center justify-center min-h-screen">
8+
{children}
9+
</div>
10+
);
11+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { SignIn } from "@clerk/nextjs";
2+
3+
export default function Page() {
4+
return <SignIn />;
5+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { SignUp } from "@clerk/nextjs";
2+
3+
export default function Page() {
4+
return <SignUp />;
5+
}

app/(links)/(routes)/about/page.tsx

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
"use client";
2+
import React from "react";
3+
4+
const AboutPage = () => {
5+
return (
6+
<section className="bg-secondary mt-5">
7+
<div className="py-8 lg:py-16 px-4 mx-auto max-w-screen-md">
8+
<h2 className="mb-4 text-4xl tracking-tight font-extrabold text-center text-gray-900 dark:text-white">
9+
About Us
10+
</h2>
11+
<p className="mb-8 lg:mb-16 font-light text-center text-gray-500 dark:text-gray-400 sm:text-xl">
12+
This is a sample About us page. Write your own unique story here!
13+
</p>
14+
<div className="flex justify-center items-center flex-wrap">
15+
<p className="text-2xl md:text-3xl font-bold text-primary leading-relaxed text-center">
16+
Lorem ipsum dolor sit amet consectetur adipisicing elit. Velit
17+
dolores dignissimos accusantium perferendis officia culpa voluptatem
18+
labore aut! Nemo facere, similique voluptatibus nulla itaque cum
19+
doloremque quidem exercitationem, vero adipisci incidunt voluptatum
20+
quaerat blanditiis mollitia, provident beatae sed culpa odit?
21+
</p>
22+
</div>
23+
</div>
24+
</section>
25+
);
26+
};
27+
28+
export default AboutPage;

app/(links)/(routes)/contact/page.tsx

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
"use client";
2+
import { Button } from "@/components/ui/button";
3+
import { Input } from "@/components/ui/input";
4+
import { Textarea } from "@/components/ui/textarea";
5+
import React from "react";
6+
7+
const ContactPage = () => {
8+
return (
9+
<section className="bg-secondary mt-10 md:mt-5">
10+
<div className="py-8 lg:py-16 px-4 mx-auto max-w-screen-md">
11+
<h2 className="mb-4 text-4xl tracking-tight font-extrabold text-center text-gray-900 dark:text-white">
12+
Contact Us
13+
</h2>
14+
<p className="mb-8 lg:mb-16 font-light text-center text-gray-500 dark:text-gray-400 sm:text-xl">
15+
Got a technical issue? Want to send feedback about a beta feature?
16+
Need details about our Business plan? Let us know.
17+
</p>
18+
<form className="space-y-8">
19+
<div>
20+
<label
21+
htmlFor="email"
22+
className="block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300"
23+
>
24+
Your email
25+
</label>
26+
<Input
27+
type="email"
28+
id="email"
29+
className="rounded-lg p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-primary-500 dark:focus:border-primary-500 dark:shadow-sm-light"
30+
placeholder="[email protected]"
31+
required
32+
/>
33+
</div>
34+
<div>
35+
<label
36+
htmlFor="subject"
37+
className="block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300"
38+
>
39+
Subject
40+
</label>
41+
<Input
42+
type="text"
43+
id="subject"
44+
className=" dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-primary-500 dark:focus:border-primary-500 dark:shadow-sm-light"
45+
placeholder="Let us know how we can help you"
46+
required
47+
/>
48+
</div>
49+
<div className="sm:col-span-2">
50+
<label
51+
htmlFor="message"
52+
className="block mb-2 text-sm font-medium text-gray-900 dark:text-gray-400"
53+
>
54+
Your message
55+
</label>
56+
<Textarea
57+
id="message"
58+
rows={6}
59+
className=" dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-primary-500 dark:focus:border-primary-500"
60+
placeholder="Leave a comment..."
61+
></Textarea>
62+
</div>
63+
<Button variant={"default"}>Send Message</Button>
64+
</form>
65+
</div>
66+
</section>
67+
);
68+
};
69+
70+
export default ContactPage;
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
"use client";
2+
import React from "react";
3+
4+
import { PuffLoader } from "react-spinners";
5+
6+
const loading = () => {
7+
return (
8+
<div className="flex justify-center items-center min-h-screen">
9+
<PuffLoader size={100} />
10+
</div>
11+
);
12+
};
13+
14+
export default loading;

0 commit comments

Comments
 (0)