Connecting Soulmate
Connecting Soulmate is a comprehensive matchmaking website designed to facilitate seamless registration, profile management, and user interactions, with advanced features to ensure a user-friendly and secure experience.
- Multi-Page Registration: Users can fill out information across six pages.
- Save Progress: Users' progress is saved at each step, allowing them to continue from where they left off if they leave and return later.
- Partner Preferences: Matches are shown based on partner preferences specified in the sixth form.
- Shortlist, Ban, and Requests: Users can shortlist, ban, and send two kinds of requests (profile and interest).
- Inbox Management: Profile requests allow users to view details except phone numbers and emails. Interest requests enable chatting and viewing all details.
- Notifications: Users receive notifications for interest sent, interest accepted, and bans.
- Unblocking: Banned users can be unblocked, making them visible again to the user.
- Real-time Chat: Implemented using socket.io with reconnection and Redux middleware for frontend socket setup.
- Features: Includes latest message display, auto-scrolling to the last message, message editing, deleting, and seen/unseen status.
- Reporting: Users can report offenders. Verified reports result in permanent bans for the reported user.
- User Management: Admins can view a list of registering users. Approved users can access the website, rejected users can re-register after 15 days, and deleted users' data is soft-deleted for easy reapproval without re-filling all six pages.
- Notifications: Admins receive notifications for user actions like sending, accepting, and initiating chats, as well as user reports.
- Dynamic Currency Rates: Admins can dynamically update currency rates, ensuring they are always up-to-date.
- Multi-page registration and save progress features make it easy for users to complete their profiles at their own pace.
- Partner preferences ensure relevant matches, improving user satisfaction.
- The ability to shortlist, ban, and send requests, along with comprehensive inbox management, facilitates smooth user interactions.
- Real-time chat with advanced features enhances communication between users.
- Admins have comprehensive tools to manage user registrations, approvals, and rejections efficiently.
- Dynamic currency rate updates keep the platform financially relevant and accurate.
- Reporting features and strict actions against offenders maintain a safe and respectful community environment.
- Notifications keep users and admins informed about important actions, enhancing transparency and responsiveness.
To deploy this project and run on AWS with free SSL
Deployment Instructions for EC2 Instance Setup
After successfully creating an EC2 instance, navigate to the AWS Management Console. Click on the Instances section and find your newly created instance.
(while creating make sure to select a appropriate instance type t3 micro or t3a medium and so on.) Assign a Elastic IP to the instance so that even if the instance stops or restarts the IP will be same.
Click on the Instance ID
to access the instance summary.
On the instance summary page, locate the Connect button.
Click Connect
to access the "Connect to Instance" page.
On the new page, click on the Connect
button located at the bottom.
You will be redirected to the CloudShell
of your EC2 instance.
Follow the commands below in CloudShell
for a successful deployment:
Install node version manager (nvm) by typing the following at the command line.
#to become a root user
#don't need to be a root user, can continue without this
sudo su -
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh | bash
. ~/.nvm/nvm.sh
Use nvm to install the latest version of Node.js by typing the following at the command line.
nvm install node
sudo apt-get update -y
#sudo apt upgrade
#sudo apt upgrade
#sudo apt install -y git htop wget
#well you don't have to get htop or wget until necessary so :
sudo apt-get install git -y
now to ensure that git is installed type the follwing command:
git --version
This command will print the git version in the terminal.
Now Clone Your Server Repository where you have your server code
git clone https://github.com/clone-your-repo
now change the directory to your cloned folder or directory and install the packages in your package.json
file:
cd Connecting_Soulmate_Server
npm install
to run the server:
node app.js
npm install -g pm2
pm2 start app.js
pm2 save
the above command # saves the running processes # if not saved, pm2 will forget # the running apps on next boot
pm2 startup # starts pm2 on computer boot
Now all the steps required to run the server on EC2 is completed.
sudo apt install nginx
sudo nano /etc/nginx/sites-available/default
server_name yourdomain.com www.yourdomain.com;
location / {
proxy_pass http://localhost:5000; #whatever port your app runs on
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
sudo nginx -t
sudo service nginx restart
sudo apt install certbot python3-certbot-nginx
sudo certbot --nginx -d yourdomain.com -d subdomain.yourdomain.com
sudo nano /etc/nginx/sites-available/default
server {
listen 443 ssl;
server_name yourdomain.com;
ssl_certificate /etc/letsencrypt/live/yourdomain.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/yourdomain.com/privkey.pem;
location / {
# Your Nginx configuration goes here
}
}
You should now be able to visit your IP with no port (port 80) and see your app. Now let's add a domain
->Check that Port 80 redirect to Nodejs server
confirm it by the same testing command
sudo nginx -t
sudo systemctl reload nginx
Now you have successfully applied the SSL to your domain
sudo systemctl status snap.certbot.renew.service
Certbot usually adds a cron job or a systemd timer to handle the renewal process. You can check if it exists by running:
sudo crontab -u root -l
0 */12 * * * /usr/bin/certbot renew --quiet
#12 hrs
0 0 1 * * /usr/bin/certbot renew --quiet --deploy-hook "systemctl restart nginx"
#1st day of month
sudo crontab -u root -e
0 */12 * * * /usr/bin/certbot renew --quiet --deploy-hook "systemctl restart nginx"
To test the renewal process, you can do a dry run with certbot:
sudo certbot renew --dry-run
To run this project, you will need to add the following environment variables to your .env file
`MONGODB_URI`
`SECRET_KEY`
`JWT_SECRET`
`BREVO_API_KEY`
`SENDER_IDENTITY` # connecting-soulmate
`DOMAIN_EMAIL` # domain email from which the email will be sent
`ADMIN_EMAIL` # email of admin
`LOGO_IMAGE_URL` # logo url in emails
`FRONTEND_URL` # domain url for registration number url
`SECRET_ACCESS_KEY`
`ACCESS_KEY`
`BUCKET_NAME`
`BUCKET_REGION`
`CLIENT_SECRET`
`CLIENT_ID`
`APP_ID`
# Copy Objects from Source Bucket to Destination Bucket
aws s3 sync s3://one-container s3://second-container
# Verify the Copy Operation
aws s3 ls s3://second-container --recursive
# Delete Objects from Source Bucket (Optional)
aws s3 rm s3://one-container --recursive
Client: React JS, Context API, TailwindCSS, interceptors, axios, mui, OTPless
Server: Node, Express, Bcrypt, jsonwebtoken, MongoDB, Mongoose