Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
sharf uddin committed Sep 13, 2022
0 parents commit 042ae8e
Show file tree
Hide file tree
Showing 99 changed files with 13,847 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules
.next
public
next-env.d.ts
yarn.lock;
3 changes: 3 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": ["next/core-web-vitals", "prettier"]
}
37 changes: 37 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# 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
.env*.local

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts
5 changes: 5 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules
.next
public
next-env.d.ts
yarn.lock
44 changes: 44 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
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, Clone this repo, cd into correct directory then command 'yarn' or 'npm install' to install all dependencies
Then add a '.env' file in the root directory of this project. And fill the following environment variables with proper value:
```.env
NEXT_PUBLIC_REST_API_ENDPOINT=YOUR_API_ENDPOINT e.g. 'yourdomain.com/api'
NEXT_PUBLIC_NEXTAUTH_URL=YOUR_NEXTAUTH_URL (in development 'http:https://localhost:3000' or in production this should be 'yourdomain.com' )
For Social Authentication
GOOGLE_CLIENT_ID=YOUR_GOOGLE_CLIENT_ID
GOOGLE_CLIENT_SECRET=YOUR_GOOGLE_CLIENT_SECRET
SECRET=YOUR_SECRET_KEY
```
Then run the development server:

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

Open [http:https://localhost:3000](http:https://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:https://localhost:3000/api/hello](http:https://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.

## 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.
10 changes: 10 additions & 0 deletions additional.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import 'little-state-machine';

declare module 'little-state-machine' {
interface GlobalState {
step: 'Email' | 'Token' | 'Password';
email: string;
token: string;
password: string;
}
}
10 changes: 10 additions & 0 deletions lint-staged.config.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'],
};
22 changes: 22 additions & 0 deletions next-sitemap.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
module.exports = {
siteUrl: process.env.NEXT_PUBLIC_SITE_URL || 'http:https://localhost:3000',
generateRobotsTxt: true, // (optional)
robotsTxtOptions: {
policies: [
{
userAgent: '*',
// allow: '/',
disallow: ['*/logout', '*/404', '*/profile'], //
},
],
},
exclude: [
'*/404',
'*/change-password',
'*/logout',
'*/profile',
],
};

// please read the documentation for details information about configration here
// https://github.com/iamvishnusankar/next-sitemap
29 changes: 29 additions & 0 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true, // enabled react-strict mode
redirects() {
// if a path doesn't exist in pages folder we can redirect it like this
return [
{
source: '/undefined-page-path',
destination: '/',
permanent: true,
},
]
},
images: {
domains: [
'localhost',
],
},
...(process.env.NODE_ENV === 'production' && {
typescript: {
ignoreBuildErrors: true,
},
eslint: {
ignoreDuringBuilds: true,
},
}),
};

module.exports = nextConfig;
Loading

0 comments on commit 042ae8e

Please sign in to comment.