Lightweight PDF upload, storage, and viewing app with a .NET 8 REST API backend and a Vite + React frontend.
Quick overview
- API: PDFReader.API — ASP.NET Core (net8.0) providing endpoints for uploading, downloading and managing PDF files and users.
- Web: PDFReader.Web — Vite + React app for uploading and viewing PDFs.
Features
- Upload PDFs (multipart/form-data) and store file metadata in a local database.
- Download stored PDFs by id.
- Simple user management endpoints (signup/login/user operations).
- Local file storage with a
FileManagerLocalabstraction (easy to swap out). - Global exception handling and repository pattern for data access.
Repo layout
- PDFReader.API: API project, controllers, EF Core DB context, migrations, file storage.
- PDFReader.Web: Frontend SPA built with Vite + React.
Prerequisites
- .NET 8 SDK
- Node.js 18+ and npm (for the frontend)
Getting started — API
- Open a terminal and change to the API folder:
cd PDFReader.API- Restore and build:
dotnet restore
dotnet buildGetting started — Web
- From another terminal, change to the web folder:
cd PDFReader.Web- Install and start the dev server:
npm install
npm run devOpen the dev server URL printed by Vite (usually http://localhost:5173) to use the frontend.
API endpoints (high level)
POST /api/pdf/upload— Upload a PDF file (form-data). Returns file metadata and id.GET /api/pdf/download/{id}— Download the PDF by id.POST /api/user/signupandPOST /api/user/login— User management (seeControllers/UserController.cs).