|
1 | | -## t3dotgg clone |
| 1 | +# 𝙏3𝙘𝒉𝙖𝒕 |
| 2 | + |
| 3 | +[](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2F100xEnginners%2Ft3dotgg&env=DATABASE_URL,BETTER_AUTH_SECRET,BETTER_AUTH_URL,BETTER_AUTH_TRUSTED_ORIGINS,GOOGLE_CLIENT_ID,GOOGLE_CLIENT_SECRET,GOOGLE_REDIRECT_URI,GITHUB_CLIENT_ID,GITHUB_CLIENT_SECRET&envDescription=For%20more%20info%20on%20setting%20up%20your%20API%20keys%2C%20checkout%20the%20Readme%20below&envLink=https%3A%2F%2Fgithub.com%2F100xEnginners%2Ft3dotgg%2Fblob%2Fmain%2FREADME.md&project-name=zero-email&repository-name=zero-email&redirect-url=zero.email&demo-title=Zero&demo-description=An%20open%20source%20email%20app&demo-url=zero.email) |
| 4 | + |
| 5 | +An Open-Source Version of t3.chat. |
| 6 | + |
| 7 | +## What is T3.chat? |
| 8 | + |
| 9 | +T3 Chat is a fast and sleek AI chat application. |
| 10 | + |
| 11 | +it's "best AI chat app ever made" ~ Theo |
| 12 | + |
| 13 | +## Why T3chat? |
| 14 | +It supports different LLM, respond very fast, user friendly, have customization, cheap. |
| 15 | + - ✅ **Open-Source** – No hidden agendas, fully transparent. |
| 16 | + - 🚀 **Developer-Friendly** – Built with extensibility and integrations in mind. |
| 17 | + |
| 18 | +## Tech Stack |
| 19 | + |
| 20 | +T3 is built with modern and reliable technologies: |
| 21 | + |
| 22 | +- **Frontend**: Next.js, TypeScript, TailwindCSS, Shadcn UI |
| 23 | +- **Backend**: tRPC, Prisma ORM |
| 24 | +- **Database**: PostgreSQL |
| 25 | +- **Authentication**: Google OAuth |
| 26 | +- **Overall**: We're using t3 stack 💙 |
| 27 | +<!-- - **Testing**: Jest, React Testing Library --> |
| 28 | + |
| 29 | +## Getting Started |
| 30 | + |
| 31 | +### Prerequisites |
| 32 | + |
| 33 | +**Required Versions:** |
| 34 | + |
| 35 | +- Node.js >= 18.0.0 |
| 36 | +- pnpm >= 8.0.0 |
| 37 | +- Docker >= 20.10.0 |
| 38 | + |
| 39 | +Before running the application, you'll need to set up several services and environment variables: |
| 40 | + |
| 41 | +For more in-depth information on environment variables, please refer to the [Environment Variables](#environment-variables) section. |
| 42 | + |
| 43 | + |
| 44 | +1. **Setup Local** |
| 45 | + |
| 46 | + - Make sure you have [Docker](https://docs.docker.com/get-docker/), [NodeJS](https://nodejs.org/en/download/), and [bun](https://bun.sh/docs/installation) installed. |
| 47 | + - Open codebase as a container in [VSCode](https://code.visualstudio.com/) or your favorite VSCode fork. |
| 48 | + - Run the following commands in order to populate your dependencies and setup docker |
| 49 | + |
| 50 | + ``` |
| 51 | + bun install |
| 52 | + ``` |
| 53 | +
|
| 54 | + - Run the following commands if you are unable to start any of the services |
| 55 | +
|
| 56 | + ``` |
| 57 | + rm -rf node_modules |
| 58 | + ``` |
| 59 | +
|
| 60 | +2. **Next Auth Setup** |
| 61 | +
|
| 62 | + - Open the `.env` file and change the AUTH_SECRET to string given below. |
| 63 | +
|
| 64 | + ```env |
| 65 | + AUTH_SECRET= 'authjs.session-token' |
| 66 | + ``` |
| 67 | +
|
| 68 | +3. **Google OAuth Setup** |
| 69 | +
|
| 70 | + - Go to [Google Cloud Console](https://console.cloud.google.com) |
| 71 | + - Create a new project |
| 72 | + - Create OAuth 2.0 credentials (Web application type) |
| 73 | + - Add authorized redirect URIs: |
| 74 | + - Development: |
| 75 | + - `http://localhost:3000` |
| 76 | + - `http://localhost:3000/api/auth/google/callback` |
| 77 | + - Production: |
| 78 | + - `https://your-production-url` |
| 79 | + - `https://your-production-url/api/auth/google/callback` |
| 80 | + - Add to `.env`: |
| 81 | +
|
| 82 | + ```env |
| 83 | + GOOGLE_CLIENT_ID=your_client_id |
| 84 | + GOOGLE_CLIENT_SECRET=your_client_secret |
| 85 | + ``` |
| 86 | +### Environment Variables |
| 87 | +
|
| 88 | +Copy `.env.example` located in `.env` in the configure the following variables: |
| 89 | +
|
| 90 | +```env |
| 91 | +# Auth |
| 92 | +AUTH_TRUST_HOST= |
| 93 | +AUTH_SECRET= # Required: Secret key for authentication |
| 94 | +
|
| 95 | +# Google OAuth ( Required ) |
| 96 | +GOOGLE_CLIENT_ID= |
| 97 | +GOOGLE_CLIENT_SECRET= |
| 98 | +
|
| 99 | +# Turnstile ( Required ) |
| 100 | +NEXT_PUBLIC_TURNSTILE_SITE_KEY= |
| 101 | +TURNSTILE_SITE_KEY= |
| 102 | +TURNSTILE_SITE_SECRET= |
| 103 | +
|
| 104 | +# Stripe ( Required ) |
| 105 | +NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY= |
| 106 | +STRIPE_SECRET_KEY= |
| 107 | +STRIPE_WEBHOOK_SECRET= |
| 108 | +
|
| 109 | +# Upstash ( Required ) |
| 110 | +UPSTASH_REDIS_REST_URL= |
| 111 | +UPSTASH_REDIS_REST_TOKEN = |
| 112 | +
|
| 113 | +# Mail ( Optional ) |
| 114 | +MAIL_APP_USER = |
| 115 | +MAIL_APP_PASSWORD = |
| 116 | +
|
| 117 | +# TypeGPT ( Required ) |
| 118 | +NEXT_PUBLIC_TYPEGPT_API_KEY= |
| 119 | +TYPEGPT_API_KEY= |
| 120 | +TYPEGPT_API_URL= |
| 121 | +
|
| 122 | +# Discord webhook ( Optinal ) |
| 123 | +WEBHOOK_URL |
| 124 | +
|
| 125 | +# Database ( Required ) |
| 126 | +DATABASE_URL= |
| 127 | +``` |
| 128 | + |
| 129 | +Migration the database by running `bunx prisma migrate dev` and generate prisma client `bunx prisma generate`. |
| 130 | + |
| 131 | + |
| 132 | +### Running Locally |
| 133 | + |
| 134 | +Run the development server: |
| 135 | + |
| 136 | +```bash |
| 137 | +bun dev |
| 138 | +``` |
| 139 | +Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. |
| 140 | + |
| 141 | +## Contribute |
| 142 | + |
| 143 | +Contributions are welcome ❤️. |
0 commit comments