Index: ChapterX.API/Controllers/ChaptersController.cs
===================================================================
--- ChapterX.API/Controllers/ChaptersController.cs	(revision 0b502c2664f4d6c64626f3394b4f1dc540e0aa9b)
+++ ChapterX.API/Controllers/ChaptersController.cs	(revision 99c1e45f4ac45a164229bc6f60f3b05bc26df047)
@@ -1,4 +1,5 @@
 using ChapterX.Application.Chapter.Commands;
 using ChapterX.Application.Chapter.Queries;
+using ChapterX.Domain.Repositories;
 using MediatR;
 using Microsoft.AspNetCore.Authorization;
@@ -14,9 +15,11 @@
     {
         private readonly IMediator _mediator;
+        private readonly IChapterRepository _chapterRepository;
         private readonly ILogger<ChaptersController> _logger;
 
-        public ChaptersController(IMediator mediator, ILogger<ChaptersController> logger)
+        public ChaptersController(IMediator mediator, IChapterRepository chapterRepository, ILogger<ChaptersController> logger)
         {
             _mediator = mediator;
+            _chapterRepository = chapterRepository;
             _logger = logger;
         }
@@ -38,4 +41,12 @@
             var response = await _mediator.Send(new GetRequest(id));
             return Ok(response);
+        }
+
+        [HttpPatch("{id:int}/view")]
+        [AllowAnonymous]
+        public async Task<ActionResult> IncrementView(int id)
+        {
+            await _chapterRepository.IncrementViewCountAsync(id);
+            return NoContent();
         }
 
Index: ChapterX.API/Controllers/StoriesController.cs
===================================================================
--- ChapterX.API/Controllers/StoriesController.cs	(revision 0b502c2664f4d6c64626f3394b4f1dc540e0aa9b)
+++ ChapterX.API/Controllers/StoriesController.cs	(revision 99c1e45f4ac45a164229bc6f60f3b05bc26df047)
@@ -29,5 +29,22 @@
             _logger.LogInformation("Fetching all stories");
             var response = await _mediator.Send(request);
-            return Ok(response);
+            var stories = response.Stories.Select(s => new
+            {
+                id = s.Id,
+                userId = s.UserId,
+                title = s.Title,
+                shortDescription = s.ShortDescription,
+                image = s.Image,
+                content = s.Content,
+                matureContent = s.MatureContent,
+                createdAt = s.CreatedAt,
+                updatedAt = s.UpdatedAt,
+                writer = s.Writer == null ? null : new { user = s.Writer.User == null ? null : new { username = s.Writer.User.Username } },
+                hasGenres = s.HasGenres.Select(hg => new { genre = new { name = hg.Genre?.Name ?? "" } }),
+                likes = s.Likes.Select(l => new { userId = l.UserId }),
+                comments = s.Comments.Select(c => new { id = c.Id }),
+                chapters = s.Chapters.Select(c => new { id = c.Id, viewCount = c.ViewCount }),
+            });
+            return Ok(new { stories });
         }
 
@@ -39,5 +56,23 @@
             _logger.LogInformation("Fetching story with ID: {StoryId}", id);
             var response = await _mediator.Send(new GetRequest(id));
-            return Ok(response);
+            if (response.Story == null) return NotFound();
+            var s = response.Story;
+            return Ok(new
+            {
+                id = s.Id,
+                userId = s.UserId,
+                title = s.Title,
+                shortDescription = s.ShortDescription,
+                image = s.Image,
+                content = s.Content,
+                matureContent = s.MatureContent,
+                createdAt = s.CreatedAt,
+                updatedAt = s.UpdatedAt,
+                writer = s.Writer == null ? null : new { user = s.Writer.User == null ? null : new { username = s.Writer.User.Username } },
+                hasGenres = s.HasGenres.Select(hg => new { genre = new { name = hg.Genre?.Name ?? "" } }),
+                likes = s.Likes.Select(l => new { userId = l.UserId }),
+                comments = s.Comments.Select(c => new { id = c.Id }),
+                chapters = s.Chapters.Select(c => new { id = c.Id, viewCount = c.ViewCount }),
+            });
         }
 
@@ -76,5 +111,6 @@
             _logger.LogInformation("Deleting story with ID: {StoryId}", id);
             var callerId = int.Parse(User.FindFirstValue(ClaimTypes.NameIdentifier)!);
-            var response = await _mediator.Send(new DeleteRequest(id, callerId));
+            var isAdmin = User.IsInRole("Admin");
+            var response = await _mediator.Send(new DeleteRequest(id, callerId, isAdmin));
             return Ok(response);
         }
Index: ChapterX.API/Program.cs
===================================================================
--- ChapterX.API/Program.cs	(revision 0b502c2664f4d6c64626f3394b4f1dc540e0aa9b)
+++ ChapterX.API/Program.cs	(revision 99c1e45f4ac45a164229bc6f60f3b05bc26df047)
@@ -77,12 +77,4 @@
 var app = builder.Build();
 
-app.UseCors("Frontend");
-
-if (app.Environment.IsDevelopment())
-{
-    app.UseSwagger();
-    app.UseSwaggerUI();
-}
-
 app.UseExceptionHandler(err => err.Run(async ctx =>
 {
@@ -130,4 +122,12 @@
 }));
 
+app.UseCors("Frontend");
+
+if (app.Environment.IsDevelopment())
+{
+    app.UseSwagger();
+    app.UseSwaggerUI();
+}
+
 app.UseAuthentication();
 app.UseAuthorization();
Index: ChapterX.Application/Story/Commands/AddHandler.cs
===================================================================
--- ChapterX.Application/Story/Commands/AddHandler.cs	(revision 0b502c2664f4d6c64626f3394b4f1dc540e0aa9b)
+++ ChapterX.Application/Story/Commands/AddHandler.cs	(revision 99c1e45f4ac45a164229bc6f60f3b05bc26df047)
@@ -31,4 +31,5 @@
                 {
                     MatureContent = request.MatureContent,
+                    Title = request.Title,
                     ShortDescription = request.ShortDescription,
                     Image = request.Image,
Index: ChapterX.Application/Story/Commands/AddRequest.cs
===================================================================
--- ChapterX.Application/Story/Commands/AddRequest.cs	(revision 0b502c2664f4d6c64626f3394b4f1dc540e0aa9b)
+++ ChapterX.Application/Story/Commands/AddRequest.cs	(revision 99c1e45f4ac45a164229bc6f60f3b05bc26df047)
@@ -6,4 +6,5 @@
     public record AddRequest(
         bool MatureContent,
+        [Required][MaxLength(200)] string Title,
         [Required][MaxLength(500)] string ShortDescription,
         [MaxLength(2048)] string? Image,
Index: ChapterX.Application/Story/Commands/DeleteHandler.cs
===================================================================
--- ChapterX.Application/Story/Commands/DeleteHandler.cs	(revision 0b502c2664f4d6c64626f3394b4f1dc540e0aa9b)
+++ ChapterX.Application/Story/Commands/DeleteHandler.cs	(revision 99c1e45f4ac45a164229bc6f60f3b05bc26df047)
@@ -22,5 +22,5 @@
                 return new DeleteResponse(false);
 
-            if (story.UserId != request.CallerId)
+            if (!request.IsAdmin && story.UserId != request.CallerId)
                 throw new UnauthorizedAccessException("You do not own this story.");
 
Index: ChapterX.Application/Story/Commands/DeleteRequest.cs
===================================================================
--- ChapterX.Application/Story/Commands/DeleteRequest.cs	(revision 0b502c2664f4d6c64626f3394b4f1dc540e0aa9b)
+++ ChapterX.Application/Story/Commands/DeleteRequest.cs	(revision 99c1e45f4ac45a164229bc6f60f3b05bc26df047)
@@ -3,4 +3,4 @@
 namespace ChapterX.Application.Story.Commands
 {
-    public record DeleteRequest(int Id, int CallerId) : IRequest<DeleteResponse>;
+    public record DeleteRequest(int Id, int CallerId, bool IsAdmin = false) : IRequest<DeleteResponse>;
 }
Index: ChapterX.Application/Story/Commands/UpdateHandler.cs
===================================================================
--- ChapterX.Application/Story/Commands/UpdateHandler.cs	(revision 0b502c2664f4d6c64626f3394b4f1dc540e0aa9b)
+++ ChapterX.Application/Story/Commands/UpdateHandler.cs	(revision 99c1e45f4ac45a164229bc6f60f3b05bc26df047)
@@ -26,4 +26,5 @@
 
             story.MatureContent = request.MatureContent;
+            story.Title = request.Title;
             story.ShortDescription = request.ShortDescription;
             story.Image = request.Image;
Index: ChapterX.Application/Story/Commands/UpdateRequest.cs
===================================================================
--- ChapterX.Application/Story/Commands/UpdateRequest.cs	(revision 0b502c2664f4d6c64626f3394b4f1dc540e0aa9b)
+++ ChapterX.Application/Story/Commands/UpdateRequest.cs	(revision 99c1e45f4ac45a164229bc6f60f3b05bc26df047)
@@ -3,4 +3,4 @@
 namespace ChapterX.Application.Story.Commands
 {
-    public record UpdateRequest(int Id, bool MatureContent, string ShortDescription, string? Image, string Content, int CallerId = 0) : IRequest<UpdateResponse>;
+    public record UpdateRequest(int Id, bool MatureContent, string Title, string ShortDescription, string? Image, string Content, int CallerId = 0) : IRequest<UpdateResponse>;
 }
Index: ChapterX.Domain/Entities/Story.cs
===================================================================
--- ChapterX.Domain/Entities/Story.cs	(revision 0b502c2664f4d6c64626f3394b4f1dc540e0aa9b)
+++ ChapterX.Domain/Entities/Story.cs	(revision 99c1e45f4ac45a164229bc6f60f3b05bc26df047)
@@ -12,4 +12,5 @@
         public int Id { get; set; }
         public bool MatureContent { get; set; }
+        public string Title { get; set; } = string.Empty;
         public string ShortDescription { get; set; } = string.Empty;
         public string? Image { get; set; }
Index: ChapterX.Domain/Repositories/IChapterRepository.cs
===================================================================
--- ChapterX.Domain/Repositories/IChapterRepository.cs	(revision 0b502c2664f4d6c64626f3394b4f1dc540e0aa9b)
+++ ChapterX.Domain/Repositories/IChapterRepository.cs	(revision 99c1e45f4ac45a164229bc6f60f3b05bc26df047)
@@ -7,4 +7,5 @@
         Task<IEnumerable<Chapter>> GetByStoryIdAsync(int storyId, CancellationToken cancellationToken = default);
         Task<Chapter?> GetByIdWithStoryAsync(int id, CancellationToken cancellationToken = default);
+        Task IncrementViewCountAsync(int id, CancellationToken cancellationToken = default);
     }
 }
Index: ChapterX.Infrastructure/Data/DataContext/ApplicationDbContext.cs
===================================================================
--- ChapterX.Infrastructure/Data/DataContext/ApplicationDbContext.cs	(revision 0b502c2664f4d6c64626f3394b4f1dc540e0aa9b)
+++ ChapterX.Infrastructure/Data/DataContext/ApplicationDbContext.cs	(revision 99c1e45f4ac45a164229bc6f60f3b05bc26df047)
@@ -88,4 +88,5 @@
                 e.Property(x => x.Id).HasColumnName("story_id");
                 e.Property(x => x.MatureContent).HasColumnName("mature_content");
+                e.Property(x => x.Title).HasColumnName("title");
                 e.Property(x => x.ShortDescription).HasColumnName("short_description");
                 e.Property(x => x.Image).HasColumnName("image");
Index: ChapterX.Infrastructure/Repositories/ChapterRepository.cs
===================================================================
--- ChapterX.Infrastructure/Repositories/ChapterRepository.cs	(revision 0b502c2664f4d6c64626f3394b4f1dc540e0aa9b)
+++ ChapterX.Infrastructure/Repositories/ChapterRepository.cs	(revision 99c1e45f4ac45a164229bc6f60f3b05bc26df047)
@@ -31,4 +31,11 @@
                 .FirstOrDefaultAsync(c => c.Id == id, cancellationToken);
         }
+
+        public async Task IncrementViewCountAsync(int id, CancellationToken cancellationToken = default)
+        {
+            await _dbSet
+                .Where(c => c.Id == id)
+                .ExecuteUpdateAsync(s => s.SetProperty(c => c.ViewCount, c => c.ViewCount + 1), cancellationToken);
+        }
     }
 }
Index: ChapterX.Infrastructure/Repositories/GenericRepository.cs
===================================================================
--- ChapterX.Infrastructure/Repositories/GenericRepository.cs	(revision 0b502c2664f4d6c64626f3394b4f1dc540e0aa9b)
+++ ChapterX.Infrastructure/Repositories/GenericRepository.cs	(revision 99c1e45f4ac45a164229bc6f60f3b05bc26df047)
@@ -18,5 +18,5 @@
         }
 
-        public async Task<T?> GetByIdAsync(int id, CancellationToken cancellationToken = default)
+        public virtual async Task<T?> GetByIdAsync(int id, CancellationToken cancellationToken = default)
             => await _dbSet.FindAsync([id], cancellationToken);
 
Index: ChapterX.Infrastructure/Repositories/StoryRepository.cs
===================================================================
--- ChapterX.Infrastructure/Repositories/StoryRepository.cs	(revision 0b502c2664f4d6c64626f3394b4f1dc540e0aa9b)
+++ ChapterX.Infrastructure/Repositories/StoryRepository.cs	(revision 99c1e45f4ac45a164229bc6f60f3b05bc26df047)
@@ -25,4 +25,17 @@
         }
 
+        public override async Task<Story?> GetByIdAsync(int id, CancellationToken cancellationToken = default)
+        {
+            return await _dbSet
+                .Include(s => s.HasGenres)
+                    .ThenInclude(hg => hg.Genre)
+                .Include(s => s.Writer)
+                    .ThenInclude(w => w!.User)
+                .Include(s => s.Likes)
+                .Include(s => s.Comments)
+                .Include(s => s.Chapters)
+                .FirstOrDefaultAsync(s => s.Id == id, cancellationToken);
+        }
+
         public async Task<IEnumerable<Story>> GetByWriterIdAsync(int writerId, CancellationToken cancellationToken = default)
         {
Index: chapterx-frontend/src/components/admin/PlatformStats.tsx
===================================================================
--- chapterx-frontend/src/components/admin/PlatformStats.tsx	(revision 0b502c2664f4d6c64626f3394b4f1dc540e0aa9b)
+++ chapterx-frontend/src/components/admin/PlatformStats.tsx	(revision 99c1e45f4ac45a164229bc6f60f3b05bc26df047)
@@ -1,26 +1,26 @@
-import React from 'react'
-import { Users, BookOpen, FileText, Heart, Eye, MessageCircle } from 'lucide-react'
+import React, { useEffect } from 'react'
+import { Users, BookOpen, Heart, MessageCircle } from 'lucide-react'
 import { useAuthStore } from '../../store/authStore'
 import { useStoryStore } from '../../store/storyStore'
 
 export const PlatformStats: React.FC = () => {
-  const { allUsers } = useAuthStore()
-  const { stories, comments } = useStoryStore()
+  const { allUsers, fetchAllUsers } = useAuthStore()
+  const { stories, fetchStories } = useStoryStore()
 
-  const totalViews = stories.reduce((acc, s) => acc + s.total_views, 0)
+  useEffect(() => { fetchStories(); fetchAllUsers() }, [])
+
   const totalLikes = stories.reduce((acc, s) => acc + s.total_likes, 0)
+  const totalComments = stories.reduce((acc, s) => acc + s.total_comments, 0)
   const published = stories.filter(s => s.status === 'published').length
 
   const stats = [
-    { icon: <Users size={24} className="text-blue-300" />, label: 'Total Users', value: allUsers.length, color: 'bg-blue-500/20', change: '+12 this month' },
+    { icon: <Users size={24} className="text-blue-300" />, label: 'Total Users', value: allUsers.length, color: 'bg-blue-500/20', change: `${allUsers.filter(u => u.role === 'writer').length} writers` },
     { icon: <BookOpen size={24} className="text-violet-300" />, label: 'Total Stories', value: stories.length, color: 'bg-violet-500/20', change: `${published} published` },
-    { icon: <FileText size={24} className="text-emerald-300" />, label: 'Comments', value: comments.length, color: 'bg-emerald-500/20', change: 'Platform-wide' },
     { icon: <Heart size={24} className="text-rose-300" />, label: 'Total Likes', value: totalLikes.toLocaleString(), color: 'bg-rose-500/20', change: 'Across all stories' },
-    { icon: <Eye size={24} className="text-amber-300" />, label: 'Total Views', value: totalViews.toLocaleString(), color: 'bg-amber-500/20', change: 'All time' },
-    { icon: <MessageCircle size={24} className="text-cyan-300" />, label: 'Writers', value: allUsers.filter(u => u.role === 'writer').length, color: 'bg-cyan-500/20', change: 'Active creators' },
+    { icon: <MessageCircle size={24} className="text-emerald-300" />, label: 'Total Comments', value: totalComments.toLocaleString(), color: 'bg-emerald-500/20', change: 'Platform-wide' },
   ]
 
   return (
-    <div className="grid grid-cols-2 md:grid-cols-3 gap-4">
+    <div className="grid grid-cols-2 md:grid-cols-4 gap-4">
       {stats.map(stat => (
         <div key={stat.label} className="bg-slate-800 border border-slate-700 rounded-2xl p-6">
Index: chapterx-frontend/src/components/admin/UserTable.tsx
===================================================================
--- chapterx-frontend/src/components/admin/UserTable.tsx	(revision 0b502c2664f4d6c64626f3394b4f1dc540e0aa9b)
+++ chapterx-frontend/src/components/admin/UserTable.tsx	(revision 99c1e45f4ac45a164229bc6f60f3b05bc26df047)
@@ -1,6 +1,6 @@
 import React, { useState } from 'react'
 import { Search, Shield, UserX, UserCheck } from 'lucide-react'
+import axios from 'axios'
 import { useAuthStore } from '../../store/authStore'
-import { useNotificationStore } from '../../store/notificationStore'
 import { useUIStore } from '../../store/uiStore'
 import { User, UserRole } from '../../types'
@@ -10,11 +10,15 @@
 import { Modal } from '../ui/Modal'
 
+const API = 'https://localhost:7125/api'
+
 export const UserTable: React.FC = () => {
-  const { allUsers, updateUserRole, currentUser } = useAuthStore()
-  const { addNotification } = useNotificationStore()
+  const { allUsers, updateUserRole, currentUser, token } = useAuthStore()
   const { addToast } = useUIStore()
   const [search, setSearch] = useState('')
   const [confirmUser, setConfirmUser] = useState<User | null>(null)
   const [confirmAction, setConfirmAction] = useState<'promote' | 'demote' | null>(null)
+  const [loading, setLoading] = useState(false)
+
+  const authHeaders = token ? { Authorization: `Bearer ${token}` } : {}
 
   const filtered = allUsers.filter(
@@ -25,22 +29,30 @@
   )
 
-  const handlePromote = (user: User) => {
-    const newRole: UserRole = user.role === 'regular' ? 'writer' : user.role === 'writer' ? 'admin' : 'admin'
-    updateUserRole(user.user_id, newRole)
-    addNotification({
-      user_id: user.user_id,
-      type: 'system',
-      title: 'Role Updated',
-      message: `Your account has been promoted to ${newRole}.`,
-    })
-    addToast(`${user.username} promoted to ${newRole}`)
-    setConfirmUser(null)
+  const handlePromote = async (user: User) => {
+    setLoading(true)
+    try {
+      await axios.post(`${API}/admins`, { userId: user.user_id }, { headers: authHeaders })
+      updateUserRole(user.user_id, 'admin')
+      addToast(`${user.username} promoted to admin`)
+    } catch (err: any) {
+      addToast(err?.response?.data?.message || 'Failed to promote user.', 'error')
+    } finally {
+      setLoading(false)
+      setConfirmUser(null)
+    }
   }
 
-  const handleDemote = (user: User) => {
-    const newRole: UserRole = user.role === 'admin' ? 'writer' : 'regular'
-    updateUserRole(user.user_id, newRole)
-    addToast(`${user.username} role changed to ${newRole}`, 'info')
-    setConfirmUser(null)
+  const handleDemote = async (user: User) => {
+    setLoading(true)
+    try {
+      await axios.delete(`${API}/admins/${user.user_id}`, { headers: authHeaders })
+      updateUserRole(user.user_id, 'writer')
+      addToast(`${user.username} removed from admin`, 'info')
+    } catch (err: any) {
+      addToast(err?.response?.data?.message || 'Failed to demote user.', 'error')
+    } finally {
+      setLoading(false)
+      setConfirmUser(null)
+    }
   }
 
@@ -140,4 +152,5 @@
                 variant={confirmAction === 'promote' ? 'primary' : 'danger'}
                 className="flex-1"
+                loading={loading}
                 onClick={() => confirmAction === 'promote' ? handlePromote(confirmUser) : handleDemote(confirmUser)}
               >
Index: chapterx-frontend/src/components/story/LikeButton.tsx
===================================================================
--- chapterx-frontend/src/components/story/LikeButton.tsx	(revision 0b502c2664f4d6c64626f3394b4f1dc540e0aa9b)
+++ chapterx-frontend/src/components/story/LikeButton.tsx	(revision 99c1e45f4ac45a164229bc6f60f3b05bc26df047)
@@ -9,11 +9,4 @@
 const API = 'https://localhost:7125/api'
 
-function getAuthHeaders() {
-  try {
-    const token = JSON.parse(localStorage.getItem('chapterx-auth') || '{}')?.state?.token
-    return token ? { Authorization: `Bearer ${token}` } : {}
-  } catch { return {} }
-}
-
 interface LikeButtonProps {
   storyId: number
@@ -25,6 +18,7 @@
 export const LikeButton: React.FC<LikeButtonProps> = ({ storyId, authorUserId, totalLikes, onCountChange }) => {
   const navigate = useNavigate()
-  const { currentUser } = useAuthStore()
+  const { currentUser, token } = useAuthStore()
   const { addNotification } = useNotificationStore()
+  const authHeaders = token ? { Authorization: `Bearer ${token}` } : {}
   const { addToast } = useUIStore()
   const [liked, setLiked] = useState(false)
@@ -55,10 +49,10 @@
     try {
       if (liked) {
-        await axios.delete(`${API}/likes/user/${currentUser.user_id}/story/${storyId}`, { headers: getAuthHeaders() })
+        await axios.delete(`${API}/likes/user/${currentUser.user_id}/story/${storyId}`, { headers: authHeaders })
         setLiked(false)
         setCount(c => { const n = c - 1; onCountChange?.(n); return n })
         addToast('Removed from likes', 'info')
       } else {
-        await axios.post(`${API}/likes`, { userId: currentUser.user_id, storyId }, { headers: getAuthHeaders() })
+        await axios.post(`${API}/likes`, { userId: currentUser.user_id, storyId }, { headers: authHeaders })
         setLiked(true)
         setCount(c => { const n = c + 1; onCountChange?.(n); return n })
Index: chapterx-frontend/src/components/ui/StoryCard.tsx
===================================================================
--- chapterx-frontend/src/components/ui/StoryCard.tsx	(revision 0b502c2664f4d6c64626f3394b4f1dc540e0aa9b)
+++ chapterx-frontend/src/components/ui/StoryCard.tsx	(revision 99c1e45f4ac45a164229bc6f60f3b05bc26df047)
@@ -1,5 +1,5 @@
 import React from 'react'
 import { useNavigate } from 'react-router-dom'
-import { Heart, MessageCircle, Eye, Lock } from 'lucide-react'
+import { Heart, MessageCircle, Lock } from 'lucide-react'
 import { Story } from '../../types'
 import { useAuthStore } from '../../store/authStore'
@@ -86,8 +86,4 @@
             {story.total_comments}
           </span>
-          <span className="flex items-center gap-1 ml-auto">
-            <Eye size={12} />
-            {story.total_views.toLocaleString()}
-          </span>
         </div>
       </div>
Index: chapterx-frontend/src/components/writer/StoryAnalytics.tsx
===================================================================
--- chapterx-frontend/src/components/writer/StoryAnalytics.tsx	(revision 0b502c2664f4d6c64626f3394b4f1dc540e0aa9b)
+++ chapterx-frontend/src/components/writer/StoryAnalytics.tsx	(revision 99c1e45f4ac45a164229bc6f60f3b05bc26df047)
@@ -1,6 +1,4 @@
 import React from 'react'
 import {
-  LineChart,
-  Line,
   BarChart,
   Bar,
@@ -11,15 +9,19 @@
   ResponsiveContainer,
 } from 'recharts'
-import { Eye, Heart, MessageCircle, TrendingUp, Clock, BarChart2 } from 'lucide-react'
-import { mockAnalytics } from '../../data/mockData'
+import { Heart, MessageCircle, BookOpen } from 'lucide-react'
+import { Story } from '../../types'
+
+interface Props {
+  stories: Story[]
+}
 
 const StatCard: React.FC<{ icon: React.ReactNode; label: string; value: string | number; color: string }> = ({
   icon, label, value, color,
 }) => (
-  <div className={`p-4 bg-slate-800 rounded-xl border border-slate-700`}>
+  <div className="p-4 bg-slate-800 rounded-xl border border-slate-700">
     <div className={`w-10 h-10 rounded-xl ${color} flex items-center justify-center mb-3`}>
       {icon}
     </div>
-    <p className="text-2xl font-bold text-white">{value.toLocaleString()}</p>
+    <p className="text-2xl font-bold text-white">{typeof value === 'number' ? value.toLocaleString() : value}</p>
     <p className="text-slate-400 text-sm mt-0.5">{label}</p>
   </div>
@@ -42,35 +44,35 @@
 }
 
-export const StoryAnalytics: React.FC = () => {
-  const analytics = mockAnalytics
-  const viewsData = analytics.views_over_time.filter((_, i) => i % 5 === 0)
-  const likesData = analytics.likes_over_time.filter((_, i) => i % 5 === 0)
+export const StoryAnalytics: React.FC<Props> = ({ stories }) => {
+  const published = stories.filter(s => s.status === 'published')
+
+  const totalLikes = stories.reduce((a, s) => a + s.total_likes, 0)
+  const totalComments = stories.reduce((a, s) => a + s.total_comments, 0)
+  const totalChapters = stories.reduce((a, s) => a + s.total_chapters, 0)
+
+  // Likes per story (sorted by created_at)
+  const likesData = [...published]
+    .sort((a, b) => new Date(a.created_at).getTime() - new Date(b.created_at).getTime())
+    .map(s => ({
+      date: new Date(s.created_at).toLocaleDateString('en-US', { month: 'short', year: '2-digit' }),
+      likes: s.total_likes,
+      story: s.title,
+    }))
+
+  if (published.length === 0) {
+    return (
+      <div className="text-center py-12 text-slate-500">
+        <p>No published stories yet — analytics will appear here once you publish.</p>
+      </div>
+    )
+  }
 
   return (
     <div className="space-y-6">
       {/* Stat cards */}
-      <div className="grid grid-cols-2 lg:grid-cols-5 gap-4">
-        <StatCard icon={<Eye size={18} className="text-blue-300" />} label="Total Views" value={analytics.total_views} color="bg-blue-500/20" />
-        <StatCard icon={<Heart size={18} className="text-rose-300" />} label="Total Likes" value={analytics.total_likes} color="bg-rose-500/20" />
-        <StatCard icon={<MessageCircle size={18} className="text-violet-300" />} label="Comments" value={analytics.total_comments} color="bg-violet-500/20" />
-        <StatCard icon={<Clock size={18} className="text-amber-300" />} label="Avg Read (min)" value={analytics.avg_read_time} color="bg-amber-500/20" />
-        <StatCard icon={<BarChart2 size={18} className="text-emerald-300" />} label="Completion %" value={`${analytics.completion_rate}%`} color="bg-emerald-500/20" />
-      </div>
-
-      {/* Views chart */}
-      <div className="bg-slate-800 border border-slate-700 rounded-2xl p-6">
-        <div className="flex items-center gap-2 mb-4">
-          <TrendingUp size={16} className="text-blue-400" />
-          <h3 className="text-white font-semibold">Views Over Time</h3>
-        </div>
-        <ResponsiveContainer width="100%" height={200}>
-          <LineChart data={viewsData}>
-            <CartesianGrid strokeDasharray="3 3" stroke="#334155" />
-            <XAxis dataKey="date" tick={{ fill: '#64748b', fontSize: 11 }} tickLine={false} axisLine={false} />
-            <YAxis tick={{ fill: '#64748b', fontSize: 11 }} tickLine={false} axisLine={false} />
-            <Tooltip content={<CustomTooltip />} />
-            <Line type="monotone" dataKey="views" stroke="#6366f1" strokeWidth={2} dot={false} name="Views" />
-          </LineChart>
-        </ResponsiveContainer>
+      <div className="grid grid-cols-2 lg:grid-cols-3 gap-4">
+        <StatCard icon={<Heart size={18} className="text-rose-300" />} label="Total Likes" value={totalLikes} color="bg-rose-500/20" />
+        <StatCard icon={<MessageCircle size={18} className="text-violet-300" />} label="Total Comments" value={totalComments} color="bg-violet-500/20" />
+        <StatCard icon={<BookOpen size={18} className="text-emerald-300" />} label="Total Chapters" value={totalChapters} color="bg-emerald-500/20" />
       </div>
 
@@ -79,16 +81,40 @@
         <div className="flex items-center gap-2 mb-4">
           <Heart size={16} className="text-rose-400" />
-          <h3 className="text-white font-semibold">Likes Over Time</h3>
+          <h3 className="text-white font-semibold">Likes per Story</h3>
         </div>
-        <ResponsiveContainer width="100%" height={200}>
-          <BarChart data={likesData}>
-            <CartesianGrid strokeDasharray="3 3" stroke="#334155" />
-            <XAxis dataKey="date" tick={{ fill: '#64748b', fontSize: 11 }} tickLine={false} axisLine={false} />
-            <YAxis tick={{ fill: '#64748b', fontSize: 11 }} tickLine={false} axisLine={false} />
-            <Tooltip content={<CustomTooltip />} />
-            <Bar dataKey="likes" fill="#f43f5e" radius={[4, 4, 0, 0]} name="Likes" />
-          </BarChart>
-        </ResponsiveContainer>
+        {likesData.length > 0 ? (
+          <ResponsiveContainer width="100%" height={200}>
+            <BarChart data={likesData}>
+              <CartesianGrid strokeDasharray="3 3" stroke="#334155" />
+              <XAxis dataKey="date" tick={{ fill: '#64748b', fontSize: 11 }} tickLine={false} axisLine={false} />
+              <YAxis tick={{ fill: '#64748b', fontSize: 11 }} tickLine={false} axisLine={false} />
+              <Tooltip content={<CustomTooltip />} />
+              <Bar dataKey="likes" fill="#f43f5e" radius={[4, 4, 0, 0]} name="Likes" />
+            </BarChart>
+          </ResponsiveContainer>
+        ) : (
+          <p className="text-slate-500 text-sm text-center py-8">No likes data yet</p>
+        )}
       </div>
+
+      {/* Per-story breakdown */}
+      {published.length > 1 && (
+        <div className="bg-slate-800 border border-slate-700 rounded-2xl p-6">
+          <h3 className="text-white font-semibold mb-4">Story Breakdown</h3>
+          <div className="space-y-3">
+            {[...published]
+              .sort((a, b) => b.total_likes - a.total_likes)
+              .map(s => (
+                <div key={s.story_id} className="flex items-center justify-between text-sm">
+                  <span className="text-slate-300 truncate max-w-xs">{s.title}</span>
+                  <div className="flex items-center gap-4 text-slate-400 flex-shrink-0">
+                    <span className="flex items-center gap-1"><Heart size={12} /> {s.total_likes}</span>
+                    <span className="flex items-center gap-1"><MessageCircle size={12} /> {s.total_comments}</span>
+                  </div>
+                </div>
+              ))}
+          </div>
+        </div>
+      )}
     </div>
   )
Index: chapterx-frontend/src/pages/profile/ProfilePage.tsx
===================================================================
--- chapterx-frontend/src/pages/profile/ProfilePage.tsx	(revision 0b502c2664f4d6c64626f3394b4f1dc540e0aa9b)
+++ chapterx-frontend/src/pages/profile/ProfilePage.tsx	(revision 99c1e45f4ac45a164229bc6f60f3b05bc26df047)
@@ -1,5 +1,5 @@
 import React, { useState, useEffect } from 'react'
 import { useParams, useNavigate } from 'react-router-dom'
-import { BookOpen, Heart, Users, Calendar, MessageCircle, Eye } from 'lucide-react'
+import { BookOpen, Heart, Calendar, MessageCircle } from 'lucide-react'
 import { useAuthStore } from '../../store/authStore'
 import { useStoryStore } from '../../store/storyStore'
@@ -18,5 +18,5 @@
   const navigate = useNavigate()
   const { allUsers, currentUser, fetchAllUsers, updateUser } = useAuthStore()
-  const { stories, comments } = useStoryStore()
+  const { stories, fetchStories } = useStoryStore()
   const { addToast } = useUIStore()
   const [tab, setTab] = useState<Tab>('stories')
@@ -27,4 +27,5 @@
 
   useEffect(() => {
+    fetchStories()
     if (allUsers.length === 0) {
       setLoading(true)
@@ -74,6 +75,5 @@
   const userStories = stories.filter(s => s.user_id === user.user_id && s.status === 'published')
   const totalLikes = userStories.reduce((acc, s) => acc + s.total_likes, 0)
-  const totalViews = userStories.reduce((acc, s) => acc + s.total_views, 0)
-  const userComments = comments.filter(c => c.user_id === user.user_id)
+  const totalComments = userStories.reduce((acc, s) => acc + s.total_comments, 0)
   const allGenres = [...new Set(userStories.flatMap(s => s.genres))]
 
@@ -116,18 +116,13 @@
             Joined {new Date(user.created_at).toLocaleDateString('en-US', { month: 'long', year: 'numeric' })}
           </span>
-          <span className="flex items-center gap-1 text-slate-400 text-sm">
-            <Users size={14} />
-            {user.follower_count} followers · {user.following_count} following
-          </span>
         </div>
       </div>
 
       {/* Stats */}
-      <div className="grid grid-cols-2 sm:grid-cols-4 gap-4 mb-8">
+      <div className="grid grid-cols-3 gap-4 mb-8">
         {[
           { icon: <BookOpen size={16} className="text-indigo-400" />, value: userStories.length, label: 'Stories' },
           { icon: <Heart size={16} className="text-rose-400" />, value: totalLikes.toLocaleString(), label: 'Likes' },
-          { icon: <Eye size={16} className="text-blue-400" />, value: totalViews.toLocaleString(), label: 'Views' },
-          { icon: <MessageCircle size={16} className="text-amber-400" />, value: userComments.length, label: 'Comments' },
+          { icon: <MessageCircle size={16} className="text-amber-400" />, value: totalComments, label: 'Comments' },
         ].map(s => (
           <div key={s.label} className="bg-slate-800 border border-slate-700 rounded-xl p-4 text-center">
@@ -172,8 +167,4 @@
       ) : (
         <div className="space-y-6">
-          <div className="bg-slate-800 border border-slate-700 rounded-2xl p-6">
-            <h3 className="text-white font-semibold mb-3">About</h3>
-            <p className="text-slate-300">{user.bio || 'No bio provided.'}</p>
-          </div>
           {allGenres.length > 0 && (
             <div className="bg-slate-800 border border-slate-700 rounded-2xl p-6">
Index: chapterx-frontend/src/pages/story/StoryDetailPage.tsx
===================================================================
--- chapterx-frontend/src/pages/story/StoryDetailPage.tsx	(revision 0b502c2664f4d6c64626f3394b4f1dc540e0aa9b)
+++ chapterx-frontend/src/pages/story/StoryDetailPage.tsx	(revision 99c1e45f4ac45a164229bc6f60f3b05bc26df047)
@@ -1,5 +1,5 @@
 import React, { useState } from 'react'
 import { useParams, useNavigate } from 'react-router-dom'
-import { ArrowLeft, BookOpen, Eye, Users, Calendar, Plus, BookmarkPlus } from 'lucide-react'
+import { ArrowLeft, BookOpen, Users, Calendar, Plus, BookmarkPlus } from 'lucide-react'
 import { useStoryStore } from '../../store/storyStore'
 import { useAuthStore } from '../../store/authStore'
@@ -117,4 +117,7 @@
       {/* Hero */}
       <div className={`relative rounded-2xl overflow-hidden mb-8 bg-gradient-to-br ${gradient}`}>
+        {story.cover_image && (
+          <img src={story.cover_image} alt={story.title} className="absolute inset-0 w-full h-full object-cover opacity-30" />
+        )}
         <div className="absolute inset-0 bg-gradient-to-t from-slate-950/90 via-slate-950/30 to-transparent" />
         <div className="relative p-8 sm:p-12">
@@ -134,8 +137,4 @@
               <Avatar name={story.author_username} size="sm" />
               <span className="text-white text-sm font-medium">{story.author_username}</span>
-            </div>
-            <div className="flex items-center gap-1 text-slate-400 text-sm">
-              <Eye size={14} />
-              {story.total_views.toLocaleString()} views
             </div>
             <div className="flex items-center gap-1 text-slate-400 text-sm">
@@ -170,4 +169,11 @@
           </div>
 
+          {/* Story content */}
+          {story.content && (
+            <div className="bg-slate-800/50 border border-slate-700 rounded-2xl p-6">
+              <p className="text-slate-200 leading-relaxed font-serif whitespace-pre-wrap">{story.content}</p>
+            </div>
+          )}
+
           {/* Chapters */}
           <div>
@@ -207,8 +213,4 @@
                 <span className="text-slate-400">Likes</span>
                 <span className="text-white">{(liveLikes ?? story.total_likes).toLocaleString()}</span>
-              </div>
-              <div className="flex justify-between">
-                <span className="text-slate-400">Views</span>
-                <span className="text-white">{story.total_views.toLocaleString()}</span>
               </div>
               <div className="flex justify-between">
Index: chapterx-frontend/src/pages/writer/CreateStoryPage.tsx
===================================================================
--- chapterx-frontend/src/pages/writer/CreateStoryPage.tsx	(revision 0b502c2664f4d6c64626f3394b4f1dc540e0aa9b)
+++ chapterx-frontend/src/pages/writer/CreateStoryPage.tsx	(revision 99c1e45f4ac45a164229bc6f60f3b05bc26df047)
@@ -21,4 +21,5 @@
     short_description: '',
     content: '',
+    cover_image: '',
     genres: [] as string[],
     mature_content: false,
@@ -45,4 +46,5 @@
       story_id: Date.now(),
       ...form,
+      cover_image: form.cover_image || undefined,
       user_id: currentUser.user_id,
       author_username: currentUser.username,
@@ -124,4 +126,21 @@
               <span className="text-slate-600 text-xs">{form.short_description.length}/280</span>
             </div>
+          </div>
+
+          {/* Cover image */}
+          <div>
+            <label className="block text-sm font-medium text-slate-300 mb-1.5">Cover Image URL <span className="text-slate-500 font-normal">(optional)</span></label>
+            <input
+              value={form.cover_image}
+              onChange={e => {
+                const val = e.target.value
+                if (!val || val.startsWith('http')) setField('cover_image', val)
+              }}
+              placeholder="https://example.com/image.jpg"
+              className="w-full px-4 py-3 bg-slate-800 border border-slate-700 rounded-xl text-white placeholder-slate-500 focus:outline-none focus:border-indigo-500"
+            />
+            {form.cover_image?.startsWith('http') && (
+              <img src={form.cover_image} alt="Cover preview" className="mt-2 h-32 w-full object-cover rounded-xl opacity-80" onError={e => (e.currentTarget.style.display = 'none')} />
+            )}
           </div>
 
Index: chapterx-frontend/src/pages/writer/WriterDashboard.tsx
===================================================================
--- chapterx-frontend/src/pages/writer/WriterDashboard.tsx	(revision 0b502c2664f4d6c64626f3394b4f1dc540e0aa9b)
+++ chapterx-frontend/src/pages/writer/WriterDashboard.tsx	(revision 99c1e45f4ac45a164229bc6f60f3b05bc26df047)
@@ -1,5 +1,5 @@
-import React from 'react'
+import React, { useEffect } from 'react'
 import { useNavigate } from 'react-router-dom'
-import { Plus, BookOpen, Eye, Heart, MessageCircle, TrendingUp, Bell } from 'lucide-react'
+import { Plus, BookOpen, Heart, MessageCircle, TrendingUp, Bell } from 'lucide-react'
 import { useAuthStore } from '../../store/authStore'
 import { useStoryStore } from '../../store/storyStore'
@@ -22,6 +22,8 @@
   const navigate = useNavigate()
   const { currentUser } = useAuthStore()
-  const { stories, collaborations } = useStoryStore()
+  const { stories, collaborations, fetchStories } = useStoryStore()
   const { notifications } = useNotificationStore()
+
+  useEffect(() => { fetchStories() }, [])
 
   if (!currentUser) return null
@@ -34,5 +36,4 @@
   const published = myStories.filter(s => s.status === 'published')
   const drafts = myStories.filter(s => s.status === 'draft')
-  const totalViews = myStories.reduce((acc, s) => acc + s.total_views, 0)
   const totalLikes = myStories.reduce((acc, s) => acc + s.total_likes, 0)
 
@@ -56,8 +57,7 @@
 
       {/* Stats */}
-      <div className="grid grid-cols-2 lg:grid-cols-4 gap-4 mb-8">
+      <div className="grid grid-cols-2 lg:grid-cols-3 gap-4 mb-8">
         {[
           { icon: <BookOpen size={20} className="text-indigo-300" />, label: 'Total Stories', value: myStories.length, sub: `${published.length} published`, color: 'bg-indigo-500/20' },
-          { icon: <Eye size={20} className="text-blue-300" />, label: 'Total Views', value: totalViews.toLocaleString(), sub: 'All time', color: 'bg-blue-500/20' },
           { icon: <Heart size={20} className="text-rose-300" />, label: 'Total Likes', value: totalLikes.toLocaleString(), sub: 'Across all stories', color: 'bg-rose-500/20' },
           { icon: <TrendingUp size={20} className="text-emerald-300" />, label: 'Drafts', value: drafts.length, sub: 'In progress', color: 'bg-emerald-500/20' },
@@ -108,5 +108,4 @@
                       <div className="flex items-center gap-3 text-slate-500 text-xs">
                         {isCollab && <span className="text-slate-500">by {story.author_username}</span>}
-                        <span className="flex items-center gap-1"><Eye size={11} /> {story.total_views.toLocaleString()}</span>
                         <span className="flex items-center gap-1"><Heart size={11} /> {story.total_likes}</span>
                         <span className="flex items-center gap-1"><MessageCircle size={11} /> {story.total_comments}</span>
@@ -155,7 +154,6 @@
             <TrendingUp size={18} className="text-indigo-400" />
             <h2 className="font-serif text-xl font-bold text-white">Analytics</h2>
-            <span className="text-slate-500 text-sm">(Story: The Chronicles of Eldoria)</span>
           </div>
-          <StoryAnalytics />
+          <StoryAnalytics stories={myStories} />
         </div>
       )}
Index: chapterx-frontend/src/store/authStore.ts
===================================================================
--- chapterx-frontend/src/store/authStore.ts	(revision 0b502c2664f4d6c64626f3394b4f1dc540e0aa9b)
+++ chapterx-frontend/src/store/authStore.ts	(revision 99c1e45f4ac45a164229bc6f60f3b05bc26df047)
@@ -2,5 +2,4 @@
 import { persist } from 'zustand/middleware'
 import { User, UserRole } from '../types'
-import { mockUsers } from '../data/mockData'
 import axios from 'axios'
 
@@ -153,4 +152,5 @@
           const res = await axios.get(`${API_BASE}/users`)
           const data: any[] = res.data?.users ?? res.data ?? []
+          const existing = get().allUsers
           const users: User[] = data.map((u: any) => ({
             user_id: u.id,
@@ -163,4 +163,5 @@
             follower_count: 0,
             following_count: 0,
+            bio: existing.find(e => e.user_id === u.id)?.bio,
           }))
           set({ allUsers: users })
Index: chapterx-frontend/src/store/storyStore.ts
===================================================================
--- chapterx-frontend/src/store/storyStore.ts	(revision 0b502c2664f4d6c64626f3394b4f1dc540e0aa9b)
+++ chapterx-frontend/src/store/storyStore.ts	(revision 99c1e45f4ac45a164229bc6f60f3b05bc26df047)
@@ -138,7 +138,8 @@
         story_id: s.id,
         user_id: s.userId,
-        title: s.shortDescription,
-        short_description: s.shortDescription,
-        content: s.content,
+        title: s.title ?? '',
+        short_description: s.shortDescription ?? '',
+        content: s.content ?? '',
+        cover_image: s.image ?? undefined,
         mature_content: s.matureContent,
         status: 'published' as StoryStatus,
@@ -203,8 +204,10 @@
   addStory: async (story) => {
     set(state => ({ stories: [...state.stories, story] }))
+    const imageUrl = story.cover_image?.startsWith('http') ? story.cover_image : null
     const res = await axios.post(`${API}/stories`, {
       matureContent: story.mature_content,
-      shortDescription: story.short_description || story.title,
-      image: null,
+      title: story.title,
+      shortDescription: story.short_description,
+      image: imageUrl,
       content: story.content,
       userId: story.user_id,
@@ -233,9 +236,12 @@
       const story = get().stories.find(s => s.story_id === id)
       if (!story) return
+      const rawImage = partial.cover_image ?? story.cover_image ?? null
+      const imageUrl = rawImage?.startsWith('http') ? rawImage : null
       await axios.put(`${API}/stories/${id}`, {
         id,
         matureContent: partial.mature_content ?? story.mature_content,
-        shortDescription: partial.title ?? partial.short_description ?? story.title ?? story.short_description,
-        image: null,
+        title: partial.title ?? story.title,
+        shortDescription: partial.short_description ?? story.short_description,
+        image: imageUrl,
         content: partial.content ?? story.content,
       }, { headers: getAuthHeaders() })
@@ -335,10 +341,16 @@
   },
 
-  incrementViewCount: (chapterId) =>
+  incrementViewCount: (chapterId) => {
+    const chapter = get().chapters.find(c => c.chapter_id === chapterId)
     set(state => ({
       chapters: state.chapters.map(c =>
         c.chapter_id === chapterId ? { ...c, view_count: c.view_count + 1 } : c
       ),
-    })),
+      stories: state.stories.map(s =>
+        s.story_id === chapter?.story_id ? { ...s, total_views: s.total_views + 1 } : s
+      ),
+    }))
+    axios.patch(`${API}/chapters/${chapterId}/view`, null, { headers: getAuthHeaders() }).catch(() => {})
+  },
 
   addComment: (comment) =>
