-
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.
feat: Ecommerce Platform using Nextjs, Typescript and Tailwind CSS
- Loading branch information
0 parents
commit 7763dfc
Showing
123 changed files
with
15,062 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# EditorConfig is awesome: https://EditorConfig.org | ||
|
||
# top-most EditorConfig file | ||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
indent_size = 2 | ||
end_of_line = crlf | ||
charset = utf-8 | ||
trim_trailing_whitespace = false | ||
insert_final_newline = false |
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,34 @@ | ||
############################### | ||
###### REQUIRED ENV VARS ###### | ||
############################### | ||
|
||
# Postgres Database via Supabase | ||
# Get your Postgres Database URL here: https://supabase.com/partners/integrations/prisma | ||
DATABASE_URL= | ||
|
||
# Generate a random secret here: https://generate-secret.vercel.app/32 | ||
NEXTAUTH_SECRET= | ||
NEXTJWT_SECRET= | ||
|
||
NEXTAUTH_URL= | ||
FRONTEND_URL= | ||
|
||
# Required for Google Auth | ||
# Learn how to set this up here: https://next-auth.js.org/providers/google | ||
GOOGLE_CLIENT_ID= | ||
GOOGLE_CLIENT_SECRET= | ||
|
||
############################### | ||
###### ADDITIONAL ENV VARS #### | ||
############################### | ||
|
||
# SMTP Creds | ||
# Required for Sending Transaction Emails | ||
MAIL_HOST= | ||
MAIL_PORT= | ||
MAIL_USERNAME= | ||
MAIL_PASSWORD= | ||
|
||
|
||
|
||
|
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,28 @@ | ||
{ | ||
"env": { | ||
"browser": true, | ||
"es2021": true, | ||
"node": true | ||
}, | ||
"extends": [ | ||
"eslint:recommended", | ||
"plugin:react/recommended", | ||
"plugin:@typescript-eslint/recommended", | ||
"next/core-web-vitals", | ||
"prettier" | ||
], | ||
"parser": "@typescript-eslint/parser", | ||
"parserOptions": { | ||
"ecmaFeatures": { | ||
"jsx": true | ||
}, | ||
"ecmaVersion": "latest", | ||
"sourceType": "module" | ||
}, | ||
"plugins": ["react", "@typescript-eslint"], | ||
"rules": { | ||
"@typescript-eslint/no-var-requires": "off", | ||
"@typescript-eslint/no-explicit-any": "off", | ||
"react/no-unescaped-entities": "off" | ||
} | ||
} |
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,41 @@ | ||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. | ||
|
||
# dependencies | ||
/node_modules | ||
/.pnp | ||
.pnp.js | ||
|
||
# testing | ||
/coverage | ||
|
||
# next.js | ||
/.next/ | ||
/out/ | ||
|
||
# production | ||
/build | ||
|
||
# misc | ||
.DS_Store | ||
*.pem | ||
|
||
# debug | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
.pnpm-debug.log* | ||
|
||
# local env files | ||
.env*.local | ||
.env*.prod | ||
.env | ||
|
||
# vercel | ||
.vercel | ||
|
||
# typescript | ||
*.tsbuildinfo | ||
|
||
/test-results/ | ||
/playwright-report/ | ||
/playwright/.cache/ |
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,6 @@ | ||
#!/bin/sh | ||
. "$(dirname "$0")/_/husky.sh" | ||
|
||
echo 'running commit-msg checks...' | ||
|
||
npx --no -- commitlint --edit "${1}" |
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,6 @@ | ||
#!/usr/bin/env sh | ||
. "$(dirname -- "$0")/_/husky.sh" | ||
|
||
echo 'running pre-commiting checks...' | ||
|
||
npx lint-staged |
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,11 @@ | ||
const path = require('path'); | ||
|
||
const buildEslintCommand = (filenames) => | ||
`next lint --fix --file ${filenames | ||
.map((f) => path.relative(process.cwd(), f)) | ||
.join(' --file ')}`; | ||
|
||
module.exports = { | ||
'*.{js,jsx,ts,tsx}': [buildEslintCommand], | ||
'*': 'prettier --ignore-unknown --write', | ||
}; |
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 @@ | ||
18.16.1 |
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,4 @@ | ||
yarn.lock | ||
node_modules | ||
.next | ||
.mailing |
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,12 @@ | ||
{ | ||
"recommendations": [ | ||
"dbaeumer.vscode-eslint", | ||
"esbenp.prettier-vscode", | ||
"editorconfig.editorconfig", | ||
"prisma.prisma", | ||
"bradlc.vscode-tailwindcss", | ||
"ms-playwright.playwright", | ||
"formulahendry.auto-close-tag", | ||
"formulahendry.auto-rename-tag" | ||
] | ||
} |
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,11 @@ | ||
{ | ||
"editor.codeActionsOnSave": { | ||
"source.fixAll.eslint": "explicit" | ||
}, | ||
"editor.formatOnSave": true, // Tell VSCode to format files on save | ||
"editor.defaultFormatter": "esbenp.prettier-vscode", | ||
"[prisma]": { | ||
"editor.defaultFormatter": "Prisma.prisma" | ||
}, // Tell VSCode to use Prettier as default file formatter | ||
"typescript.tsdk": "node_modules\\typescript\\lib" | ||
} |
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,77 @@ | ||
# Design Palace | ||
|
||
Implementing Ecommerce in Next.js(13), Tailwind & Typescript | ||
|
||
- **Framework**: [Next.js](https://nextjs.org/) | ||
- **Database**: [PostgreSQL](https://www.postgresql.org/) | ||
- **ORM**: [Prisma](https://prisma.io/) | ||
- **Authentication**: [NextAuth.js](https://next-auth.js.org/) | ||
- **Deployment**: [Vercel](https://vercel.com) | ||
- **Styling**: [Tailwind CSS](https://tailwindcss.com/) | ||
|
||
## Environment Variables | ||
|
||
To run this project, you will need to add the following environment variables to your `.env` file | ||
|
||
```bash | ||
# Database URL for prisma | ||
DATABASE_URL="postgresql://johndoe:randompassword@localhost:5432/mydb?schema=public" | ||
|
||
# URL of the website | ||
NEXTAUTH_URL='http://localhost:3000' | ||
FRONTEND_URL='http://localhost:3000' | ||
|
||
# Used to hash tokens, sign/encrypt cookies and ... | ||
# You can quickly create a good value with this command | ||
# openssl rand -base64 32 | ||
NEXTAUTH_SECRET=VJmi1XgBd48qWC2xn/kNRc15OIY+P4a1uXgV42uaHuw= | ||
NEXTJWT_SECRET=VDexd3kY#q8W!2o$6vVz9*mr&Np@^gLQ | ||
|
||
# Google oAuth | ||
GOOGLE_CLIENT_ID=YOUR_GOOGLE_CLIENT_ID | ||
GOOGLE_CLIENT_SECRET=YOUR_GOOGLE_CLIENT_SECRET | ||
|
||
# SMTP creds | ||
MAIL_HOST=YOUR_SMTP_HOST | ||
MAIL_PORT=YOUR_SMTP_PORT | ||
MAIL_USERNAME=YOUR_SMTP_USERNAME | ||
MAIL_PASSWORD=YOUR_SMTP_PASSWORD | ||
``` | ||
|
||
## Run Locally | ||
|
||
Clone the project | ||
|
||
```bash | ||
git clone https://github.com/karan0805/design-palace.git | ||
``` | ||
|
||
Go to the project directory | ||
|
||
```bash | ||
cd design-palace | ||
``` | ||
|
||
Install dependencies | ||
|
||
```bash | ||
npm install | ||
``` | ||
|
||
Apply migrations to database | ||
|
||
```bash | ||
npm run migrate-dev | ||
``` | ||
|
||
Seed the database | ||
|
||
```bash | ||
npm run db-seed | ||
``` | ||
|
||
Start the server | ||
|
||
```bash | ||
npm run dev | ||
``` |
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,3 @@ | ||
module.exports = { | ||
extends: ['@commitlint/config-conventional'], | ||
}; |
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,5 @@ | ||
/// <reference types="next" /> | ||
/// <reference types="next/image-types/global" /> | ||
|
||
// NOTE: This file should not be edited | ||
// see https://nextjs.org/docs/basic-features/typescript for more information. |
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,21 @@ | ||
import { DefaultSeoProps } from 'next-seo'; | ||
|
||
const config: DefaultSeoProps = { | ||
defaultTitle: 'Design Palace', | ||
titleTemplate: '%s | Design Palace', | ||
description: `Explore and buy thousands of seamless pattern and textile designs from the world's largest online collection of textile.`, | ||
canonical: 'https://design-palace.vercel.app/', | ||
openGraph: { | ||
type: 'website', | ||
locale: 'en_IE', | ||
url: 'https://design-palace.vercel.app/', | ||
siteName: 'Design Palace', | ||
}, | ||
twitter: { | ||
handle: '@handle', | ||
site: '@site', | ||
cardType: 'summary_large_image', | ||
}, | ||
}; | ||
|
||
export default config; |
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,30 @@ | ||
// @ts-check | ||
/** | ||
* Run `build` or `dev` with `SKIP_ENV_VALIDATION` to skip env validation. | ||
* This is especially useful for Docker builds. | ||
*/ | ||
!process.env.SKIP_ENV_VALIDATION && (await import('./src/env/server.mjs')); | ||
|
||
/** @type {import('next').NextConfig} */ | ||
const nextConfig = { | ||
reactStrictMode: true, | ||
swcMinify: true, | ||
images: { | ||
remotePatterns: [ | ||
{ | ||
protocol: 'https', | ||
hostname: '**.githubusercontent.com', | ||
}, | ||
{ | ||
protocol: 'https', | ||
hostname: '**.googleusercontent.com', | ||
}, | ||
], | ||
}, | ||
output: 'standalone', | ||
typescript: { | ||
ignoreBuildErrors: true, | ||
}, | ||
}; | ||
|
||
export default nextConfig; |
Oops, something went wrong.