A full-stack social networking platform built with the MEAN stack (MongoDB, Express.js, Angular, Node.js) with real-time communication features.
- 🔐 User Authentication & Authorization
- 📝 Post Creation and Interaction
- 💬 Real-time Chat System
- 👥 Friend Management System
- 🖼️ Media Upload Support
- 📱 Responsive Design
- ⚡ Real-time Updates using Socket.IO
- Framework: Angular 20+
- UI Components: Angular Material
- Styling: CSS with Bootstrap
- State Management: Built-in Angular Services
- Real-time Communication: Socket.IO Client
- HTTP Client: Angular HttpClient
- Runtime: Node.js
- Framework: Express.js
- Database: MongoDB with Mongoose
- Authentication: JWT (JSON Web Tokens)
- Real-time Server: Socket.IO
- File Upload: Multer
- API Validation: Express Validator
Before running this application, make sure you have the following installed:
- Node.js (v18+ recommended)
- MongoDB
- Angular CLI
- TypeScript
social-App/
├── Front/ # Angular Frontend
│ ├── src/
│ │ ├── app/
│ │ │ ├── Componants/ # Angular Components
│ │ │ ├── Services/ # Angular Services
│ │ │ ├── Interceptors/ # HTTP Interceptors
│ │ │ └── pipes/ # Custom Pipes
│ │ └── environments/ # Environment Configuration
│ └── package.json
│
└── Social-Back/ # Node.js Backend
├── src/
│ ├── config/ # Configuration Files
│ ├── controllers/ # Route Controllers
│ ├── middlewares/ # Custom Middlewares
│ ├── models/ # Mongoose Models
│ ├── routes/ # API Routes
│ ├── services/ # Business Logic
│ ├── utils/ # Utility Functions
│ └── validators/ # Request Validators
└── package.json
-
Navigate to the backend directory:
cd Social-Back -
Install dependencies:
npm install
-
Create a
.envfile in the root directory with the following variables:MONGODB_URI=your_mongodb_connection_string JWT_SECRET=your_jwt_secret API_VERSION=v1 PORT=3000 CLIENT_URL=http://localhost:4200
-
Start the development server:
npm start
-
Navigate to the frontend directory:
cd Front -
Install dependencies:
npm install
-
Start the development server:
ng serve
The application will be available at http://localhost:4200
- JWT-based authentication
- Secure password hashing with bcrypt
- Protected routes with auth middleware
- Create, read, update, and delete posts
- Support for text and media content
- Privacy settings (public, private, friends-only)
- Like and interaction system
- Real-time messaging using Socket.IO
- Private and group chat support
- Online status indicators
- Message history
- Send/Accept friend requests
- Friend list management
- Online status tracking
The API is versioned and all endpoints are prefixed with /api/v1/
-
Authentication
- POST
/api/v1/auth/register- Register new user - POST
/api/v1/auth/login- User login
- POST
-
Posts
- GET
/api/v1/posts- Get all posts - POST
/api/v1/posts- Create new post - PUT
/api/v1/posts/:id- Update post - DELETE
/api/v1/posts/:id- Delete post
- GET
-
Chat
- GET
/api/v1/chats- Get user chats - POST
/api/v1/chats- Create new chat - GET
/api/v1/messages/:chatId- Get chat messages
- GET
-
Friends
- GET
/api/v1/friends- Get friend list - POST
/api/v1/friends/request- Send friend request - PUT
/api/v1/friends/accept/:id- Accept friend request
- GET
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the ISC License.
Abdelrhman
- Angular Material for UI components
- Socket.IO for real-time features
- MongoDB Atlas for database hosting