Multi-purpose platform in Node.js and MongoDB
A multi-purpose platform is created in Node.js and MongoDB. Developing an API in Node.js and MongoDB allows you to create real-time, high performance and scalable applications. When you are building a website or a mobile app, you might have a different design than what is already built. But your backend will be almost similar to your competitor. Let’s say you want to build a social network like Facebook. You will pick an HTML template or design a UI specific for your business. But you want to have a module to create users, posts, pages, groups, friends, chats and much more.
So we are providing you a multi-purpose platform that allows you to use social network, job portal, manage your media files and much more. It is a self-hosted script so all the data will be stored on your server, no third-party storage service is used here.
Here is the complete documentation for an API developed in Node.js and MongoDB.
Tech stack:
- Bootstrap 5.0.2
- React 18.2.0
- Node.js 20.10.0
- MongoDB 4.2.5
Files included:
- api
- index.js
- installer.js
- modules
- admin
- admin.js
- auth.js
- auth-optional.js
- auth.js
- blogs.js
- categories.js
- chats.js
- files.js
- job-portal
- cvs.js
- gigs.js
- jobs.js
- mails.js
- media.js
- notifications.js
- sn
- friends.js
- groups.js
- pages.js
- posts.js
- users.js
- admin
- package.json
- uploads
- private
- public
- web
- blogs
- index.html
- detail.httml
- change-password.html
- index.html
- job-portal
- applied.html
- create.html
- cv-manager.html
- detail.html
- edit.html
- index.html
- my.html
- login.html
- media
- index.html
- edit.html
- profile.html
- public
- css
- js
- img
- register.html
- sn
- chat.html
- edit-comment.html
- edit-post.html
- edit-reply.html
- friends.html
- groups
- create.html
- detail.html
- edit.html
- index.html
- members.html
- my-joined.html
- my.html
- pending-posts.html
- index.html
- notifications.html
- pages
- create.html
- detail.html
- edit.html
- index.html
- followers.html
- my-followed.html
- my.html
- post.html
- profile.html
- search.html
- send-reply.html
- blogs
- admin (SPA)
- package.json
- public
- src
- App.css
- App.js
- index.js
- components
- blogs
- AddPost.js
- Comments.js
- EditPost.js
- Posts.js
- categories
- AddCategory.js
- Categories.js
- EditCategory.js
- Dashboard.js
- ecommerce
- AddProduct.js
- EditProduct.js
- Orders.js
- Products.js
- files
- Files.js
- jobs
- Jobs.js
- layouts
- Header.js
- Footer.js
- Sidebar.js
- Login.js
- sn
- Posts.js
- users
- AddUser.js
- EditUser.js
- Users.js
- blogs
User Registration and Profile
This API allows you to register an account. The passwords are encrypted before saving them in database. User can also login using his email and password that he entered during registration.
On successfull login, a Json Web Token (JWT) is generated and returned in the API response. The client application needs to save that token in its local storage because that token will be use in other APIs in headers to identify the user. This token is also stored in server as well. So if you want to logout a user manually, you can simply remove his token from database.
User can edit his name and profile image. The email field is read-only, it cannot be changed. User can also change his password. For that, he needs to provide his current password and enter his new password 2 times for confirmation.
Social Network Posts
If you are building a social network, then this module allows you to create and manage posts for a social network. You can also share other’s posts on your timeline. You can edit or remove your own posts. Other users will be able to like, comment or share your posts. Users will be able to edit to delete their own comments. You will be able to reply to the comments on your posts, and you can also edit or remove your reply if you want. Users can also see the list of all users who has liked or shared your post.
Pages
If you are running a business, you can create a page for your business and start posting about your products or services in that page. In order to create a page, you need to set it’s name, tell a little about the page, and provide a cover photo for the page. User can follow your page and start seeing your page’s posts in their newsfeed. Only creator of page can create a post in that page.
You can see a list of all users who has followed your page. User can also see a list of all pages he has followed. The owner of the page can edit or delete the page. Once page is deleted, all the posts inside that will be deleted as well.
Groups
You can create groups to create a community of like-minded people. In order to create a group, you need to enter the name of group, a little description about the group and it’s cover photo. You can see a list of all groups created in the platform. There are separate links from where you can see only the groups that you have created or the groups you have joined. You can join or leave the group whenever you want. However, admin of the group can also remove you from the group if he wants.
Only admin or group members can post in a group. Posts uploaded by admin will be immediately displayed on the groups newsfeed. However, the posts uploaded by group members will be held pending for approval from the admin. Admin can see a list of all posts uploaded by group members. He can accept or decline a post he wants.
Admin of the group can update the name or description of the group, and he can also change the cover photo of the group. Admin can delete the group as well. Upon deleting, all the posts uploaded in that group will be deleted as well.
Media
This API allows you to upload media files (images, videos) on the platform. Each media file will have a title, alt attribute, and caption. These will help you in your Search Engine Optimization (SEO). You can edit or delete your own media files whenever you want.
Friends
You can create friends by sending them a friend request, just like you do in Facebook. Other user can see a list of all friend requests he has received. He can accept or decline your request. If accepted, then you both will become friends and you can chat with each other. You can see a list of all of your friends. At any point, you can remove a user from your friend list.
Realtime Chat
You can have realtime chat with your friends. Chats are end-to-end encrypted, that means that the messages are encrypted before sending to the server. And they are decrypted only after receiving the response from the server. Your messages will remain secure in-transit.
For realtime communication, we are using Socket IO. When you send a message, an event is emitted. The receiver will be listening to that event and display a notification alert that you have received a new message. If the chat is already opened, then the new message will automatically be appended at the bottom of the chat.
Job Portal
Since this is a multi-purpose platform and it is developed in scalable technologies (Node.js & MongoDB), a job portal platform is also added that allows recruiter to post jobs and candidates can apply on that job. Recruiter can see all the applications he has received on a job and can change the status of applicant to shortlisted, interviewing, rejected or selected etc. Candidate can upload multiple CVs and choose the relevant CV while applying for the job. Recruiter can update or delete the job any time.
Admin panel
An admin panel is created where you can manage all the users, social network posts and jobs created on the platform. It is a single page application created in React JS and can be deployed as a sub-domain to your main website.
Super admin can see the list of all users. He can add a new user if he wants. An email with password set by admin will be sent to the new user. Admin can also update the user password as well. He can also delete the user, all the posts uploaded by that user will be deleted as well.
Super admin can see all the posts uploaded on social network platform. Just like users, he can delete any post he did not feel appropriate.
Admin can also see all the jobs posted by recruiter and if any job post goes against the standards, super admin can remove it.
Blogs
Since this is a multi-purpose platform, so I added a blog module that allows you to write articles on your website. Admin can create blogs from admin panel and they will be displayed on user side. User can post a comment if they are logged-in. Other users or admin can reply to their comments. Admin can manage all posts and comments from admin panel. Admin can delete any post or command he did not find suitable.
Installer
Run the following commands in your “admin” folder:
npm install
npm start
In order to create a super admin, you need to run the following command in your “premium-api” folder once:
node installer.js
This will create a super admin in your database. You can set the email and password of your choice from “installer.js” file.
Paste the “multi-purpose-platform-nodejs-mongodb” folder in your “htdocs” folder if you are using XAMPP or MAMP, or in “www” folder if you are using WAMP.
Run the following commands in the “premium-api” folder:
npm update
npm install -g nodemon
nodemon index.js
Project can be accessed from:
http://localhost/multi-purpose-platform-nodejs-mongodb/web/index.html
Demos
1. Social network – Posts
2. Pages
3. Groups
4. Friends & chat
5. Job portal
6. Admin panel
7. Blogs
More features can also be added on-demand in this multi-purpose platform. It is developed in Node.js and MongoDB, but we can also develop it in PHP & MySQL if that is your requirement.
Price: $100 $10 (till 30 March 2025)
How to buy:
Send your name, email and the project name on WhatsApp or E-mail and we will send you the payment details. Once payment is made, we will share the source files with you.
- WhatsApp: +923105461304
- Email: support@adnan-tech.com