Astrodevil / resource-gallery

Resources related to software development
https://resource-gallery.pages.dev/
MIT License
28 stars 46 forks source link

Download Files #6

Open Astrodevil opened 1 year ago

Astrodevil commented 1 year ago

Database to store PDF files and make it downloadable will be very useful.

Arka2708 commented 1 year ago

I would like to work on this under GSSoC'23. Although it's a time-taking job, I want to try and help you solve this issue. Hope you'll guide me and help me with a better understanding of your codebases. I'll discuss thoroughly the plan based upon which I'll solve this issue.

Astrodevil commented 1 year ago

This project is based on Astro, have you visited the codebase?

arunavabasucom commented 1 year ago

I would like to work on this!

Arka2708 commented 1 year ago

This project is based on Astro, have you visited the codebase?

@Astrodevil I've seen the overall code and idea, although I don't have any knowledge about Astro I thought a general way to solve the issue,

  1. Set Up a Backend Server: Create a separate backend server using Node.js and Express.js to handle the file upload and download functionalities. This server will interact with the database and provide the necessary API endpoints.

  2. Add Required Dependencies: Install the necessary dependencies for the backend server, Express.js, multer (for file upload handling), and Mongoose (for interacting with the database).

  3. Create Database Schema: Design and create a database schema to store information about the PDF files. Use Mongoose to define the schema and model for the PDF files.

  4. Implement File Upload Functionality: Set up a route in the backend server to handle file uploads. Use Multer middleware to handle file upload and storage. Save the uploaded PDF file to a designated folder and store its metadata (e.g., filename, path) in the database.

  5. Implement File Download Functionality: Create a route in the backend server to handle file downloads. When a user requests to download a PDF file, retrieve the file's metadata from the database based on the provided identifier (e.g., file ID or filename). Stream the file content to the client as the server responds with appropriate headers.

  6. Update Astro Component: In the Astro component where the Resource Gallery is rendered, add appropriate UI elements (e.g., upload button, download link) to handle file upload and download.

  7. Update Tailwind CSS Styles: Adjust the Tailwind CSS styles as needed to accommodate the new UI elements related to file upload and download.

Am I on the right way? And with this Astro thing you or the mentor can help ig.

Astrodevil commented 1 year ago

@Arka2708 you are on right track, how about using appwrite or firebase? any experience or suggestion.

And about Astro, I did it by reading their docs https://docs.astro.build/en/getting-started/ and definitely coordinate with you in finding solutions.

Can I assign you this issue?

Arka2708 commented 1 year ago

@Arka2708 you are on right track, how about using appwrite or firebase? any experience or suggestion.

And about Astro, I did it by reading their docs https://docs.astro.build/en/getting-started/ and definitely coordinate with you in finding solutions.

Can I assign you this issue?

Firebase can be a good option here, I don't have much experience though but surely find ways to do the job, I mean that's what the open source is all about. Yes assign me this issue, just give me a few days of time to set up all the things. I'll give you a thorough update about my work.

akkshayTandon commented 1 year ago

I think we should try firebase first to get an idea of the workflow.