Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pixisphere Backend API

Pixisphere is a backend platform built with Node.js, Express.js, and MongoDB, supporting three user roles: client, partner, and admin.

This backend handles:

  • Authentication (Email/Password + OTP)
  • Partner onboarding & admin approval
  • Client inquiries (leads)
  • Partner portfolios
  • Admin dashboard (approvals, KPIs, reviews)
  • Category and location management

Tech Stack

  • Node.js with Express.js
  • MongoDB with Mongoose
  • JWT for authentication
  • bcryptjs for password hashing
  • dotenv, cors, etc.


⚙️ Installation

1. Clone this repo

git clone https://github.com/your-username/pixisphere-backend.git
cd pixisphere-backend
  1. Install dependencies
npm install
  1. Setup environment variables Create a .env file in the root:
PORT=5000
MONGO_URI=mongodb://localhost:27017/pixisphere
JWT_SECRET=your_jwt_secret
  1. Start MongoDB
    mongod
  2. Start the server
npm start

You should see:

Server running on port 5000
MongoDB connected

API Testing via Postman

  1. Register as a partner
POST /auth/register
Body:
{
  "name": "Devesh",
  "email": "partner@example.com",
  "password": "Secret123!",
  "role": "partner"
}
  1. Login (fails until admin approves)
POST /auth/login
Body:
{
  "email": "partner@example.com",
  "password": "Secret123!"
}

Will return 403 Forbidden if not yet approved.

As Admin: Approve the partner

GET    /admin/partners         // list pending profiles
PUT    /admin/partners/:id/approve

Use admin token for this!

  1. Partner logs in successfully
POST /auth/login
Returns: { token }
  1. Submit partner profile
  POST /partners/onboard
Headers:
 Authorization: Bearer <partner_token>
Body:
{
 "bio": "Experienced photographer",
 "serviceCategories": ["wedding", "event"],
 "city": "Delhi",
 "documents": ["mock-url-a", "mock-url-b"]
}
  1. Client submits inquiry
POST /inquiries
Headers: Bearer <client_token>
Body:
{
 "category": "wedding",
 "city": "Delhi",
 "date": "2025-06-20",
 "budget": 5000,
 "imageUrl": "http://image.com"
}

7- Inquiry (Lead) APIs

Create Inquiry (Client)

POST /inquiries

Headers: Authorization: Bearer <client_token>
{
  "category": "wedding",
  "city": "Delhi",
  "date": "2025-07-01",
  "budget": 15000,
  "imageUrl": "http://image.com/photo.jpg"
}

8- Get Assigned Leads (Partner)

GET /inquiries/leads Headers: Authorization: Bearer <partner_token>

9- Update Inquiry Status (Partner)

PUT /inquiries/:id/status Headers: Authorization: Bearer <partner_token>

{
  "status": "responded"
}

10- Portfolio APIs (Partner) Add Portfolio Item

POST /portfolio Headers: Authorization: Bearer <partner_token>

{
  "description": "Sample wedding project",
  "imageUrl": "http://portfolio.com/image1.jpg"
}

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages