Backend API for NirveonX mobile application.
- User authentication (Google OAuth + Local)
- Real-time chat functionality
- Team management
- Company reviews
- Certificate management
- RESTful API endpoints
- Node.js & Express.js
- MongoDB with Mongoose
- Passport.js (Authentication)
- JSON Web Tokens (JWT)
- Google OAuth 2.0
- Express Session with MongoDB store
config/
- cloudinary.js # Cloudinary configuration
- passport.js # OAuth strategy code
models/
- user.js # User Model
- Chat.js # Chat Model
- Message.js # Message Model
- teamMemberModel.js # Team Member Model
- companyReviewModel.js # Company Review Model
- counterModel.js # Counter Model
router/
- authRouter.js # Authentication routes
- chatRouter.js # Chat routes
- messageRouter.js # Message routes
- teamRouter.js # Team management routes
- companyReviewRouter.js # Company review routes
- certificateRouter.js # Certificate routes
- bubbleRouter.js # Bubble routes
- adminRouter.js # Admin routes
middlewares/
- authMiddleware.js # JWT authentication middleware
- adminAuth.js # Admin authentication middleware
- verifyAdmin.js # Admin verification middleware
init/
- data.js # Initial data setup
- index.js # Database initialization
app.js # Main server file
package.json # Dependencies
.env.example # Environment variables template
- Node.js 18.x or higher
- MongoDB database
- Google OAuth credentials
- Clone the repository
git clone <repository-url>
cd N-Backend_App- Install dependencies
npm install- Set up environment variables
cp .env.example .envEdit .env and fill in your values.
- Start the development server
npm run dev- For production
npm startSee .env.example for all required environment variables.
Key variables:
MONGO_URL- MongoDB connection stringSESSION_KEY- Session secret keyJWT_SECRET- JWT secret keyGOOGLE_CLIENT_ID- Google OAuth client IDGOOGLE_CLIENT_SECRET- Google OAuth client secretPORT- Server port (default: 3000)
POST /auth/register- Register new userPOST /auth/login- Login userGET /auth/google- Google OAuth loginGET /auth/google/callback- Google OAuth callback
GET /api/chats- Get user chatsPOST /api/chats- Create new chatDELETE /api/chats/:id- Delete chat
GET /api/messages/:chatId- Get messages for a chatPOST /api/messages- Send new message
See DEPLOYMENT.md for detailed deployment instructions on Render.
ISC
NirveonX Team