Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
pulkit-30 committed Sep 29, 2024
0 parents commit 005b486
Show file tree
Hide file tree
Showing 93 changed files with 16,559 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# github
GITHUB_ID=''
GITHUB_SECRET=''

# next-auth
NEXTAUTH_SECRET=''
NEXTAUTH_URL='http://localhost:3000'

# postgres database
POSTGRES_URL=''
POSTGRES_PRISMA_URL=''
POSTGRES_URL_NO_SSL=''
POSTGRES_URL_NON_POOLING=''
POSTGRES_USER=''
POSTGRES_HOST=''
POSTGRES_PASSWORD=''
POSTGRES_DATABASE=''

# app essentials
APP_URL='https://localhost:3000/'

# stripe
STRIPE_SECRET_KEY=''
STRIPE_WEBHOOK_SECRET_KEY=''
STRIPE_SUBSCRIPTION_PRICE_ID=''
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=''

# google analytics
GOOGLE_SITE_VERIFICATION_ID=''
5 changes: 5 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
dist/*
.cache
public
node_modules
*.esm.js
48 changes: 48 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
module.exports = {
parser: '@typescript-eslint/parser',
extends: [
'next/core-web-vitals',
'prettier',
'eslint:recommended',
'plugin:prettier/recommended',
'plugin:@typescript-eslint/recommended',
'plugin:tailwindcss/recommended',
'plugin:storybook/recommended',
],
plugins: ['simple-import-sort', 'prettier', '@typescript-eslint'],
rules: {
'prettier/prettier': [
'error',
{
endOfLine: 'auto',
},
],
'sort-imports': 'off',
'tailwindcss/no-custom-classname': 'off',
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-require-imports': 'off',
'simple-import-sort/imports': [
2,
{
groups: [
['^.+\\.s?css$'],
[
`^(${require('module').builtinModules.join('|')})(/|$)`,
'^react',
'^@?\\w',
],
['^components(/.*|$)'],
['^lib(/.*|$)', '^hooks(/.*|$)'],
['^\\.'],
],
},
],
},
settings: {
tailwindcss: {
callees: ['cn'],
config: 'tailwind.config.js',
},
},
};
9 changes: 9 additions & 0 deletions .github/issue-template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
### Describe the feature / bug 📝:

N/A

### Steps to reproduce the bug 🔁:

1.
2.
3.
11 changes: 11 additions & 0 deletions .github/pull-request-template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
### Issue 😱:

Closes https://github.com/Skolaczk/next-starter/issues

### What has been done ✅:

- [ ]

### Screenshots/Videos 🎥:

N/A
22 changes: 22 additions & 0 deletions .github/workflows/i18n.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Checks if all Translations are present & valid
name: Ninja i18n action

on: pull_request_target

permissions:
pull-requests: write # Necessary to comment on PRs
issues: read # Necessary to read issue comments
contents: read # Necessary to access the repo content

jobs:
ninja-i18n:
name: Ninja - i18n Lint Action
runs-on: ubuntu-latest

steps:
- name: Run Ninja i18n
# @main ensures that the latest version of the action is used
uses: opral/ninja-i18n-action@main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

23 changes: 23 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Code check

on:
pull_request:
branches:
- main

jobs:
lint:
name: Eslint, Typescript, prettier and test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: npm install
- name: ESLint
run: npm run lint
- name: Type check
run: npm run typecheck
- name: Prettier
run: npm run format:check
- name: Tests
run: npm run test
39 changes: 39 additions & 0 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Playwright Tests
on:
push:
branches:
- main
- master
- develop
pull_request: null
workflow_dispatch: null

jobs:
test:
timeout-minutes: 60
runs-on: ubuntu-latest
env:
APP_URL: ${{ secrets.APP_URL }}
GITHUB_ID: ${{ secrets.AUTH_GITHUB_ID }}
GITHUB_SECRET: ${{ secrets.AUTH_GITHUB_SECRET }}
NEXTAUTH_SECRET: ${{ secrets.NEXTAUTH_SECRET }}
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY: ${{ secrets.NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY }}
STRIPE_SECRET_KEY: ${{ secrets.STRIPE_SECRET_KEY }}
STRIPE_SUBSCRIPTION_PRICE_ID: ${{ secrets.STRIPE_SUBSCRIPTION_PRICE_ID}}
STRIPE_WEBHOOK_SECRET_KEY: ${{ secrets.STRIPE_WEBHOOK_SECRET_KEY }}
# TODO add postgres env variables
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- name: Install dependencies
run: npm i
- name: Install playwright browsers
run: npx playwright install --with-deps
- name: Run tests
run: npm run e2e
- uses: actions/upload-artifact@v3
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 30
52 changes: 52 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# 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
.idea
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# local env files
.env
.env*.local

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts

# eslint cache
.eslintcache

# next-sitemap
robots.txt
sitemap.xml
sitemap-*.xml
/test-results/
/playwright-report/
/blob-report/
/playwright/.cache/

*storybook.log
storybook-static/
1 change: 1 addition & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npx --no -- commitlint --edit $1
2 changes: 2 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

npx lint-staged
4 changes: 4 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules
/public
/dist
/build
8 changes: 8 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module.exports = {
endOfLine: 'auto',
semi: true,
singleQuote: true,
jsxSingleQuote: false,
trailingComma: 'es5',
tabWidth: 2,
};
18 changes: 18 additions & 0 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import type { StorybookConfig } from '@storybook/nextjs';

const config: StorybookConfig = {
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
addons: [
'@storybook/addon-onboarding',
'@storybook/addon-links',
'@storybook/addon-essentials',
'@chromatic-com/storybook',
'@storybook/addon-interactions',
],
framework: {
name: '@storybook/nextjs',
options: {},
},
staticDirs: ['../public'],
};
export default config;
15 changes: 15 additions & 0 deletions .storybook/preview.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import type { Preview } from '@storybook/react';
import '../src/styles/globals.css';

const preview: Preview = {
parameters: {
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/i,
},
},
},
};

export default preview;
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
- tailwind css ✅
- storybook ✅
- prisma(postgres) ✅
- prettier ✅
- eslint ✅
- shadcn ✅
- vercel deployment ✅
- pre-commit hook ✅
- jest ✅
- playwright ✅
- next-auth ✅
- i18n ✅
- stripe
- docker
- k8s/
1 change: 1 addition & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = { extends: ['@commitlint/config-conventional'] };
20 changes: 20 additions & 0 deletions components.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"$schema": "https://ui.shadcn.com/schema.json",
"style": "new-york",
"rsc": true,
"tsx": true,
"tailwind": {
"config": "tailwind.config.ts",
"css": "src/styles/globals.css",
"baseColor": "neutral",
"cssVariables": true,
"prefix": ""
},
"aliases": {
"components": "@/components",
"utils": "@/lib/utils",
"ui": "@/components/ui",
"lib": "@/lib",
"hooks": "@/hooks"
}
}
39 changes: 39 additions & 0 deletions docker/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# ignore these modules while building the image

.husky
.next
.vscode
.github
.storybook

# git
.git
.gitignore

node_modules
docker
coverage
dist
tmp
temp

.pnpm
.pnpm-store

# env files
.env
.env.example

# eslint
.eslintcache
.eslintignore
.eslintrc.js

# prettier
.prettierrc.js
.prettierignore


# non essential files
next-env.d.ts
tsconfig.tsbuildinfo
Empty file added docker/docker-compose.yml
Empty file.
Loading

0 comments on commit 005b486

Please sign in to comment.