- Introduction
- Project Overview
- Features
- Technologies Used
- API Endpoints
- Installation
- Contributing
- Contact
This project implements a robust backend API for managing 3D printing materials. The API facilitates CRUD operations for 3D printing materials, including image uploads and retrievals.
The project utilizes MongoDB for data storage and Firebase Storage for handling image uploads. The goal is to create a scalable and efficient backend system that supports the core functionalities of managing 3D printing materials data.
The implemented features include:
- Material Management (CRUD operations)
- Image Upload and Storage
- Filtering and Retrieval of Materials
- Secure Image Handling
- Error Handling
- Node.js
- Express.js
- MongoDB with Mongoose
- Firebase Storage for Image Handling
- Multer for File Upload Handling
- GET /materials: Fetch all materials from the database.
- GET /materials/:id: Retrieve a specific material by its ID, including its associated image.
- POST /materials: Add a new material to the database, including an image upload.
- [ Example fields for post method : name:FDA / technology:FDM / colors:Red, Black / pricePerGram:0.4 / applicationTypes:Educational / image:upload image from local system
- PUT /materials/:id: Update an existing material's details, optionally updating its associated image.
- DELETE /materials/:id: Remove a material from the database by its ID.
For detailed API usage, refer to the Models and Routes in the codebase.
To get the 3D Printing Materials API up and running on your local machine, follow these steps:
-
Clone the repository:
git clone [Your Repository URL]
-
Install dependencies: Navigate to the project directory and install the required dependencies using npm.
-
Set up environment variables: Create a
.env
file in the root directory of the project. Add the following environment variables to it:PORT=3000 MONGODB_URI=your_mongodb_uri FIREBASE_STORAGE_BUCKET=your_firebase_storage_bucketReplace
your_mongodb_uri
andyour_firebase_storage_bucket
with your actual MongoDB connection string and Firebase storage bucket URL. -
Set up Firebase:
- Create a Firebase project and download the service account key JSON file.
- Place this file in your project directory (ensure it's not in a public folder).
- Update the path to this file in your
firebaseConfig.js
.
-
Start the server: With all dependencies installed and environment variables set, you can start the server by running:Nodemon Server.js
We welcome contributions to improve our project To contribute, please follow these guidelines:
- Fork the repository and clone it to your local machine.
- Install dependencies using
npm install
. - Set up the development environment as described in the Installation section.
- Follow our coding standards.
- Make your changes and test them thoroughly.
- Submit a pull request with a detailed description of your changes.
For any queries or suggestions, please feel free to contact [Your Name/Email/Contact Information].