A Full-Stack blog Website built with React and Flask (For desktop and Mobile),
allowing users to create, edit, read, delete and also comment on blog posts.
CLICK HERE TO View DEMO VIDEO
Video Demo: https://www.youtube.com/watch?v=czHZuR-iutA
Table of Contents
is a full-stack blog post application that allows users to share content and interact with posts created by others in a simple and intuitive way.
Users can register and log in, create new blog posts, view all posts shared across the platform, comments on them, and fully manage their own content by editing or deleting their posts.
Each post supports comments, enabling discussion and interaction between users.
The main posts feed provides multiple sorting options, allowing users to browse posts by most commented, newest, or random, making content discovery more engaging and dynamic.
The application includes proper authentication and authorization to ensure users can only modify their own posts, while still being able to read and comment on any post available on the site.
is a fully responsive website that is compatible with both mobile and desktop devices,
ensuring a smooth user experience across different screen sizes.
π General :
- Fully responsive design for both desktop and mobile devices.
- Redirect-based error handling with graceful fallbacks for invalid routes, parameters, and resources.
- Global handling of unknown routes with automatic redirection to the homepage.
- Efficient http-requests caching & recaching mechanism to minimize unnecessary network calls and improve performance.
π Authentication & Authorization :
- Secure JWT-based authentication using HTTP-only cookies.
- Authentication-aware routing with automatic redirection based on user state (Logged in Or not).
- Backend authorization middleware that validates JWT cookies on every request.
- Automatic logout when authentication tokens are missing, invalid, or expired.
- Sliding-session JWT handling with:
- Automatic renewal when tokens are within 1 hour of expiration.
- Token expiration set to 7 days.
π§ Navigation & Layout :
- Responsive navigation system with a sticky desktop navbar.
- Mobile-friendly hamburger menu for authenticated users.
- Reusable modal system with intuitive dismissal behavior.
π Authentication UX :
- Strong password validation enforcing length and complexity requirements.
- Password visibility toggle (show/hide) on login and registration forms.
π Homepage (Posts Feed) :
- Dynamic and responsive grid layout for displaying the posts feed.
- Single-column layout optimized for mobile devices.
- Post creation via modal-based interface.
- Dropdown & Route-based posts feed sorting using URL search parameters:
- Newest (default)
- Most commented
- Random
- Validation and automatic fallback to default sorting for invalid query values.
- Post navigation via clickable post cards with shareable, ID-based URLs.
π Post Page :
- Direct access to post pages via URL using post IDs.
- Automatic redirection to the posts feed for invalid or non-existent post IDs.
- Comment creation via modal-based interface.
- View post's comments.
π€ User Posts :
- Desktop table view for managing user posts.
- Mobile-optimized single-column card layout.
- Post navigation via clickable entries.
- Modal-based post editing and deletion.
- React β UI library for building component-based user interfaces
- Vite β Fast development build tool and bundler
- Styled Components β Component-level styling with scoped CSS
- React Router β Client-side routing and navigation
- Redux Toolkit β Predictable state management
- RTK Query β Data fetching and caching for HTTP requests
- Python β Backend programming language
- Flask β Lightweight web framework for RESTful APIs
- JWT (JSON Web Tokens) β Authentication and session handling
- HTTP-only Cookies β Secure client-side token storage
- Flask-CORS β Cross-Origin Resource Sharing configuration
- SQLite β Lightweight relational database
project/
ββ README.md # Project overview, setup & usage
ββ client/ # Frontend (React + Vite)
β ββ .gitignore # Files ignored by git
β ββ index.html # HTML entry
β ββ package.json # NPM scripts & dependencies
β ββ vite.config.js # Vite config
β ββ jsconfig.json # JS/TS path config
β ββ public/ # Static public assets
β ββ src/ # Application source
β ββ App.jsx # Root app component
β ββ main.jsx # App bootstrap (ReactDOM)
β ββ appProviders/ # App-level providers (redux, styles)
β β ββ AppProviders.component.jsx
β β ββ Redux.provider.jsx
β β ββ Styles.provider.jsx
β ββ assets/ # Asset exports (icons, images)
β β ββ index.js
β ββ customHooks/ # Reusable hooks
β β ββ index.js
β β ββ useCheckDeviceType.js
β β ββ useIsUserLoggedIn.js
β β ββ useModal.js
β ββ globalStyles/ # Theme & global styles
β β ββ GlobalStyles.jsx
β β ββ heartBeatAnimation.js
β β ββ index.js
β β ββ theme.js
β β ββ underline.js
β ββ pages/ # Page-level components
β β ββ index.js
β β ββ authPages/ # Auth screens (login/register)
β β β ββ index.js
β β β ββ authPages.styles.jsx
β β β ββ components/
β β β ββ AuthDesktopImg.component.jsx
β β β ββ ...
β β β ββ login/
β β β β ββ Login.page.jsx
β β β ββ register/
β β β ββ Register.page.jsx
β β β ββ register.styles.jsx
β β ββ homePage/
β β β ββ Home.page.jsx
β β β ββ home.styles.jsx
β β β ββ components/...
β β ββ postPage/
β β β ββ Post.page.jsx
β β β ββ post.styles.jsx
β β β ββ components/...
β β ββ userPosts/
β β ββ UserPosts.page.jsx
β β ββ userPosts.styles.jsx
β β ββ components/
β β ββ deletePostModal/
β ββ redux/ # Redux setup & services
β β ββ index.js
β β ββ store.js
β β ββ apiServices/
β β β ββ apiServices.js
β β β ββ postApiServices.js
β β ββ stateManager/
β β ββ interface.slice.js
β ββ sharedComponents/ # Reusable UI components
β β ββ index.js
β β ββ common/
β β β ββ RedirectUndefinedRoute.component.jsx
β β ββ ui/
β β ββ index.js
β β ββ authInput/
β β ββ btnLoader/
β β ββ button/
β β ββ modal/
β β ββ post/
β β ββ postModal/
β ββ sharedLayouts/ # App layouts & navbar
β β ββ SharedLayouts.component.jsx
β β ββ sharedLayouts.styles.jsx
β β ββ hamburgerMenu/
β β β ββ HamburgerMenu.component.jsx
β β β ββ hamburgermenu.styles.jsx
β β β ββ menuItem/
β β ββ navbar/
β β ββ Navbar.component.jsx
β β ββ navbar.styles.jsx
β β ββ components/
β ββ utils/ # Utility functions & constants
β ββ constants.js
β ββ handleInputChange.js
β ββ index.js
ββ server/ # Backend (Flask)
ββ .env # Environment variables (β οΈ sensitive)
ββ .gitignore
ββ app.py # Flask application entry
ββ requirements.txt # Python dependencies
ββ server_architecture.txt # Architecture notes / diagrams
ββ src/
ββ config/
β ββ __init__.py
β ββ connect_db.py # DB connection helper
β ββ generate_tables.py # Schema generation / migrations
β ββ jwt_config.py # JWT keys/config
ββ posts/
β ββ __init__.py
β ββ controller.py # Posts endpoints / handlers
β ββ helpers.py # Posts business logic helpers
β ββ tables.py # SQL table definitions
β ββ triggers.py # DB triggers related to posts
ββ users/
β ββ __init__.py
β ββ controller.py # User endpoints / handlers
β ββ helpers.py # User helpers (auth, hashing)
β ββ table.py # Users table schema
ββ utils/
ββ __init__.py
ββ constants.py
ββ request_helpers.py # Request validation, parsing helpers
cd client && npm install && npm run dev
cd server && pip install -r requirements.txt && flask run