📖 What is Pivot Server?
Pivot Server is a universal MongoDB-based API that allows multiple front-end projects to save and load their data
without needing separate backends. Each project uses a unique projectName to identify and manage its data.
Perfect for prototypes, dashboards, tracking systems, and any application needing persistent storage.
🚀 Multi-Project Support
Handle unlimited projects with unique identifiers
💾 MongoDB Storage
Reliable NoSQL database for flexible data structures
🔌 REST API
Simple HTTP endpoints for save, load, list, and delete
🌐 CORS Enabled
Access from any front-end application
🔌 API Endpoints
GET
/health
Check if the server is running and responsive.
POST
/api/save
Save or update project data. Creates a new project if it doesn't exist, updates if it does.
{
"projectName": "my-awesome-app",
"data": {
"users": [],
"settings": {},
"timestamp": "2026-02-02T20:00:00Z"
}
}
{
"success": true,
"message": "Data saved successfully",
"projectName": "my-awesome-app",
"timestamp": "2026-02-02T20:07:43.829Z"
}
GET
/api/load/:projectName
Load project data by project name.
GET /api/load/my-awesome-app
{
"success": true,
"data": {
},
"projectName": "my-awesome-app",
"updatedAt": "2026-02-02T20:07:43.829Z",
"createdAt": "2026-02-01T10:30:00.000Z"
}
GET
/api/projects
List all projects stored in the database.
{
"success": true,
"projects": [
{
"projectName": "honey-week6-tracking",
"updatedAt": "2026-02-02T20:00:00.000Z",
"createdAt": "2026-02-01T10:00:00.000Z"
},
{
"projectName": "demo-project",
"updatedAt": "2026-02-02T15:30:00.000Z",
"createdAt": "2026-02-02T15:30:00.000Z"
}
],
"count": 2
}
DELETE
/api/delete/:projectName
Delete a project and all its data permanently.
DELETE /api/delete/my-awesome-app
{
"success": true,
"message": "Project deleted successfully",
"projectName": "my-awesome-app"
}
💻 How to Use
Step 1: Choose a Unique Project Name
Each project needs a unique identifier. Use descriptive names like:
"honey-week6-tracking"
"sales-dashboard-2026"
"employee-timesheet"
"inventory-manager"
Step 2: Save Data from Your Front-End
const API_URL = 'https://neder.brimind.pro/api';
const PROJECT_NAME = 'my-project';
async function saveData() {
const myData = {
users: [{ name: "John", email: "john@example.com" }],
settings: { theme: "dark" },
timestamp: new Date().toISOString()
};
const response = await fetch(`${API_URL}/save`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
projectName: PROJECT_NAME,
data: myData
})
});
const result = await response.json();
console.log(result);
}
Step 3: Load Data in Your Front-End
async function loadData() {
const response = await fetch(`${API_URL}/load/${PROJECT_NAME}`);
const result = await response.json();
if (result.success) {
const myData = result.data;
console.log('Loaded data:', myData);
} else {
console.log('No data found');
}
}
💡 Pro Tip: Use the project URL or filename as your projectName to keep things organized.
For example: window.location.pathname.replace('/', '') or a hardcoded identifier.
🎯 Live Examples
Check out these working examples to see Pivot Server in action:
⚙️ Configuration
| Environment Variable |
Default Value |
Description |
PORT |
3005 |
Server port |
MONGO_URI |
mongodb://localhost:27017/pivotDB |
MongoDB connection string |