This repository has been archived by the owner on Aug 25, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from A7med3bdulBaset/v-1-1-1
Version 1.2
- Loading branch information
Showing
24 changed files
with
284 additions
and
98 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
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 |
---|---|---|
@@ -1,10 +1,25 @@ | ||
// @ts-check | ||
|
||
import { createEnv } from '@t3-oss/env-nextjs' | ||
// import { z } from 'zod' | ||
import { z } from 'zod' | ||
|
||
export const env = createEnv({ | ||
server: {}, | ||
server: { | ||
// NEXTAUTH_SECRET: z.string().min(32), | ||
}, | ||
client: {}, | ||
runtimeEnv: {} | ||
}) | ||
runtimeEnv: { | ||
// NEXTAUTH_SECRET: process.env.NEXTAUTH_SECRET, | ||
} | ||
}) | ||
|
||
/** | ||
* # How to use this? | ||
* 1. write your env variables in the `.env.local` file | ||
* 2. add a schema for the env variables in the `env.mjs` file | ||
* 3. use the `env` object in your code | ||
* ```js | ||
* import { env } from "@env"; | ||
* console.log(env.NEXTAUTH_SECRET); | ||
* ``` | ||
*/ |
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 |
---|---|---|
@@ -1,4 +1,21 @@ | ||
/** @type {import('next').NextConfig} */ | ||
const nextConfig = {} | ||
const nextConfig = { | ||
experimental: { | ||
serverActions: true, | ||
}, | ||
}; | ||
|
||
module.exports = nextConfig | ||
module.exports = nextConfig; | ||
|
||
/** | ||
* To make your app PWA: | ||
* 1. Run `pnpm add @imbios/next-pwa` | ||
* 2. Uncomment the code below | ||
*/ | ||
|
||
|
||
// eslint-disable-next-line @typescript-eslint/no-var-requires | ||
// const withPWA = require("@imbios/next-pwa")({ | ||
// dest: "public", | ||
// }); | ||
// module.exports = withPWA(nextConfig); |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,8 @@ | ||
"use server"; | ||
|
||
import { revalidatePath } from "next/cache"; | ||
|
||
// This is just an example of a serverAction | ||
export async function revalidate(path: `/${string}`) { | ||
return revalidatePath(path); | ||
} |
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,32 @@ | ||
"use client"; | ||
|
||
import Link from "next/link"; | ||
|
||
import { Button, buttonVariants } from "@/components/ui/button"; | ||
|
||
export default function Error({ | ||
error, | ||
reset, | ||
}: { | ||
error: Error; | ||
reset: () => void; | ||
}) { | ||
return ( | ||
<div className="flex flex-1 flex-col items-center justify-center space-y-4"> | ||
<h1 className="text-7xl font-extrabold">Error</h1> | ||
<h2 className="text-2xl font-semibold"> | ||
{process.env.NODE_ENV === "development" | ||
? error.message | ||
: "Something went wrong"} | ||
</h2> | ||
<div className="space-x-2"> | ||
<Link href="/" className={buttonVariants()}> | ||
Go Home | ||
</Link> | ||
<Button variant="outline" onClick={() => reset()}> | ||
Try Again | ||
</Button> | ||
</div> | ||
</div> | ||
); | ||
} |
Oops, something went wrong.