-
run react server -> npm run dev
-
When we use json server run -> json-server --watch ./src/app/data.json --port 8080
PostApp is a simple social media-like application built using React, Firebase Realtime Database, and the ImgBB API. It allows users to create posts with text and images, like posts, and add comments.
- Create posts with text and images.
- Upload images using ImgBB API.
- Like posts.
- Comment on posts.
- Store posts, likes, and comments in Firebase Realtime Database.
- Persist username across sessions using localStorage.
- React
- Firebase Realtime Database
- React Router
- Axios
- ImgBB API
- Node.js installed
- Firebase project setup with Realtime Database enabled
- ImgBB API key
-
Clone the repository:
git clone https://github.com/your-username/PostApp.git cd PostApp -
Install dependencies:
npm install
-
Create a
.envfile in the root directory and add the following:REACT_APP_FIREBASE_DATABASE_URL=your_firebase_database_url REACT_APP_IMGBB_API_KEY=your_imgbb_api_key
-
Start the development server:
npm start
PostApp/
│── src/
│ ├── components/
│ ├── App.js
│ ├── PostApp.js
│ ├── index.js
│ ├── App.css
│── public/
│── package.json
│── README.md
- Update
API_URLinPostApp.jswith your Firebase Realtime Database URL.
- The application uses ImgBB API to upload images.
- Set your API key in
.env.
- Users can create posts by entering text and optionally uploading an image.
- Clicking the "Post" button adds the post to Firebase.
- Users can like a post, and the like count updates in real time.
- Users can comment on a post, and comments are stored in Firebase.