Creating and Launching a Comprehensive Social Media Platform | Utilizing React JS, Appwrite, Tailwind CSS, and React Query

Posted by


In this tutorial, we will build and deploy a full stack social media app using React JS for the front end, Appwrite for the backend, Tailwind CSS for styling, and React Query for data fetching. This tutorial will guide you through the process of setting up the project, creating the necessary components and pages, integrating Appwrite for user authentication and data storage, and deploying the app to a live server.

Prerequisites

Before you begin, make sure you have the following installed on your machine:

  • Node.js
  • npm or yarn
  • Appwrite server (you can install it locally or use the cloud version)

Step 1: Setting up the Project

Create a new React project using Create React App by running the following command in your terminal:

npx create-react-app social-media-app

Once the project is created, navigate to the project directory and install the required dependencies:

cd social-media-app
npm install appwrite react-query tailwindcss

Step 2: Creating the Components

Create the necessary components for your social media app such as Navbar, Home, Login, Signup, Profile, etc. You can use functional components for this tutorial.

Step 3: Setting up Tailwind CSS

Integrate Tailwind CSS into your project by creating a tailwind.config.js file at the root of your project and adding the following code:

module.exports = {
  mode: 'jit',
  purge: ['./src/**/*.{js,jsx,ts,tsx}'],
  darkMode: false,
  theme: {
    extend: {},
  },
  variants: {
    extend: {},
  },
  plugins: [],
}

Add the Tailwind CSS styles to your index.css file:

@tailwind base;
@tailwind components;
@tailwind utilities;

Step 4: Setting up Appwrite

Initialize Appwrite in your React project by creating a new file called appwrite.js and adding the following code:

import { Appwrite } from 'appwrite';

const appwrite = new Appwrite();

appwrite
  .setEndpoint('YOUR_ENDPOINT') // replace with your Appwrite endpoint
  .setProject('YOUR_PROJECT_ID'); // replace with your Appwrite project ID

export default appwrite;

Step 5: User Authentication

Create login/signup forms and implement user authentication using Appwrite. You can use the useUser hook provided by Appwrite to manage user authentication.

Step 6: Fetching Data using React Query

Use React Query to fetch and store data from Appwrite. You can create custom hooks to fetch data such as posts, comments, likes, etc., and use query caching for better performance.

Step 7: Building the App

Combine all the components, user authentication, and data fetching logic to build your social media app. Use Tailwind CSS for styling and make the app responsive for different screen sizes.

Step 8: Deploying the App

To deploy your app, you can use platforms like Vercel, Netlify, or Heroku. Follow their deployment instructions and make sure to set up environment variables for sensitive information such as API keys and endpoints.

Congratulations! You have successfully built and deployed a full stack social media app using React JS, Appwrite, Tailwind CSS, and React Query. Customize the app further by adding features like notifications, messaging, image uploading, etc., and continue to improve your coding skills. Happy coding!

0 0 votes
Article Rating
25 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
@nishavegad5409
1 month ago

Why I m not able to sign up the snapgram

@abhishekissus
1 month ago

somehow after deployment my post dont show up

@jihye209
1 month ago

23:52

@softube19
1 month ago

there is a problem in login part here. so if somebody fix it please send me how?

@palhorses4473
1 month ago

Well that sucked. Coded along with you, even made a profile page and followers etc. Ran smooth like a babys butt on localhost but been working for 3 days to deploy but got 1884 errors… Great. Better focus on becoming a cleaning lady instead of developer. Wasted a week for nothing. Still, on localhost it's beautiful thow and works perfect. Anyway, thanks for the tutorial

@МиколаБіленький-й3г
1 month ago

Guys,is this video tutorial works fine?I mean that have you any problems with implementing code?And that all free?I mean that need i pay for any utils?

@SarvarbekIlyosov
1 month ago

This is the kid of Instagram & Snapchat 😅

@deideideidei
1 month ago

but environment variables starting with `VITE_` will be exposed to the client, right?

@РодионЧаускин
1 month ago

Brown Brenda Taylor Anna Robinson Steven

@HonorHasCome
1 month ago

Is Appwrite suitable for large-scale applications?

@w.t.cfacts2013
1 month ago

Does Redux/Thunk
used in the application

@JoeHany-c4f
1 month ago

great job

@EmekaNwadiogbu-nl5zb
1 month ago

The AuthContext is missing declaration of the IContextType in the types folder and index.ts file. There is no declaration of IContextType as stated in the video tutorial, and also there is no declaration in the provided github or gist files

@EmekaNwadiogbu-nl5zb
1 month ago

Hello, do you happen to have a figma design of this social media app? I[m trying to understand and figure out the structure of the side-img.svg file and the other assets to know if these logos/vectors are a single file or a lot of components put together within figma.

@noumbissistael1470
1 month ago

Just finishing the tutorial and it was awesome
You really did a great job here @Adrian. Really appreciate

Will be glad to have more react tutorials as this one, was really good!

@demossldemo
1 month ago

hello , i am getting error when in post data in appwriter "AppwriteException: Invalid `password` param: Password must be between 8 and 265 characters long, and should not be one of the commonly used password."

@HiImKyle
1 month ago

Feel like this video would be like 2 hours shorter if you just actually used the copilot suggestions instead of typing it out manually

@Winsome-24
1 month ago

hey someone please give me a reply!! Can i get the Database structure figma?

@Sameer-mo7rn
1 month ago

Finally completed this Project with all the tasks done.. its been a hell of a journey but yeah it was all worth it thanks buddy

@sumandevkota2838
1 month ago

is there isLoading in mutation?i think there is isPending in mutation