Skip to content

Commit

Permalink
refactor(app): add nextjs starter and rename old app
Browse files Browse the repository at this point in the history
  • Loading branch information
david-focused committed Apr 21, 2022
1 parent 4f0d577 commit f571490
Show file tree
Hide file tree
Showing 68 changed files with 513 additions and 5,049 deletions.
52 changes: 32 additions & 20 deletions app/.gitignore
Original file line number Diff line number Diff line change
@@ -1,25 +1,37 @@
# Logs
logs
*.log
# 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*
lerna-debug.log*

node_modules
/dist
/coverage
dist-ssr
*.local
# local env files
.env.local
.env.development.local
.env.test.local
.env.production.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
# vercel
.vercel

# typescript
*.tsbuildinfo
23 changes: 23 additions & 0 deletions app/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Next.js + Tailwind CSS Example

This example shows how to use [Tailwind CSS](https://tailwindcss.com/) [(v3.0)](https://tailwindcss.com/blog/tailwindcss-v3) with Next.js. It follows the steps outlined in the official [Tailwind docs](https://tailwindcss.com/docs/guides/nextjs).

## Deploy your own

Deploy the example using [Vercel](https://vercel.com?utm_source=github&utm_medium=readme&utm_campaign=next-example) or preview live with [StackBlitz](https://stackblitz.com/github/vercel/next.js/tree/canary/examples/with-tailwindcss)

[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/git/external?repository-url=https://github.com/vercel/next.js/tree/canary/examples/with-tailwindcss&project-name=with-tailwindcss&repository-name=with-tailwindcss)

## How to use

Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example:

```bash
npx create-next-app --example with-tailwindcss with-tailwindcss-app
# or
yarn create next-app --example with-tailwindcss with-tailwindcss-app
# or
pnpm create next-app -- --example with-tailwindcss with-tailwindcss-app
```

Deploy it to the cloud with [Vercel](https://vercel.com/new?utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)).
5 changes: 5 additions & 0 deletions app/next-env.d.ts
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.
4 changes: 4 additions & 0 deletions app/next.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/** @type {import('next').NextConfig} */
module.exports = {
reactStrictMode: true,
}
92 changes: 13 additions & 79 deletions app/package.json
Original file line number Diff line number Diff line change
@@ -1,89 +1,23 @@
{
"name": "@dpopp/app",
"private": true,
"version": "0.0.0",
"scripts": {
"clean": "rimraf node_modules",
"start": "vite",
"build": "tsc && vite build",
"preview": "vite preview",
"lint": "tsc --noEmit && eslint --ext .ts,.js,.tsx .",
"test": "jest",
"prettier": "prettier --write ."
"dev": "next dev",
"build": "next build",
"start": "next start"
},
"setupFiles": [
{
"jest": {
"resetMocks": false,
"setupFiles": [
"jest-localstorage-mock"
]
}
}
],
"dependencies": {
"@chakra-ui/react": "^1.8.8",
"@dpopp/identity": "^0.0.1",
"@dpopp/types": "^0.0.1",
"@emotion/react": "^11",
"@emotion/styled": "^11",
"@ethersproject/providers": "^5.6.2",
"@walletconnect/web3-provider": "^1.7.7",
"@web3-onboard/core": "^2.1.0",
"@web3-onboard/injected-wallets": "^2.0.2",
"@web3-onboard/ledger": "^2.0.1",
"@web3-onboard/react": "^2.0.6",
"@web3-onboard/walletconnect": "^2.0.1",
"@web3-onboard/walletlink": "^2.0.0",
"buffer": "^6.0.3",
"eip-712": "^0.4.3",
"framer-motion": "^6",
"lodash": "^4.17.21",
"mock-local-storage": "^1.1.21",
"next": "latest",
"react": "^17.0.2",
"react-dom": "17.0.2",
"react-google-login": "^5.2.2",
"react-router-dom": "^6.3.0",
"vite-plugin-environment": "^1.1.1"
"react-dom": "^17.0.2"
},
"devDependencies": {
"@babel/preset-typescript": "^7.16.7",
"@testing-library/jest-dom": "5.14.1",
"@testing-library/react": "12.0.0",
"@testing-library/user-event": "13.2.1",
"@types/jest": "^27.4.1",
"@types/node": "^17.0.23",
"@types/react": "^17.0.33",
"@types/react-dom": "^17.0.10",
"@typescript-eslint/eslint-plugin": "^5.17.0",
"@typescript-eslint/parser": "^5.17.0",
"@vitejs/plugin-react": "^1.0.7",
"autoprefixer": "^10.4.4",
"crypto-browserify": "^3.12.0",
"eslint": "^8.12.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-jest": "^26.1.3",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-react": "^7.29.4",
"identity-obj-proxy": "^3.0.0",
"jest": "^27.5.1",
"jest-localstorage-mock": "^2.4.21",
"jest-mock-extended": "^2.0.5",
"postcss": "^8.4.12",
"prettier": "^2.6.1",
"stream-browserify": "^3.0.0",
"tailwindcss": "^3.0.23",
"ts-jest": "^27.1.4",
"ts-node": "^10.7.0",
"typescript": "~4.6.3",
"vite": "^2.9.0",
"vite-plugin-babel-macros": "^1.0.6",
"vite-plugin-externals": "^0.4.0",
"vite-plugin-top-level-await": "^0.0.4",
"vite-plugin-wasm": "^0.0.2",
"vite-tsconfig-paths": "^3.4.1"
},
"resolutions": {
"csstype": "3.0.10"
"@types/node": "17.0.4",
"@types/react": "17.0.38",
"autoprefixer": "^10.4.0",
"postcss": "^8.4.5",
"prettier": "^2.5.1",
"prettier-plugin-tailwindcss": "^0.1.1",
"tailwindcss": "^3.0.7",
"typescript": "4.5.4"
}
}
8 changes: 8 additions & 0 deletions app/pages/_app.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import '../styles/globals.css'
import type { AppProps } from 'next/app'

function MyApp({ Component, pageProps }: AppProps) {
return <Component {...pageProps} />
}

export default MyApp
13 changes: 13 additions & 0 deletions app/pages/api/hello.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// Next.js API route support: https://nextjs.org/docs/api-routes/introduction
import type { NextApiRequest, NextApiResponse } from 'next'

type Data = {
name: string
}

export default function handler(
req: NextApiRequest,
res: NextApiResponse<Data>
) {
res.status(200).json({ name: 'John Doe' })
}
86 changes: 86 additions & 0 deletions app/pages/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
import type { NextPage } from 'next'
import Head from 'next/head'
import Image from 'next/image'

const Home: NextPage = () => {
return (
<div className="flex min-h-screen flex-col items-center justify-center py-2">
<Head>
<title>Create Next App</title>
<link rel="icon" href="/favicon.ico" />
</Head>

<main className="flex w-full flex-1 flex-col items-center justify-center px-20 text-center">
<h1 className="text-6xl font-bold">
Welcome to{' '}
<a className="text-blue-600" href="https://nextjs.org">
Next.js!
</a>
</h1>

<p className="mt-3 text-2xl">
Get started by editing{' '}
<code className="rounded-md bg-gray-100 p-3 font-mono text-lg">
pages/index.tsx
</code>
</p>

<div className="mt-6 flex max-w-4xl flex-wrap items-center justify-around sm:w-full">
<a
href="https://nextjs.org/docs"
className="mt-6 w-96 rounded-xl border p-6 text-left hover:text-blue-600 focus:text-blue-600"
>
<h3 className="text-2xl font-bold">Documentation &rarr;</h3>
<p className="mt-4 text-xl">
Find in-depth information about Next.js features and API.
</p>
</a>

<a
href="https://nextjs.org/learn"
className="mt-6 w-96 rounded-xl border p-6 text-left hover:text-blue-600 focus:text-blue-600"
>
<h3 className="text-2xl font-bold">Learn &rarr;</h3>
<p className="mt-4 text-xl">
Learn about Next.js in an interactive course with quizzes!
</p>
</a>

<a
href="https://github.com/vercel/next.js/tree/canary/examples"
className="mt-6 w-96 rounded-xl border p-6 text-left hover:text-blue-600 focus:text-blue-600"
>
<h3 className="text-2xl font-bold">Examples &rarr;</h3>
<p className="mt-4 text-xl">
Discover and deploy boilerplate example Next.js projects.
</p>
</a>

<a
href="https://vercel.com/import?filter=next.js&utm_source=create-next-app&utm_medium=default-template&utm_campaign=create-next-app"
className="mt-6 w-96 rounded-xl border p-6 text-left hover:text-blue-600 focus:text-blue-600"
>
<h3 className="text-2xl font-bold">Deploy &rarr;</h3>
<p className="mt-4 text-xl">
Instantly deploy your Next.js site to a public URL with Vercel.
</p>
</a>
</div>
</main>

<footer className="flex h-24 w-full items-center justify-center border-t">
<a
className="flex items-center justify-center gap-2"
href="https://vercel.com?utm_source=create-next-app&utm_medium=default-template&utm_campaign=create-next-app"
target="_blank"
rel="noopener noreferrer"
>
Powered by{' '}
<Image src="/vercel.svg" alt="Vercel Logo" width={72} height={16} />
</a>
</footer>
</div>
)
}

export default Home
2 changes: 1 addition & 1 deletion app/postcss.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ module.exports = {
tailwindcss: {},
autoprefixer: {},
},
};
}
4 changes: 4 additions & 0 deletions app/prettier.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = {
singleQuote: true,
semi: false,
}
Binary file added app/public/favicon.ico
Binary file not shown.
4 changes: 4 additions & 0 deletions 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.
3 changes: 3 additions & 0 deletions app/styles/globals.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
25 changes: 6 additions & 19 deletions app/tailwind.config.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,10 @@
const colors = require("tailwindcss/colors");

module.exports = {
content: ["./src/**/*.{ts,tsx}"],
content: [
'./pages/**/*.{js,ts,jsx,tsx}',
'./components/**/*.{js,ts,jsx,tsx}',
],
theme: {
extend: {
colors: {
purple: {
darkpurple: "#0B0228",
},
},
},
fontFamily: {
miriamlibre: ["miriam libre"],
librefranklin: ["Libre Franklin"],
body: ['"Libre Franklin"'],
},
minHeight: {
default: "100vh",
},
extend: {},
},
plugins: [],
};
}
26 changes: 12 additions & 14 deletions app/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,20 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"target": "ESNext",
"useDefineForClassFields": true,
"lib": ["DOM", "DOM.Iterable", "ESNext"],
"allowJs": false,
"skipLibCheck": false,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"target": "es5",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"module": "ESNext",
"moduleResolution": "Node",
"noEmit": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react-jsx"
"jsx": "preserve",
"incremental": true
},
"include": ["src", "__test-fixtures__", "__tests__"],
"references": [{ "path": "./tsconfig.node.json" }]
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
"exclude": ["node_modules"]
}
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"packages": ["app", "schemas", "iam", "identity", "types"],
"packages": ["old-app", "schemas", "iam", "identity", "types"],
"npmClient": "yarn",
"version": "independent",
"useWorkspaces": true,
Expand Down
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit f571490

Please sign in to comment.