⚙️Setting up RudeGPT locally

⚙️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


💡
I am a college student and I don't know much about coding, so don't roast me ;-;

For most prompts, you have to choose the default options.

  1. Clone my repo in ur preferred directory

    git clone https://github.com/CantBeSubh/rude6

  2. Delete src & amplify folder, and then run npm i

  3. Make sure you have Installed and configured AWS Amplify CLI

  4. In the root folder, run amplify init , choose the default option for any prompt(you might have to create a new profile)

  5. Run amplify add auth and choose the default option, and sign in with Email.

  6. Next, run amplify add api, choose GraphQL, Configure the Authorization modes to Amazon Cognito User Pool, then select Todo for the starter schema. Choose yes when it asks do you want to edit.

  7. Replace the code in the schema file with the following

  8.   type Conversation @model @auth(rules: [{ allow: owner }]) {
          id: ID!
          name: String
          messages: [AWSJSON]
      }
    
  9. {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.

  10. Run amplify push, you are good to go if, on running amplify status, ur output is like this

  11. If you have done everything correctly so far, then your folder structure should look like this:

  12. 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 run npm run dev . You can visit the link shown in your terminal(usually localhost:3000 )

  13. 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.

  14. 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 deployed my your web app on AWS Amplify