Skip to content

Neelpatel1604/NovaBuddy-frontend

Repository files navigation

NovaBuddy Frontend

Next.js frontend for NovaBuddy — an AI-powered study buddy. Upload lecture materials (PDF, Word, PowerPoint, text) and get summaries, quizzes, and an interactive Q&A chatbot powered by Amazon Nova via the NovaBuddy backend.

Prerequisites

  • Node.js 18+ and npm
  • A deployed NovaBuddy backend (see below)

1. Deploy the backend first

This app talks to the NovaBuddy API. Deploy the backend and get its outputs before running the frontend.

  1. Clone and deploy the backend:

    git clone https://github.com/Neelpatel1604/NovaBuddy.git
    cd NovaBuddy/terraform
    cp terraform.tfvars.example terraform.tfvars
    # Edit terraform.tfvars if needed
    terraform init
    terraform plan
    terraform apply
  2. Note the Terraform outputs — you will need them for the frontend:

    • api_url — base URL of the HTTP API
    • cognito_user_pool_id — Cognito User Pool ID
    • cognito_client_id — Cognito App Client ID
    • s3_bucket_name — S3 uploads bucket name

    See NovaBuddy for full backend setup, Bedrock access, and creating a test user.

2. Set up this frontend

  1. Clone and install:

    git clone <this-repo-url>
    cd novabuddyfrontend
    npm install
  2. Create a .env file in the project root and fill it with values from your backend deployment (and your AWS credentials for the documents fallback):

    # From Terraform outputs (NovaBuddy backend)
    NEXT_PUBLIC_AWS_REGION=us-east-1
    NEXT_PUBLIC_API_BASE_URL=https://YOUR_API_ID.execute-api.us-east-1.amazonaws.com
    NEXT_PUBLIC_COGNITO_USER_POOL_ID=us-east-1_XXXXXXXXX
    NEXT_PUBLIC_COGNITO_USER_POOL_CLIENT_ID=xxxxxxxxxxxxxxxxxxxxxxxxxx
    NEXT_PUBLIC_S3_BUCKET_NAME=novabuddy-xxxx-uploads
    
    # Optional: only if you use the generated-bucket feature
    NEXT_PUBLIC_S3_BUCKET_GENERATED_NAME=novabuddy-xxxx-generated
    
    # AWS credentials from an IAM user that has S3 permissions (at minimum s3:PutObject, s3:DeleteObject, s3:ListBucket) on the uploads bucket.
    # Create this IAM user, attach an S3 policy with those actions, then generate an access key and secret and paste them here.
    NEXT_PUBLIC_AWS_ACCESS_KEY_ID=AKIA...
    NEXT_PUBLIC_AWS_SECRET_ACCESS_KEY=...

    Example with placeholders:

    Variable Where to get it
    NEXT_PUBLIC_AWS_REGION Same region as your Terraform deploy (e.g. us-east-1)
    NEXT_PUBLIC_API_BASE_URL Terraform output api_url
    NEXT_PUBLIC_COGNITO_USER_POOL_ID Terraform output cognito_user_pool_id
    NEXT_PUBLIC_COGNITO_USER_POOL_CLIENT_ID Terraform output cognito_client_id
    NEXT_PUBLIC_S3_BUCKET_NAME Terraform output s3_bucket_name
    NEXT_PUBLIC_AWS_ACCESS_KEY_ID IAM user/role with S3 read access to the uploads bucket
    NEXT_PUBLIC_AWS_SECRET_ACCESS_KEY Same IAM credentials
  3. Run the dev server:

    npm run dev
  4. Open http://localhost:3000, sign up or sign in (confirm the user in Cognito if needed), then upload a lecture and use the dashboard.

.env example

Copy this to .env and replace the placeholders with your backend and AWS values:

# Region (must match backend)
NEXT_PUBLIC_AWS_REGION=us-east-1

# From Terraform outputs after deploying https://github.com/Neelpatel1604/NovaBuddy
NEXT_PUBLIC_API_BASE_URL=https://xxxxxxxxxx.execute-api.us-east-1.amazonaws.com
NEXT_PUBLIC_COGNITO_USER_POOL_ID=us-east-1_XXXXXXXXX
NEXT_PUBLIC_COGNITO_USER_POOL_CLIENT_ID=xxxxxxxxxxxxxxxxxxxxxxxxxx
NEXT_PUBLIC_S3_BUCKET_NAME=novabuddy-xxxxxxxx-uploads

# Optional
NEXT_PUBLIC_S3_BUCKET_GENERATED_NAME=novabuddy-xxxxxxxx-generated

# AWS credentials for /api/documents (S3 list fallback)
NEXT_PUBLIC_AWS_ACCESS_KEY_ID=AKIAXXXXXXXXXXXXXXXXXX
NEXT_PUBLIC_AWS_SECRET_ACCESS_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Scripts

  • npm run dev — start development server
  • npm run build — build for production
  • npm run start — run production server

Backend

Backend repo: Neelpatel1604/NovaBuddy — serverless API (Lambda, API Gateway, Cognito, S3, DynamoDB, Bedrock Nova). Deploy it first and use its outputs in this app’s .env.

About

This is frontend for the NovaBuddy

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors