S2Media which stands for Simple Social Media is a social media site which is inspired from the best features of popular applications like Facebook, Twitter, Instagram and Linkedin
As a beginner to web devlopment, I was always facinated by sites which had a lot of user interaction, like Amazon and Facebook, but Facebook caught my eye with real time notifications
That was the instant I decided to build a simpler version of these gaigantic social media sites. The aim has always been to learn how web technologies work together when there is ton a of user interaction and to implement as many features possible including real time notifications (this was the main feature I wanted to have)
Client
- React
- NextJs
- Tailwind CSS
- React Query
- Socket.io
Server
- NodeJs
- Express
- Docker
- Nginx
- Prisma
- Redis
- Postgresql
Services
- Firebase (auth)
- Cloudinary
- Github Actions
- Authentication and authorization
- Email and password
- Google OAuth
- Posts with image uploads
- Create posts
- Delete posts
- Read posts
- Like posts
- Bookmark posts
- Comment on posts
- Reply on comments
- Like comments and replies
- Real time Notifications
- Follow users
- Public and private user profiles
- Infinite scroll feed
- Autocomplete search for users
There are some prerequisites to run the app successfully on your local machine, follow the below steps to get started
Run the below commands in your terminal to confirm that all the requirements are passed to run the project Locally
docker --versiondocker compose versionnode -vyarn -v
All the above commands should execute successfully and output the version numbers specified
Clone the project
git clone https://github.com/sairajchouhan/s2media.gitGo to the project directory
cd s2mediaInstall dependencies
yarn boot- Click here
and complete
setp 1to create a firebase project and register a web app - Creating a service account, click here
and follow the setps to generate a private key file for your service account and rename it
to
admin-dev.json - Copy
admin-dev.jsonto/apps/server/admin-dev.json
Click here to signup for cloudinary, after successfull signup you will be redirected to the dashboard where on the top you can see your API keys
- Create a file named
.env.localin/apps/clientfolder - Copy the contents of
.env.local.exampleto.env.local - Browse to your firebase project settings, by clicking on the gear or cog icon in the left sidebar
- In the general setion of project settings, scroll down
until you find
firebaseConfigobject with some project credentials - Now fill your
.env.localwith the values fromfirebaseConfigobject in your firebase project settings - All enviornment Variables in
client👇NEXT_PUBLIC_FIREBASE_API_KEY=<fill_this>NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=<fill_this>NEXT_PUBLIC_FIREBASE_PROJECT_ID=<fill_this>NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET=<fill_this>NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID=<fill_this>NEXT_PUBLIC_FIREBASE_APP_ID=<fill_this>
- Create a file
.envinapps/serverfolder - Copy the contents of
apps/server/.env.exampletoapps/server/.env - Navigate to your Cloudinary console and copy
the values of Cloud name, API Key, and API Secret from the
top of the dashboard and paste them in the respective keys in
/apps/server/.envfile - Do not modify
PORTandDATABASE_URLenviornment variables - All enviornment variables in
server👇CLOUDINARY_CLOUD_NAME=<fill_this>CLOUDINARY_API_KEY=<fill_this>CLOUDINARY_API_SECRET=<fill_this>PORT=5000DATABASE_URL=postgresql://postgres:password@db:5432/s2media?schema=public
Now that all requirements are in place lets start our servers
- Run
yarn dev:clientto start client on port3000 - Run
yarn dev:upto start our server (nginx) which listens for requests on port5000
🥳 Hurray! you made it, go ahead to localhost:3000 to see the
project in action