Narendra0777R/document_processing_api ? reverse-engineered prompt

Reverse engineered prompt

Build me a simple Spring Boot API that lets me upload PDF documents, extracts the text from them, and saves the useful details into a MySQL database.

I want two main endpoints, one to upload a PDF file and return the saved record, and one to fetch a saved document by its id. When a file is uploaded, please read the PDF safely, pull out the text, calculate the word count and file size, then store everything with the file name and upload time. The response should come back as JSON and include the extracted text too.

Please keep the code clean and separated so the upload and parsing logic is not mixed into the controller. Use a normal layered structure, and make sure the app can run with a local MySQL database. If you need to check current library docs online, go ahead. Also set it up so file uploads have a reasonable size limit and the database tables are created automatically when the app starts.

Are you gonna build this?

make sure you review the code using coderabbit

Try freeSponsored — opens CodeRabbit in a new tab