|
1 | 1 | ### Local
|
| 2 | + |
2 | 3 | - **Install the prerequisites**
|
3 |
| - - **Download chatgpt-clone** |
4 |
| - - Download the latest release here: https://github.com/danny-avila/chatgpt-clone/releases/ |
5 |
| - - Or by clicking on the green code button in the top of the page and selecting "Download ZIP" |
6 |
| - - Or (Recommended if you have Git installed) pull the latest release from the main branch |
7 |
| - - If you downloaded a zip file, extract the content in "C:/chatgpt-clone/" |
8 |
| - -**IMPORTANT : If you install the files somewhere else modify the instructions accordingly** |
9 |
| - |
10 |
| - - **To enable the Conversation search feature:** |
11 |
| - -IF YOU DON'T WANT THIS FEATURE YOU CAN SKIP THIS STEP |
12 |
| - - Download MeileSearch latest release from : https://github.com/meilisearch/meilisearch/releases |
13 |
| - - Copy it to "C:/chatgpt-clone/" |
14 |
| - - Rename the file to "meilisearch.exe" |
15 |
| - - Open it by double clicking on it |
16 |
| - - Copy the generated Master Key and save it somewhere (You will need it later) |
17 |
| - |
18 |
| - - **Download and Install Node.js** |
19 |
| - - Navigate to https://nodejs.org/en/download and to download the latest Node.js version for your OS (The Node.js installer includes the NPM package manager.) |
20 |
| - |
21 |
| - - **Create a MongoDB database** |
22 |
| - - Navigate to https://www.mongodb.com/ and Sign In or Create an account |
23 |
| - - Create a new project |
24 |
| - - Build a Database using the free plan and name the cluster (example: chatgpt-clone) |
25 |
| - - Use the "Username and Password" method for authentication |
26 |
| - - Add your current IP to the access list |
27 |
| - - Then in the Database Deployment tab click on Connect |
28 |
| - - In "Choose a connection method" select "Connect your application" |
29 |
| - - Driver = Node.js / Version = 4.1 or later |
30 |
| - - Copy the connection string and save it somewhere(you will need it later) |
31 |
| - |
32 |
| - - **Get your OpenAI API key** here: https://platform.openai.com/account/api-keys and save it somewhere safe (you will need it later) |
33 |
| - |
34 |
| - - **Get your Bing Access Token** |
35 |
| - - Using MS Edge, navigate to bing.com |
36 |
| - - Make sure you are logged in |
37 |
| - - Open the DevTools by pressing F12 on your keyboard |
38 |
| - - Click on the tab "Application" (On the left of the DevTools) |
39 |
| - - Expand the "Cookies" (Under "Storage") |
40 |
| - - You need to copy the value of the "_U" cookie, save it somewhere, you will need it later |
41 |
| - |
| 4 | + |
| 5 | + - **Download chatgpt-clone** |
| 6 | + - Download the latest release here: https://github.com/danny-avila/chatgpt-clone/releases/ |
| 7 | + - Or by clicking on the green code button in the top of the page and selecting "Download ZIP" |
| 8 | + - Or (Recommended if you have Git installed) pull the latest release from the main branch |
| 9 | + - If you downloaded a zip file, extract the content in "C:/chatgpt-clone/" -**IMPORTANT : If you install the files somewhere else modify the instructions accordingly** |
| 10 | + - **To enable the Conversation search feature:** |
| 11 | + -IF YOU DON'T WANT THIS FEATURE YOU CAN SKIP THIS STEP |
| 12 | + |
| 13 | + - Download MeileSearch latest release from : https://github.com/meilisearch/meilisearch/releases |
| 14 | + - Copy it to "C:/chatgpt-clone/" |
| 15 | + - Rename the file to "meilisearch.exe" |
| 16 | + - Open it by double clicking on it |
| 17 | + - Copy the generated Master Key and save it somewhere (You will need it later) |
| 18 | + |
| 19 | + - **Download and Install Node.js** |
| 20 | + - Navigate to https://nodejs.org/en/download and to download the latest Node.js version for your OS (The Node.js installer includes the NPM package manager.) |
| 21 | + - **Create a MongoDB database** |
| 22 | + - Navigate to https://www.mongodb.com/ and Sign In or Create an account |
| 23 | + - Create a new project |
| 24 | + - Build a Database using the free plan and name the cluster (example: chatgpt-clone) |
| 25 | + - Use the "Username and Password" method for authentication |
| 26 | + - Add your current IP to the access list |
| 27 | + - Then in the Database Deployment tab click on Connect |
| 28 | + - In "Choose a connection method" select "Connect your application" |
| 29 | + - Driver = Node.js / Version = 4.1 or later |
| 30 | + - Copy the connection string and save it somewhere(you will need it later) |
| 31 | + - **Get your OpenAI API key** here: https://platform.openai.com/account/api-keys and save it somewhere safe (you will need it later) |
| 32 | + |
| 33 | + - **Get your Bing Access Token** |
| 34 | + - Using MS Edge, navigate to bing.com |
| 35 | + - Make sure you are logged in |
| 36 | + - Open the DevTools by pressing F12 on your keyboard |
| 37 | + - Click on the tab "Application" (On the left of the DevTools) |
| 38 | + - Expand the "Cookies" (Under "Storage") |
| 39 | + - You need to copy the value of the "\_U" cookie, save it somewhere, you will need it later |
| 40 | + |
42 | 41 | - **Create the ".env" File** You will need all your credentials, (API keys, access tokens, and Mongo Connection String, MeileSearch Master Key)
|
43 |
| - - Open "C:/chatgpt-clone/api/.env.example" in a text editor |
44 |
| - - At this line **MONGO_URI="mongodb://127.0.0.1:27017/chatgpt-clone"** |
45 |
| - Replace mongodb://127.0.0.1:27017/chatgpt-clone with the MondoDB connection string you saved earlier, **remove "&w=majority" at the end** |
46 |
| - - It should look something like this: "MONGO_URI="mongodb+srv://username:[email protected]/?retryWrites=true" |
47 |
| - - At this line **OPENAI_KEY=** you need to add your openai API key |
48 |
| - - Add your Bing token to this line **BING_TOKEN=** (needed for BingChat & Sydney) |
49 |
| - - If you want to enable Search, **SEARCH=TRUE** if you do not want to enable search **SEARCH=FALSE** |
50 |
| - - Add your previously saved MeiliSearch Master key to this line **MEILI_MASTER_KEY=** (the key is needed if search is enabled even on local install or you may encounter errors) |
51 |
| - - Save the file as **"C:/chatgpt-clone/api/.env"** |
| 42 | + - Open "C:/chatgpt-clone/api/.env.example" in a text editor |
| 43 | + - At this line **MONGO_URI="mongodb://127.0.0.1:27017/chatgpt-clone"** |
| 44 | + Replace mongodb://127.0.0.1:27017/chatgpt-clone with the MondoDB connection string you saved earlier, **remove "&w=majority" at the end** |
| 45 | + - It should look something like this: "MONGO_URI="mongodb+srv://username:password@chatgpt-clone.lfbcwz3.mongodb.net/?retryWrites=true" |
| 46 | + - At this line **OPENAI_KEY=** you need to add your openai API key |
| 47 | + - Add your Bing token to this line **BINGAI_TOKEN=** (needed for BingChat & Sydney) |
| 48 | + - If you want to enable Search, **SEARCH=TRUE** if you do not want to enable search **SEARCH=FALSE** |
| 49 | + - Add your previously saved MeiliSearch Master key to this line **MEILI_MASTER_KEY=** (the key is needed if search is enabled even on local install or you may encounter errors) |
| 50 | + - Save the file as **"C:/chatgpt-clone/api/.env"** |
52 | 51 |
|
53 | 52 | **DO THIS ONCE AFTER EVERY UPDATE**
|
| 53 | + |
54 | 54 | - **Run** `npm ci` in the "C:/chatgpt-clone/api" directory
|
55 | 55 | - **Run** `npm ci` in the "C:/chatgpt-clone/client" directory
|
56 | 56 | - **Run** `npm run build` in the "C:/chatgpt-clone/client"
|
57 | 57 |
|
58 | 58 | **DO THIS EVERY TIME YOU WANT TO START CHATGPT-CLONE**
|
| 59 | + |
59 | 60 | - **Run** `"meilisearch --master-key put_your_meilesearch_Master_Key_here"` in the "C:/chatgpt-clone" directory (Only if SEARCH=TRUE)
|
60 |
| -- **Run** `npm start` in the "C:/chatgpt-clone/api" directory |
| 61 | +- **Run** `npm start` in the "C:/chatgpt-clone/api" directory |
61 | 62 |
|
62 | 63 | - **Visit** http://localhost:3080 (default port) & enjoy
|
63 | 64 |
|
64 |
| - |
65 | 65 | OPTIONAL BUT RECOMMENDED
|
| 66 | + |
66 | 67 | - **Make a batch file to automate the starting process**
|
67 |
| - - Open a text editor |
68 |
| - - Paste the following code in a new document |
69 |
| - - Put your MeiliSearch master key instead of "your_master_key_goes_here" |
70 |
| - - Save the file as "C:/chatgpt-clone/chatgpt-clone.bat" |
71 |
| - - you can make a shortcut of this batch file and put it anywhere |
| 68 | + - Open a text editor |
| 69 | + - Paste the following code in a new document |
| 70 | + - Put your MeiliSearch master key instead of "your_master_key_goes_here" |
| 71 | + - Save the file as "C:/chatgpt-clone/chatgpt-clone.bat" |
| 72 | + - you can make a shortcut of this batch file and put it anywhere |
72 | 73 |
|
73 | 74 | ```
|
74 | 75 | REM the meilisearch executable needs to be at the root of the chatgpt-clone directory
|
75 | 76 |
|
76 | 77 | start "MeiliSearch" cmd /k "meilisearch --master-key your_master_key_goes_here
|
77 | 78 |
|
78 |
| -REM ↑↑↑ meilisearch is the name of the meilisearch executable, put your own master key there |
| 79 | +REM ↑↑↑ meilisearch is the name of the meilisearch executable, put your own master key there |
79 | 80 |
|
80 | 81 | start "ChatGPT-Clone" cmd /k "cd api && npm start"
|
81 | 82 |
|
|
0 commit comments