8000 GitHub - NirveonX/N-Backend_App
[go: up one dir, main page]

Skip to content

NirveonX/N-Backend_App

Repository files navigation

NirveonX App Backend

Backend API for NirveonX mobile application.

Features

  • User authentication (Google OAuth + Local)
  • Real-time chat functionality
  • Team management
  • Company reviews
  • Certificate management
  • RESTful API endpoints

Tech Stack

  • Node.js & Express.js
  • MongoDB with Mongoose
  • Passport.js (Authentication)
  • JSON Web Tokens (JWT)
  • Google OAuth 2.0
  • Express Session with MongoDB store

Folder Structure

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

Getting Started

Prerequisites

  • Node.js 18.x or higher
  • MongoDB database
  • Google OAuth credentials

Installation

  1. Clone the repository
git clone <repository-url>
cd N-Backend_App
  1. Install dependencies
npm install
  1. Set up environment variables
cp .env.example .env

Edit .env and fill in your values.

  1. Start the development server
npm run dev
  1. For production
npm start

Environment Variables

See .env.example for all required environment variables.

Key variables:

  • MONGO_URL - MongoDB connection string
  • SESSION_KEY - Session secret key
  • JWT_SECRET - JWT secret key
  • GOOGLE_CLIENT_ID - Google OAuth client ID
  • GOOGLE_CLIENT_SECRET - Google OAuth client secret
  • PORT - Server port (default: 3000)

API Endpoints

Authentication

  • POST /auth/register - Register new user
  • POST /auth/login - Login user
  • GET /auth/google - Google OAuth login
  • GET /auth/google/callback - Google OAuth callback

Chat

  • GET /api/chats - Get user chats
  • POST /api/chats - Create new chat
  • DELETE /api/chats/:id - Delete chat

Messages

  • GET /api/messages/:chatId - Get messages for a chat
  • POST /api/messages - Send new message

Deployment

See DEPLOYMENT.md for detailed deployment instructions on Render.

License

ISC

Author

NirveonX Team

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0