Big Booster Learning App is a backend application designed to support a learning platform for 12th class students. The backend provides APIs for managing PDF files, including uploading, downloading, and deleting files using AWS S3 Bucket. The project is built using Node.js, Express.js, and MongoDB.
- AWS S3 Integration: APIs for generating signed URLs to upload, download, and delete PDF files.
- MongoDB: Storing metadata of the PDF files.
- RESTful APIs: Endpoints for managing PDF files and retrieving metadata.
The project is organized into the following structure:
big-booster-learning-app-backend/
│
│
├── .env
├── .gitignore
├── package.json
├── index.js
├── app.http
├── README.md
├── server.js
└── ...
- Node.js (>= v20.13.1)
- npm (>= 10.5.2)
- MongoDB
- AWS S3 Bucket
-
Clone the repository:
git clone https://github.com/zishanverse/learning_material_backend cd learning_material_backend
-
Install dependencies:
npm install
-
Create a
.env
file in the root directory with the following environment variables:PORT=5000 MONGODB_URI=mongodb://localhost:27017/priceComparison AWS_ACCESS_KEY_ID=your_aws_access_key AWS_SECRET_ACCESS_KEY=your_aws_secret_key AWS_S3_BUCKET_NAME=your_s3_bucket_name AWS_REGION=your_aws_region
To start the development server, run:
npm start
The server will start on http://localhost:5000.
-
Get Signed URL for Uploading a PDF
- Endpoint:
POST /upload/pdf
- Description: Generates a signed URL for uploading a PDF to AWS S3.
- Request Body:
{"filename": "string", "contentType": "string", "dateTime": "date", "tags": "array", "size": "number", "subject": "string", "marks": "number", "duration": "number", "description": "string"}
- Response:
{ "signedUrl": "string" }
- Endpoint:
-
Get Signed URL for Downloading a PDF
- Endpoint:
PUT /getting/pdf/
- Description: Generates a signed URL for downloading a PDF from AWS S3.
- Request Body:
{"name": "string"}
- Response:
{ "signedUrl": "string" }
- Endpoint:
-
Get Signed URL for Deleting a PDF
- Endpoint:
DELETE /delete/?name
- Description: Generates a signed URL for deleting a PDF from AWS S3.
- Response:
{ "string" }
- Endpoint:
- Get All PDF Files Metadata
- Endpoint:
GET /all/pdf/
- Description: Retrieves metadata for all PDF files stored in MongoDB.
- Response:
[ {"filename": "string", "contentType": "string", "dateTime": "date", "tags": "array", "size": "number", "subject": "string", "marks": "number", "duration": "number", "description": "string"} ]
- Endpoint:
Contributions are welcome! Please open an issue or submit a pull request for any improvements or bug fixes.
This project is licensed under the MIT License. See the LICENSE file for details.
Feel free to reach out if you have any questions or need further assistance.
Happy learning!