68 lines
2.4 KiB
Plaintext
68 lines
2.4 KiB
Plaintext
---
|
|
title: Installation
|
|
description: How to install the project.
|
|
---
|
|
|
|
<Steps>
|
|
|
|
### Create project
|
|
|
|
Start by creating a new Next.js project using `create-next-app`:
|
|
|
|
```bash
|
|
npx create-next-app wrdo --example "https://github.com/oiov/wr.do"
|
|
```
|
|
|
|
Or deploy with Vercel :
|
|
|
|
[](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Foiov%2Fwr.do)
|
|
|
|
<Callout type="warning" twClass="mt-4">
|
|
A good way to create your repository, but the deployment will fail because you
|
|
need to add your environment variables locally in your project. Follow the
|
|
documentation for that.
|
|
</Callout>
|
|
|
|
### Install dependencies
|
|
|
|
Enter in the folder and install dependencies for your project:
|
|
|
|
```bash
|
|
cd wrdo
|
|
pnpm install
|
|
```
|
|
|
|
### Create a `.env` file
|
|
|
|
Copy/paste the `.env.example` in the `.env` file:
|
|
|
|
{/* env表格 */}
|
|
|
|
| Environment Variable | Value | Description |
|
|
|----------------------|-------|-------------|
|
|
| NEXTAUTH_URL | `http://localhost:3000` | The URL of the Next.js application. |
|
|
| AUTH_SECRET | `123465` | The secret used to encrypt tokens and email verification hashes. |
|
|
| DATABASE_URL | `file:./db.sqlite` | The path to the postgres database. |
|
|
| GOOGLE_CLIENT_ID | `123465` | The ID of the Google OAuth client. |
|
|
| GOOGLE_CLIENT_SECRET | `123465` | The secret of the Google OAuth client. |
|
|
| GITHUB_ID | `123465` | The ID of the GitHub OAuth client. |
|
|
| GITHUB_SECRET | `123465` | The secret of the GitHub OAuth client. |
|
|
| RESEND_API_KEY | `123465` | The API key for Resend. |
|
|
| CLOUDFLARE_ZONE_ID | `123465` | The zone ID for Cloudflare. |
|
|
| CLOUDFLARE_API_KEY | `123465` | The API key for Cloudflare. |
|
|
| CLOUDFLARE_EMAIL | `123465` | The email for Cloudflare. |
|
|
| NEXT_PUBLIC_FREE_RECORD_QUOTA | `3` | The number of free records. |
|
|
| NEXT_PUBLIC_FREE_URL_QUOTA | `100` | The number of free URLs. |
|
|
| NEXT_PUBLIC_OPEN_SIGNUP | `1` | Open signup. |
|
|
|
|
- How to get `GOOGLE_CLIENT_ID`、`GITHUB_ID`, see [Authentification](/docs/developer/authentification).
|
|
- How to get `RESEND_API_KEY`, see [Email](/docs/developer/email).
|
|
- How to get `CLOUDFLARE_ZONE_ID`、`CLOUDFLARE_API_KEY`、`CLOUDFLARE_EMAIL`, see [Cloudflare Configs](/docs/developer/cloudflare).
|
|
- How to get `DATABASE_URL`, see [Database](/docs/developer/database).
|
|
|
|
### Configuration part
|
|
|
|
Let's check the configuration part for update all environment variables before use `pnpm run dev`.
|
|
|
|
</Steps>
|