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!
Why I m not able to sign up the snapgram
somehow after deployment my post dont show up
23:52
there is a problem in login part here. so if somebody fix it please send me how?
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
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?
This is the kid of Instagram & Snapchat 😅
but environment variables starting with `VITE_` will be exposed to the client, right?
Brown Brenda Taylor Anna Robinson Steven
Is Appwrite suitable for large-scale applications?
Does Redux/Thunk
used in the application
great job
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
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.
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!
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."
Feel like this video would be like 2 hours shorter if you just actually used the copilot suggestions instead of typing it out manually
hey someone please give me a reply!! Can i get the Database structure figma?
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
is there isLoading in mutation?i think there is isPending in mutation