https://github.com/puzant/portfolio-backend
Back-End Service For Portfolio
https://github.com/puzant/portfolio-backend
cloudinary-sdk cronjob ejs express mongodb mongoose mvc nodejs
Last synced: 19 days ago
JSON representation
Back-End Service For Portfolio
- Host: GitHub
- URL: https://github.com/puzant/portfolio-backend
- Owner: puzant
- Created: 2024-12-19T07:52:37.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2025-04-28T08:34:55.000Z (about 1 month ago)
- Last Synced: 2025-04-28T09:56:38.864Z (about 1 month ago)
- Topics: cloudinary-sdk, cronjob, ejs, express, mongodb, mongoose, mvc, nodejs
- Language: JavaScript
- Homepage:
- Size: 417 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# Portfolio Backend






This project is a backend system built using Node.js, Express, and MongoDB to manage projects, publications, and associated media. It includes features like CRUD operations, user authentication, file uploads with Cloudinary integration, caching with Node-cache, and a server-side rendered CMS using EJS templates. This backend system is designed with modern software development practices like MVC, dependency injection, and design patterns to ensure maintainability and scalability.
Access the API at `https://portfolio-backend-gq2s.onrender.com/cms`.

## API Endpoints
**Projects**
| **Endpoint** | **Method** | **Description** | **Data Fields** |
| -------- | ------- | ------- | ------- |
| /projects/api | GET | Get all projects | N/A
| /projects/api/add | POST | Create new project | name, descrption, preview, link
| /projects/api/edit/:id | POST | Edit project | name, descrption, preview, link
| /projects/api/delete/:id | DELETE | Delete project | id
| /projects/api/projects-images | GET | Get projects images | N/A**Publications**
| **Endpoint** | **Method** | **Description** | **Data Fields** |
| -------- | ------- | ------- | ------- |
| /publications/api | GET | Get all publications | N/A
| /publications/api/add | POST | Create new publication | title, preview, publishedDate, duration, link
| /publications/api/edit/:id | POST | Edit publication | name, descrption, preview, link
| /publications/api/delete/:id | DELETE | Delete publication | id**Travel Images**
| **Endpoint** | **Method** | **Description** | **Data Fields** |
| -------- | ------- | ------- | ------ |
| /travel-images/api | GET | Get all travel images | N/A
| /travel-images/api/add | POST | Add new travel image | N/A
| /travel-images/api/delete/:id | DELETE | Delete travel image | N/A## Features
- **Node.js**: The backend runtime environment.
- **Express**: Lightweight and flexible web framework.
- **MongoDB**: Database for storing and managing dynamic content.
- **EJS Templates**: Render the views of the CMS, enabling dynamic server-side content generation.
- **CRUD operations**: Get/ Add / Edit / Delete over projects, publications, travel images
- **Cloudinary SDK**: Used for fetching and managing images stored in Cloudinary.
- **Deployed on Render**: Easily accessible and scalable deployment.
- **WebP Image Format**: Optimized image format for faster load times.
- **Cron Job**: Set to run every 13 minutes, sending an HTTP request to the API to prevent it from entering hibernation mode.
- **Node Cache**: Caches Cloudinary images with a 12-hour TTL, improving performance and reducing redundant requests.## Dependencies
- **Node.js**: Runtime environment
- **Express**: Web framework
- **Cloudinary SDK**: Cloud image management