⚙️Setting up RudeGPT locally
A simple guide for setting up RudeGPT on your machine and deploying it on AWS Amplify
Table of contents
DID YOU CHECK THE MAIN BLOG???
📜Prerequisites
NPM(should get installed with NodeJS)
For most prompts, you have to choose the default options.
Clone my repo in ur preferred directory
git clone https://github.com/CantBeSubh/rude6
Delete
src
&lify
folder, and then runnpm i
Make sure you have Installed and configured AWS Amplify CLI
In the root folder, run
amplify init
, choose the default option for any prompt(you might have to create a new profile)-
Run
amplify add auth
and choose the default option, andsign in with Email
. Next, run
amplify add api
, chooseGraphQL
, Configure theAuthorization
modes toAmazon Cognito User Pool
, then selectTodo
for the starter schema. Chooseyes
when it asks do you want to edit.-
Replace the code in the schema file with the following
type Conversation @model @auth(rules: [{ allow: owner }]) { id: ID! name: String messages: [AWSJSON] }
{allow:user}
restrict the entity CRUD access to the owner of the entity, means, only the author of a conversation can read, write, update or delete the convo.Run amplify push, you are good to go if, on running amplify status, ur output is like this
If you have done everything correctly so far, then your folder structure should look like this:
Don't run npm run dev yet, this is the last step. To proceed, make sure you have an OpenAI Account. Go here and generate a key, then in our main directory, rename the
.env.example
file to.env
, and paste your key💡Now you can runnpm run dev
. You can visit the link shown in your terminal(usuallylocalhost:3000
)
To deploy, push the code on your GitHub, go to the AWS Amplify console, choose your app created by Amplify CLI select hosting, and click on connect a branch. If it's your first-time aws might ask you for connecting ur GitHub to aws, go ahead they won't steal your data.
connect ur repo to it, go with the default option, but in step 2 build settings, add the env variable like this.
💡Way to go champ, you deployedmyyour web app on AWS Amplify