MSN_back is the backend server for the MSN Messenger application. It provides RESTful API endpoints for user authentication, conversation management, messaging, file sharing, and user management.
- Node.js - JavaScript runtime
- Express - Web framework
- Passport - Authentication middleware
- CORS - Cross-Origin Resource Sharing
- Dotenv - Environment variable management
- PostgreSQL - Database
Route | Description |
---|---|
/auth |
Authentication routes (login, register, etc.) |
/conv |
Conversation management routes |
/messages |
Message handling routes |
/files |
File upload and management routes |
/users |
User profile and management routes |
- Node.js (v14.x or higher)
- npm or yarn
- MongoDB instance (local or remote)
- Clone the repository
git clone https://github.com/Giolii/MSN_back.git
cd MSN_back
- Install dependencies
npm install
# or
yarn install
- Create environment variables
# Create a .env file in the root directory
touch .env
Add the following environment variables to the .env file:
PORT
DATABASE_URL
JWT_SECRET
NODE_ENV=production
VITE_FRONTEND_URL
- Start the development server
npm run dev
# or
yarn dev
- The server will start on the specified port (default: 8000)
Authentication is implemented using Passport.js with JWT strategy:
/auth/register
- Create a new user account/auth/login
- Authenticate and receive a JWT token- Protected routes require a valid JWT token in the Authorization header
The application likely uses the following data models (based on routes):
- User - User account information
- Conversation - Chat conversation data
- Message - Individual messages within conversations
- File - Uploaded files metadata
This backend works in conjunction with MSN_front, which handles the user interface and client-side logic.
npm run build
# or
yarn build
npm start
# or
yarn start
The backend can be deployed on various platforms including:
- Heroku
- Railway
- Render
- AWS Elastic Beanstalk
- Digital Ocean
- Docker containers
Thank you!