Skip to content

Commit

Permalink
[RAB-7] Merge branch 'master' into feature/RAB-7-matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
Marek Miklaszewski committed May 22, 2023
2 parents 897bb4e + cdaadbe commit 841e108
Show file tree
Hide file tree
Showing 94 changed files with 8,399 additions and 1,571 deletions.
47 changes: 46 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,53 @@
# JetBrains IDE
.idea/
# These are some examples of commonly ignored file patterns.
# You should customize this list as applicable to your project.
# Learn more about .gitignore:
# https://www.atlassian.com/git/tutorials/saving-changes/gitignore

# Node artifact files
node_modules/
dist/

.env
.env
# Compiled Java class files
*.class

# Compiled Python bytecode
*.py[cod]

# Log files
*.log

# Package files
*.jar

# Maven
target/
dist/

# JetBrains IDE
.idea/

# Unit test reports
TEST*.xml

# Generated by MacOS
.DS_Store

# Generated by Windows
Thumbs.db

# Applications
*.app
*.exe
*.war

# Large media files
*.mp4
*.tiff
*.avi
*.flv
*.mov
*.wmv

7 changes: 7 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"deno.enable": true,
"deno.lint": true,
"deno.unstable": true,
"deno.enablePaths": ["./packages/functions/supabase/functions"],
"deno.importMap": "./packages/functions/supabase/functions/import_map.json"
}
4 changes: 4 additions & 0 deletions apps/next-app/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
NEXT_PUBLIC_SUPABASE_URL=<YOUR_SUPABASE_URL>
NEXT_PUBLIC_SUPABASE_GRAPHQL_URL=<YOUR_SUPABASE_GRAPHQL_URL>
NEXT_PUBLIC_SUPABASE_ANON_KEY=<YOUR_SUPABASE_ANON_KEY>
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=<YOUR_STRIPE_PUBLISHABLE_KEY>
6 changes: 6 additions & 0 deletions apps/next-app/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": ["next", "next/core-web-vitals", "prettier"],
"rules": {
"no-console": "warn"
}
}
36 changes: 36 additions & 0 deletions apps/next-app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# 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*

# local env files
.env
.env*.local

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts
5 changes: 5 additions & 0 deletions apps/next-app/.husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

cd apps/next-app
npx lint-staged --verbose
10 changes: 10 additions & 0 deletions apps/next-app/.lintstagedrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
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 --write'],
};
3 changes: 3 additions & 0 deletions apps/next-app/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"singleQuote": true
}
38 changes: 38 additions & 0 deletions apps/next-app/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
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).

## Getting Started

First, run the development server:

```bash
npm run dev
# or
yarn dev
# or
pnpm dev
```

Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.

You can start editing the page by modifying `pages/index.tsx`. The page auto-updates as you edit the file.

[API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed on [http://localhost:3000/api/hello](http://localhost:3000/api/hello). This endpoint can be edited in `pages/api/hello.ts`.

The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/api-routes/introduction) instead of React pages.

This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font.

## Learn More

To learn more about Next.js, take a look at the following resources:

- [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.

You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!

## Deploy on Vercel

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.

Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
28 changes: 28 additions & 0 deletions apps/next-app/codegen.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { CodegenConfig } from '@graphql-codegen/cli';
import { loadEnvConfig } from '@next/env';

const projectDir = process.cwd();
loadEnvConfig(projectDir);

const config: CodegenConfig = {
schema: [
{
[`${process.env.NEXT_PUBLIC_SUPABASE_GRAPHQL_URL}`]: {
headers: {
apikey: `${process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY}`,
},
},
},
],
documents: ['src/**/*.tsx'],
generates: {
'./src/graphql/__generated/gql/': {
documents: ['src/**/*.graphql.ts', 'src/**/*.ts', 'src/**/*.tsx'],
preset: 'client',
plugins: [],
},
},
ignoreNoDocuments: true,
};

export default config;
13 changes: 13 additions & 0 deletions apps/next-app/jest.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import nextJest from 'next/jest.js';

const createJestConfig = nextJest({
dir: './',
});

/** @type {import('jest').Config} */
const config = {
setupFilesAfterEnv: ['<rootDir>/jest.setup.ts'],
testEnvironment: 'jest-environment-jsdom',
};

export default createJestConfig(config);
2 changes: 2 additions & 0 deletions apps/next-app/jest.setup.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import '@testing-library/jest-dom';
import '@testing-library/jest-dom/extend-expect';
48 changes: 48 additions & 0 deletions apps/next-app/next.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
webpack(config) {
// Grab the existing rule that handles SVG imports
const fileLoaderRule = config.module.rules.find((rule) =>
rule.test?.test?.('.svg')
);

config.module.rules.push(
// Reapply the existing rule, but only for svg imports ending in ?url
{
...fileLoaderRule,
test: /\.svg$/i,
resourceQuery: /url/, // *.svg?url
},
// Convert all other *.svg imports to React components
{
test: /\.svg$/i,
issuer: /\.[jt]sx?$/,
resourceQuery: { not: /url/ }, // exclude if *.svg?url
use: ['@svgr/webpack'],
}
);

// Modify the file loader rule to ignore *.svg, since we have it handled now.
fileLoaderRule.exclude = /\.svg$/i;

return config;
},
images: {
remotePatterns: [
{
protocol: 'https',
hostname: 'lh3.googleusercontent.com',
port: '',
},
{
protocol: 'https',
hostname: 'fqtxlumxbzkmspqovtcw.supabase.co',

port: '',
},
],
},
};

module.exports = nextConfig;
61 changes: 61 additions & 0 deletions apps/next-app/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
{
"name": "@ab/next-app",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint",
"test": "jest",
"test:watch": "jest --watch",
"codegen": "graphql-codegen",
"codegen:watch": "graphql-codegen --watch",
"prepare": "cd ../.. && husky install apps/next-app/.husky"
},
"dependencies": {
"@apollo/client": "^3.7.12",
"@graphql-typed-document-node/core": "^3.2.0",
"@headlessui/react": "^1.7.14",
"@next/env": "^13.3.0",
"@stripe/stripe-js": "^1.52.1",
"@supabase/auth-helpers-nextjs": "^0.6.1",
"@supabase/auth-helpers-react": "^0.3.1",
"@supabase/supabase-js": "^2.21.0",
"@types/node": "18.15.11",
"@types/react": "18.0.37",
"@types/react-dom": "18.0.11",
"autoprefixer": "10.4.14",
"date-fns": "^2.29.3",
"@vm/api-client": "*",
"@vm/graphql": "*",
"eslint": "8.38.0",
"eslint-config-next": "13.3.0",
"graphql": "^16.6.0",
"graphql-yoga": "^3.9.1",
"next": "13.3.0",
"postcss": "8.4.22",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-hook-form": "^7.43.9",
"stripe": "^12.2.0",
"tailwind-merge": "^1.12.0",
"tailwindcss": "3.3.1",
"typescript": "5.0.4"
},
"devDependencies": {
"@graphql-codegen/cli": "^3.3.0",
"@graphql-codegen/client-preset": "^3.0.0",
"@svgr/webpack": "^7.0.0",
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^14.0.0",
"@types/jest": "^29.5.0",
"@types/testing-library__jest-dom": "^5.14.5",
"eslint-config-prettier": "^8.8.0",
"jest": "^29.5.0",
"jest-environment-jsdom": "^29.5.0",
"lint-staged": "^13.2.1",
"supabase": "^1.50.12",
"@prisma/nextjs-monorepo-workaround-plugin": "^4.13.0"
}
}
6 changes: 6 additions & 0 deletions apps/next-app/postcss.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
};
Binary file added apps/next-app/public/favicon.ico
Binary file not shown.
1 change: 1 addition & 0 deletions apps/next-app/public/next.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions apps/next-app/public/vercel.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions apps/next-app/src/assets/check-mark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions apps/next-app/src/assets/cross-mark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions apps/next-app/src/constants/EDGE_FUNCTION_NAMES.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export enum EDGE_FUNCTION_NAMES {
GET_SUBSCRIPTION_PLANS = '/get-subscription-plans',
CHECKOUT_SESSION = '/checkout-session',
CREATE_CUSTOMER = '/create-customer',
GET_STRIPE_CHARGES = '/get-stripe-charges',
RETRIEVE_CHECKOUT_SESSION = '/get-checkout-session',
}
11 changes: 11 additions & 0 deletions apps/next-app/src/constants/ROUTES.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
export enum ROUTES {
LOGIN = '/auth/login',
PROVIDER = '/auth/provider',
HOME = '/',
DASHBOARD = '/dashboard',
PROFILE = '/profile',
SUBSCRIPTION = '/subscription',
SUBSCRIPTION_SUCCESS = '/subscription/success',
SUBSCRIPTION_CANCEL = '/subscription/cancel',
ANALYTICS = '/analytics',
}
4 changes: 4 additions & 0 deletions apps/next-app/src/constants/SUBSCRIPTION_PLAN.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export enum SUBSCRIPTION_PLAN {
BASIC = 'basic',
PRO = 'pro',
}
Loading

0 comments on commit 841e108

Please sign in to comment.