A modern blog frontend built with React, Vite, Redux Toolkit, and Tailwind CSS.
This app supports user authentication, post creation/editing, profile management, and post search. It integrates with a backend API and uses cookie-based auth with automatic token refresh.
- User authentication (signup, login, logout)
- Protected routes for authenticated pages
- Create, edit, delete, and view blog posts
- Like/unlike posts with authenticated sessions
- Rich text editor for post content (TinyMCE)
- User profile and avatar update flows
- Search posts from the header
- Responsive UI for desktop and mobile
- React 19
- Vite 7
- Redux Toolkit + React Redux
- React Router DOM 7
- Tailwind CSS 4
- Axios
- React Hook Form
- TinyMCE React
- Node.js 18+
- npm 9+
- Clone the repository
git clone https://github.com/deepaksingh2002/full-stack-bloging-web.git
cd BlogingFrontend- Install dependencies
npm install- Configure environment variables
Create a .env file in the project root:
VITE_API_URL=https://your-backend-url
VITE_TINYMCE_API_KEY=your_tinymce_api_key- Start the development server
npm run devThe app will run on the local Vite URL (typically http://localhost:5173).
npm run dev: Starts Vite in development modenpm run build: Creates a production build indist/npm run preview: Serves the production build locallynpm run lint: Runs ESLint checks
src/
app/ # Redux store setup
components/ # Reusable UI and feature components
features/
auth/ # Auth API, thunks, and slice
post/ # Post API, thunks, and slice
pages/ # Route-level pages
main.jsx # Router + app bootstrap
- Requests use
withCredentials: truefor cookie-based sessions. - On
401, auth and post APIs attempt token refresh and retry automatically. - If refresh fails, protected routes redirect users to
/loginvia route guards.
Build for production:
npm run buildThis project includes vercel.json rewrite rules for SPA routing, so direct route access works when deployed on Vercel.
The frontend expects backend endpoints under:
${VITE_API_URL}/api/v1/users${VITE_API_URL}/api/v1/post${VITE_API_URL}/api/v1/like
Profile routes used by frontend:
GET /api/v1/users/profilePATCH /api/v1/users/update-profilePATCH /api/v1/users/update-avatar(multipart form-data, field:avatar)PATCH /api/v1/users/change-password
Like routes used by frontend:
POST /api/v1/like/toggle/post/:postIdPOST /api/v1/like/toggle/comment/:commentIdGET /api/v1/like/liked/posts
Make sure your backend CORS and cookie settings allow frontend origin + credentials.
This project is licensed under the MIT License. See LICENSE.