Skip to content

T1To48/Bloggy_CS50

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation


Logo

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


JavaScript

Frontend

React Vite Styled Components React Router Redux

Backend

Python Flask SQLite JWT Cookies ENV

Table of Contents
  1. About The Project
  2. Features
  3. TECH STACK
  4. Folders & Files Structure
  5. Installation & Setup

About The Project

Logo

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.

Logo is a fully responsive website that is compatible with both mobile and desktop devices,
ensuring a smooth user experience across different screen sizes.

(back to top)

Features

Logo

offers a set of core features designed to deliver a complete blogging experience:

🌐 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:
    1. Automatic renewal when tokens are within 1 hour of expiration.
    2. 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:
    1. Newest (default)
    2. Most commented
    3. 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.

Tech Stack

Frontend

  • 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

Backend

  • 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

Folders & Files Structure

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

Installation & Setup

cd client && npm install && npm run dev

cd server && pip install -r requirements.txt && flask run

About

Bloggy - FullStack Blog Post App

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors