Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support for CRUD on files from cloudflare #24

Merged
merged 19 commits into from
Nov 4, 2024
Merged

Conversation

Nyumat
Copy link
Member

@Nyumat Nyumat commented Nov 4, 2024

As referenced in (#21), this pull request is preparing us for the RAG implementation by supporting PDF CRUD (besides update) actions. It also includes several changes to improve the configuration, documentation, and database schema of the project.

API Implementation

  • GET /api/files - List all files in the Cloudflare R2 bucket
  • DELETE /api/files?id=123 - Delete a file with the id 123
  • GET /api/files/[id]/sign - Get the presigned URL for a file id (How we allow the client to view them)
  • POST /api/upload/pdf - Upload a PDF to the Cloudflare bucket and metadata to the database

UI/UX Changes

  • New page /upload - contains a form to upload a file and link to see all files
  • New page /files - a list of all files in the Cloudflare R2 bucket, including buttons to preview and delete them.
  • New button Sign Out - logs the current user out of the application.

Configuration Improvements:

  • Added a new .env.example file with placeholders for authentication secrets, database configuration, Pinecone, OpenAI, and Cloudflare R2 settings.

Documentation Updates:

  • Updated the README.md to include instructions for copying the .env.example file, starting the PostgreSQL database using Docker, and added a new troubleshooting section.
  • Added a table for all of our package.json scripts, with descriptions on what they do.
  • Troubleshooting steps for issues during project setup and installation.

Dependency Additions:

  • Added new dependencies @aws-sdk/client-s3, @aws-sdk/s3-request-presigner, and axios to package.json.
    • Axios allows us to easily monitor and visualize upload progress on the frontend (yay UX!)

Database Schema Changes:

  • Created a new course_materials table in the database with fields for id, title, fileName, fileUrl, uploadedAt, and description. (Currently, we can continue to refine this as we go!)

@Nyumat Nyumat self-assigned this Nov 4, 2024
@Nyumat Nyumat merged commit 12e4592 into main Nov 4, 2024
1 check passed
@Nyumat Nyumat deleted the nyumat/pdf-upload branch November 4, 2024 01:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant