This is the backend server for the AppOrbit Platform. It provides secure APIs, user authentication, product moderation, and payment processing.
- Firebase Admin SDK for user authentication
- Stripe integration for payments
- MongoDB for data storage (users, products, reviews, etc.)
- CORS-enabled RESTful API using Express
- Environment variable support with dotenv
- Express – Server-side routing and API handling
- MongoDB – NoSQL database for app data
- Firebase Admin SDK – Authentication and role-based access
- Stripe – Secure payment processing
- dotenv – Manage environment configuration
- cors – Enable cross-origin requests from frontend
| Method | Endpoint | Middleware | Description |
|---|---|---|---|
| POST | /userInfo |
None | Register a new user |
| GET | /users/role/:email |
verifyJWT | Get role of a user |
| GET | /userInfo/:email |
verifyJWT | Get user info by email |
| PATCH | /postLimit/:email |
verifyJWT | Decrement user post limit |
| GET | /manage-users |
verifyJWT, verifyAdmin | Get all users (admin only) |
| PATCH | /status-update/:id |
verifyJWT, verifyAdmin | Update user role |
| Method | Endpoint | Middleware | Description |
|---|---|---|---|
| GET | /pending-products |
verifyJWT, verifyModerator | Get pending products for review |
| POST | /productInfo |
verifyJWT | Submit a new product |
| GET | /products/search |
None | Search products with pagination |
| DELETE | /product-delete/:id |
verifyJWT | Delete a product |
| GET | /my-products |
verifyJWT | Get products submitted by user |
| GET | /product |
None | Get paginated list of accepted products |
| GET | /product-details/:id |
verifyJWT | Get product details by ID |
| GET | /feature-product |
None | Get featured products |
| GET | /trending-products |
None | Get trending products |
| PUT | /vote-product/:id |
None | Vote/upvote a product |
| PUT | /product-update/:id |
verifyJWT | Update product info |
| PATCH | /product-status-update/:id |
verifyJWT, verifyModerator | Update product status (Accept/Reject/Feature) |
| Method | Endpoint | Middleware | Description |
|---|---|---|---|
| GET | /product-review |
None | Get all product reviews |
| GET | /product-review/:id |
verifyJWT | Get reviews for a product |
| POST | /product-review |
verifyJWT | Submit a product review |
| Method | Endpoint | Middleware | Description |
|---|---|---|---|
| GET | /coupon |
None | Get all coupons |
| PUT | /coupon/:id |
verifyJWT, verifyAdmin | Update a coupon |
| GET | /coupon/:id |
verifyJWT, verifyAdmin | Get coupon by ID |
| POST | /coupon |
verifyJWT, verifyAdmin | Create a new coupon |
| DELETE | /coupon/:id |
verifyJWT, verifyAdmin | Delete a coupon |
| Method | Endpoint | Middleware | Description |
|---|---|---|---|
| GET | /reported-contents |
verifyJWT, verifyModerator | Get reported content |
| PUT | /reported-contents/:id |
verifyJWT | Report a product |
| Method | Endpoint | Middleware | Description |
|---|---|---|---|
| POST | /create-payment-intent |
verifyJWT | Create Stripe payment intent |
| POST | /payments |
verifyJWT | Record completed payment |
| Method | Endpoint | Middleware | Description |
|---|---|---|---|
| POST | /subscribenewsletter |
None | Subscribe to newsletter |
| Method | Endpoint | Middleware | Description |
|---|---|---|---|
| GET | /dashboard/summary |
verifyJWT, verifyAdmin | Get admin dashboard summary |
Follow these steps to run the project locally:
git clone https://github.com/Hossahin/apporbit-server.gitcd apporbit-servernpm installCreate a
.envfile in the root directory and add the following:
DB_USER=your_database_username
DB_PASS=your_database_password
FIREBASE_SERVICE_KEY=your_firebase_key //base64nodemon index.jsVisit the local server: