A lightweight, modern full-stack web application that allows users to upload images alongside descriptions. Images are handled via binary streams, processed in memory, and instantly served through ImageKit's global CDN, with all meta-data securely stored in MongoDB.
- In-Memory Streams: Utilizes
multer.memoryStorage()to handle multipart file buffers without writing junk text files to server disks. - ImageKit Integration: Native SDK processing for raw buffers to deliver ultra-fast CDN asset paths.
- Dynamic Community Feed: Responsive card grid UI that handles single or multi-post arrays seamlessly using Axios.
- Secure Architecture: Production-ready
.gitignoremapping to fully protect operational environment parameters.
- Frontend: React.js, Vite, React Router DOM v6, Axios
- Backend: Node.js, Express.js, Multer
- Database: MongoDB (Mongoose ODM)
- Cloud Storage: ImageKit.io CDN
my-project-root/
├── backend/
│ ├── src/
│ │ ├── models/post.model.js # Mongoose Schema
│ │ ├── services/post.service.js # ImageKit CDN Engine
│ │ └── app.js # Express Application API Routing
│ ├── .env # Environment Variables (Ignored via git)
│ └── package.json
└── frontend/
├── src/
│ ├── pages/
│ │ ├── CreatePost.jsx # Multi-part Payload Upload Form
│ │ └── PostFeed.jsx # Live Card Grid Feed Component
│ ├── App.jsx # React Router Context Setup
│ └── index.css # Clean Minimal Layout Styling
└── package.json
- Node.js installed locally.
- A free account on ImageKit.io.
- A running MongoDB instance (Local Community Server or Atlas Cloud).
Create a .env file in the root of your backend/ folder:
public_key=your_imagekit_public_key
private_key=your_imagekit_private_key
url_key=https://imagekit.iocd backend
npm install
node server.jsExpected console output: the server is running on port no 3000
cd ../frontend
npm install
npm run devExpected browser interface running on: http://localhost:5173
| HTTP Method | Route | Description | Multipart Form Fields |
|---|---|---|---|
| POST | /create-post |
Processes binary buffer, uploads to CDN, saves to DB. | image (File), description (Text) |
| GET | /posts |
Pulls collection array to populate feed components. | None |