Index: chapterx-frontend/src/App.tsx
===================================================================
--- chapterx-frontend/src/App.tsx	(revision b62cefc14094ca5ac7154f7d48797a1e6c444935)
+++ chapterx-frontend/src/App.tsx	(revision acf690c1403ecbecd948a46d950278f177f2d408)
@@ -1,6 +1,7 @@
-import React, { Suspense, lazy, ReactNode } from 'react'
+import React, { Suspense, lazy, ReactNode, useEffect } from 'react'
 import { Routes, Route, Navigate } from 'react-router-dom'
 import { useAuthStore } from './store/authStore'
 import { useUIStore } from './store/uiStore'
+import { useStoryStore } from './store/storyStore'
 import { UserRole } from './types'
 import { Navbar } from './components/layout/Navbar'
@@ -67,4 +68,12 @@
 
 function App() {
+  const { fetchStories, fetchChapters, fetchReadingLists } = useStoryStore()
+
+  useEffect(() => {
+    fetchStories()
+    fetchChapters()
+    fetchReadingLists()
+  }, [])
+
   return (
     <div className="flex flex-col min-h-screen">
Index: chapterx-frontend/src/components/writer/StoryCreationAIPanel.tsx
===================================================================
--- chapterx-frontend/src/components/writer/StoryCreationAIPanel.tsx	(revision acf690c1403ecbecd948a46d950278f177f2d408)
+++ chapterx-frontend/src/components/writer/StoryCreationAIPanel.tsx	(revision acf690c1403ecbecd948a46d950278f177f2d408)
@@ -0,0 +1,123 @@
+import React, { useMemo, useImperativeHandle, forwardRef } from 'react'
+import { Sparkles, Lightbulb } from 'lucide-react'
+
+interface StoryCreationAIPanelProps {
+  title: string
+  description: string
+  content: string
+  genres: string[]
+}
+
+export interface StoryCreationAIPanelRef {
+  getSuggestions: () => Array<{ originalText: string; suggestedText: string }>
+}
+
+interface Tip {
+  type: 'plot' | 'style' | 'character' | 'grammar' | 'pacing'
+  label: string
+  original: string
+  suggested: string
+}
+
+const typeColors: Record<Tip['type'], string> = {
+  plot: 'bg-amber-500/20 text-amber-300 border-amber-500/30',
+  style: 'bg-violet-500/20 text-violet-300 border-violet-500/30',
+  character: 'bg-emerald-500/20 text-emerald-300 border-emerald-500/30',
+  grammar: 'bg-blue-500/20 text-blue-300 border-blue-500/30',
+  pacing: 'bg-pink-500/20 text-pink-300 border-pink-500/30',
+}
+
+function buildTips(title: string, description: string, content: string, genres: string[]): Tip[] {
+  const tips: Tip[] = []
+  const wordCount = content.trim().split(/\s+/).filter(Boolean).length
+
+  if (!title.trim()) {
+    tips.push({ type: 'style', label: 'Title', original: '(no title)', suggested: 'Add a title that hints at the core conflict or world without giving it away.' })
+  } else if (title.length < 5) {
+    tips.push({ type: 'style', label: 'Title', original: title, suggested: 'Consider a more evocative title — even 3–4 punchy words can create intrigue.' })
+  }
+
+  if (!description.trim()) {
+    tips.push({ type: 'plot', label: 'Description', original: '(no description)', suggested: 'Introduce the protagonist, hint at the conflict, and end with a hook that makes readers want more.' })
+  } else if (description.length < 60) {
+    tips.push({ type: 'plot', label: 'Description', original: description, suggested: 'Expand your description — give readers a taste of the stakes and what your protagonist stands to lose.' })
+  }
+
+  if (!content.trim()) {
+    tips.push({ type: 'character', label: 'Opening', original: '(no content)', suggested: 'Start in the middle of action or a compelling character moment. Avoid opening with backstory dumps.' })
+  } else if (wordCount < 50) {
+    tips.push({ type: 'pacing', label: 'Content length', original: `${wordCount} words`, suggested: 'Give readers more to engage with — the opening sets tone and world before the story begins.' })
+  } else if (wordCount > 200) {
+    tips.push({ type: 'pacing', label: 'Pacing', original: content.slice(0, 80) + '...', suggested: 'Great start! Keep momentum — each paragraph should make the reader want to continue.' })
+  }
+
+  if (genres.length === 0) {
+    tips.push({ type: 'plot', label: 'Genres', original: '(none selected)', suggested: 'Select genres to help readers discover your story. Pick the ones that best match tone and setting.' })
+  }
+
+  if (genres.includes('Fantasy') || genres.includes('Sci-Fi')) {
+    tips.push({ type: 'character', label: 'World-building', original: content.slice(0, 60) || '(content)', suggested: 'Weave world-building into scenes naturally — show the world through your character\'s eyes, not info-dumps.' })
+  }
+
+  if (genres.includes('Romance')) {
+    tips.push({ type: 'character', label: 'Chemistry', original: description || '(description)', suggested: 'Establish your characters\' desires and flaws early so their connection feels earned.' })
+  }
+
+  if (genres.includes('Thriller') || genres.includes('Mystery')) {
+    tips.push({ type: 'plot', label: 'Tension', original: content.slice(0, 60) || '(opening)', suggested: 'Plant an unanswered question in your opening. Thriller/mystery readers stay for the unresolved "why".' })
+  }
+
+  if (genres.includes('Horror')) {
+    tips.push({ type: 'pacing', label: 'Atmosphere', original: content.slice(0, 60) || '(opening)', suggested: 'Build dread gradually — horror works best when the reader senses something is wrong before the characters do.' })
+  }
+
+  return tips.slice(0, 5)
+}
+
+export const StoryCreationAIPanel = forwardRef<StoryCreationAIPanelRef, StoryCreationAIPanelProps>(
+  ({ title, description, content, genres }, ref) => {
+    const tips = useMemo(
+      () => buildTips(title, description, content, genres),
+      [title, description, content, genres.join(',')]
+    )
+
+    useImperativeHandle(ref, () => ({
+      getSuggestions: () => tips.map(t => ({ originalText: t.original, suggestedText: t.suggested })),
+    }))
+
+    return (
+      <div className="bg-slate-900 border border-slate-700 rounded-2xl p-5 sticky top-6">
+        <div className="flex items-center gap-2 mb-4">
+          <Sparkles size={16} className="text-violet-400" />
+          <h3 className="text-white font-semibold text-sm">AI Writing Tips</h3>
+          <span className="ml-auto text-xs text-slate-500">{tips.length} suggestions</span>
+        </div>
+
+        {tips.length === 0 ? (
+          <div className="text-center py-6 text-slate-500 text-sm">
+            <Sparkles size={28} className="mx-auto mb-2 opacity-30" />
+            <p>Looking great! No suggestions right now.</p>
+          </div>
+        ) : (
+          <div className="space-y-3">
+            {tips.map((tip, i) => (
+              <div key={i} className="flex gap-3 p-3 bg-slate-800 rounded-xl border border-slate-700">
+                <Lightbulb size={15} className="text-violet-400 flex-shrink-0 mt-0.5" />
+                <div className="min-w-0">
+                  <div className="flex items-center gap-1.5 mb-1">
+                    <span className={`px-2 py-0.5 text-xs font-medium rounded-full border ${typeColors[tip.type]}`}>
+                      {tip.type}
+                    </span>
+                    <span className="text-xs text-slate-400 font-medium">{tip.label}</span>
+                  </div>
+                  <p className="text-xs text-slate-500 italic mb-1 truncate">"{tip.original}"</p>
+                  <p className="text-xs text-slate-300 leading-relaxed">{tip.suggested}</p>
+                </div>
+              </div>
+            ))}
+          </div>
+        )}
+      </div>
+    )
+  }
+)
Index: chapterx-frontend/src/pages/reading-list/ReadingListPage.tsx
===================================================================
--- chapterx-frontend/src/pages/reading-list/ReadingListPage.tsx	(revision b62cefc14094ca5ac7154f7d48797a1e6c444935)
+++ chapterx-frontend/src/pages/reading-list/ReadingListPage.tsx	(revision acf690c1403ecbecd948a46d950278f177f2d408)
@@ -1,3 +1,3 @@
-import React, { useState } from 'react'
+import React, { useState, useEffect } from 'react'
 import { useNavigate } from 'react-router-dom'
 import { Plus, BookOpen, Lock, Globe, Trash2, X } from 'lucide-react'
@@ -12,5 +12,9 @@
   const navigate = useNavigate()
   const { currentUser } = useAuthStore()
-  const { readingLists, createReadingList, deleteReadingList, removeStoryFromList } = useStoryStore()
+  const { readingLists, fetchReadingLists, createReadingList, deleteReadingList, removeStoryFromList } = useStoryStore()
+
+  useEffect(() => {
+    fetchReadingLists()
+  }, [])
   const { addToast } = useUIStore()
   const [createOpen, setCreateOpen] = useState(false)
@@ -31,17 +35,22 @@
   const myLists = readingLists.filter(l => l.user_id === currentUser.user_id)
 
-  const handleCreate = () => {
+  const handleCreate = async () => {
     if (!newListName.trim()) return
-    createReadingList({
-      list_id: Date.now(),
-      user_id: currentUser.user_id,
-      username: currentUser.username,
-      name: newListName.trim(),
-      description: newListDesc.trim() || undefined,
-      is_public: isPublic,
-      created_at: new Date().toISOString(),
-      stories: [],
-    })
-    addToast(`"${newListName}" created!`)
+    try {
+      await createReadingList({
+        list_id: Date.now(),
+        user_id: currentUser.user_id,
+        username: currentUser.username,
+        name: newListName.trim(),
+        description: newListDesc.trim() || undefined,
+        is_public: isPublic,
+        created_at: new Date().toISOString(),
+        stories: [],
+      })
+      addToast(`"${newListName}" created!`)
+    } catch (err: any) {
+      addToast(err?.response?.data?.message || 'Failed to create list.', 'error')
+      return
+    }
     setNewListName('')
     setNewListDesc('')
@@ -100,5 +109,5 @@
                   </div>
                   <button
-                    onClick={() => { deleteReadingList(list.list_id); addToast('List deleted', 'info') }}
+                    onClick={async () => { try { await deleteReadingList(list.list_id); addToast('List deleted', 'info') } catch { addToast('Failed to delete list.', 'error') } }}
                     className="text-slate-500 hover:text-rose-400 transition-colors p-1"
                   >
Index: chapterx-frontend/src/pages/story/StoryDetailPage.tsx
===================================================================
--- chapterx-frontend/src/pages/story/StoryDetailPage.tsx	(revision b62cefc14094ca5ac7154f7d48797a1e6c444935)
+++ chapterx-frontend/src/pages/story/StoryDetailPage.tsx	(revision acf690c1403ecbecd948a46d950278f177f2d408)
@@ -39,5 +39,5 @@
   const myLists = currentUser ? readingLists.filter(l => l.user_id === currentUser.user_id) : []
 
-  const handleAddToList = (listId: number) => {
+  const handleAddToList = async (listId: number) => {
     const list = readingLists.find(l => l.list_id === listId)
     if (!list) return
@@ -55,10 +55,19 @@
       genres: story.genres,
     }
-    addStoryToList(listId, item)
-    addToast(`Added to "${list.name}"!`)
+    try {
+      await addStoryToList(listId, item)
+      addToast(`Added to "${list.name}"!`)
+    } catch (err: any) {
+      const msg = err?.response?.data?.message || ''
+      if (msg.includes('already') || msg.includes('duplicate') || err?.response?.status === 400) {
+        addToast('Already in this list', 'info')
+      } else {
+        addToast('Failed to add to list.', 'error')
+      }
+    }
     setListModalOpen(false)
   }
 
-  const handleCreateList = () => {
+  const handleCreateList = async () => {
     if (!newListName.trim() || !currentUser) return
     const newList = {
@@ -69,7 +78,11 @@
       is_public: false,
       created_at: new Date().toISOString(),
-      stories: [{
+      stories: [],
+    }
+    try {
+      const realListId = await createReadingList(newList)
+      await addStoryToList(realListId, {
         item_id: Date.now() + 1,
-        list_id: Date.now(),
+        list_id: realListId,
         story_id: story.story_id,
         story_title: story.title,
@@ -77,8 +90,9 @@
         added_at: new Date().toISOString(),
         genres: story.genres,
-      }],
-    }
-    createReadingList(newList)
-    addToast(`Created "${newListName}" and added story!`)
+      })
+      addToast(`Created "${newListName}" and added story!`)
+    } catch {
+      addToast('Failed to create list.', 'error')
+    }
     setNewListName('')
     setListModalOpen(false)
Index: chapterx-frontend/src/pages/writer/CreateChapterPage.tsx
===================================================================
--- chapterx-frontend/src/pages/writer/CreateChapterPage.tsx	(revision b62cefc14094ca5ac7154f7d48797a1e6c444935)
+++ chapterx-frontend/src/pages/writer/CreateChapterPage.tsx	(revision acf690c1403ecbecd948a46d950278f177f2d408)
@@ -56,7 +56,14 @@
       is_published: isPublished,
     }
-    addChapter(chapter)
+    try {
+      await addChapter(chapter)
+    } catch (err: any) {
+      const msg = err?.response?.data?.message || err?.message || 'Failed to save chapter.'
+      addToast(msg, 'error')
+      setLoading(false)
+      return
+    }
     addToast(isPublished ? 'Chapter published!' : 'Chapter saved as draft!')
-    navigate(`/writer/edit-story/${storyId}`)
+    navigate(isPublished ? `/story/${storyId}` : `/writer/edit-story/${storyId}`)
     setLoading(false)
   }
Index: chapterx-frontend/src/pages/writer/CreateStoryPage.tsx
===================================================================
--- chapterx-frontend/src/pages/writer/CreateStoryPage.tsx	(revision b62cefc14094ca5ac7154f7d48797a1e6c444935)
+++ chapterx-frontend/src/pages/writer/CreateStoryPage.tsx	(revision acf690c1403ecbecd948a46d950278f177f2d408)
@@ -1,3 +1,3 @@
-import React, { useState } from 'react'
+import React, { useState, useRef } from 'react'
 import { useNavigate } from 'react-router-dom'
 import { Feather, ArrowLeft, X } from 'lucide-react'
@@ -6,4 +6,5 @@
 import { useUIStore } from '../../store/uiStore'
 import { Button } from '../../components/ui/Button'
+import { StoryCreationAIPanel, StoryCreationAIPanelRef } from '../../components/writer/StoryCreationAIPanel'
 import { Story } from '../../types'
 
@@ -13,6 +14,7 @@
   const navigate = useNavigate()
   const { currentUser } = useAuthStore()
-  const { addStory } = useStoryStore()
+  const { addStory, addSuggestion } = useStoryStore()
   const { addToast } = useUIStore()
+  const aiPanelRef = useRef<StoryCreationAIPanelRef>(null)
   const [form, setForm] = useState({
     title: '',
@@ -53,7 +55,16 @@
       total_views: 0,
     }
-    addStory(story)
+    let realId: number
+    try {
+      realId = await addStory(story)
+    } catch (err: any) {
+      const msg = err?.response?.data?.message || err?.message || 'Failed to save story.'
+      addToast(msg, 'error')
+      setLoading(false)
+      return
+    }
+
     addToast(status === 'published' ? 'Story published!' : 'Draft saved!')
-    navigate(`/writer/edit-story/${story.story_id}`)
+    navigate(`/writer/edit-story/${realId}`)
     setLoading(false)
   }
@@ -73,5 +84,5 @@
 
   return (
-    <div className="max-w-3xl mx-auto px-4 py-8">
+    <div className="max-w-6xl mx-auto px-4 py-8">
       <div className="flex items-center gap-3 mb-8">
         <button onClick={() => navigate('/writer')} className="text-slate-400 hover:text-white transition-colors">
@@ -84,104 +95,117 @@
       </div>
 
-      <div className="space-y-6">
-        {/* Title */}
-        <div>
-          <label className="block text-sm font-medium text-slate-300 mb-1.5">Story Title *</label>
-          <input
-            value={form.title}
-            onChange={e => setField('title', e.target.value)}
-            placeholder="The Chronicles of Eldoria..."
-            className={`w-full px-4 py-3 bg-slate-800 border rounded-xl text-white placeholder-slate-500 focus:outline-none focus:border-indigo-500 text-lg font-serif ${errors.title ? 'border-rose-500' : 'border-slate-700'}`}
-          />
-          {errors.title && <p className="text-rose-400 text-xs mt-1">{errors.title}</p>}
-        </div>
-
-        {/* Short description */}
-        <div>
-          <label className="block text-sm font-medium text-slate-300 mb-1.5">Short Description * <span className="text-slate-500 font-normal">(shown on story cards)</span></label>
-          <textarea
-            value={form.short_description}
-            onChange={e => setField('short_description', e.target.value)}
-            placeholder="When the last dragon awakens..."
-            rows={3}
-            maxLength={280}
-            className={`w-full px-4 py-3 bg-slate-800 border rounded-xl text-white placeholder-slate-500 focus:outline-none focus:border-indigo-500 resize-none ${errors.short_description ? 'border-rose-500' : 'border-slate-700'}`}
-          />
-          <div className="flex justify-between items-center mt-1">
-            {errors.short_description ? <p className="text-rose-400 text-xs">{errors.short_description}</p> : <span />}
-            <span className="text-slate-600 text-xs">{form.short_description.length}/280</span>
-          </div>
-        </div>
-
-        {/* Content */}
-        <div>
-          <label className="block text-sm font-medium text-slate-300 mb-1.5">Story Content *</label>
-          <textarea
-            value={form.content}
-            onChange={e => setField('content', e.target.value)}
-            placeholder="Begin your story here. This is the introduction that readers will see..."
-            rows={8}
-            className={`w-full px-4 py-3 bg-slate-800 border rounded-xl text-white placeholder-slate-500 focus:outline-none focus:border-indigo-500 resize-y font-serif ${errors.content ? 'border-rose-500' : 'border-slate-700'}`}
-          />
-          {errors.content && <p className="text-rose-400 text-xs mt-1">{errors.content}</p>}
-        </div>
-
-        {/* Genres */}
-        <div>
-          <label className="block text-sm font-medium text-slate-300 mb-2">Genres * <span className="text-slate-500 font-normal">(select 1-3)</span></label>
-          <div className="flex flex-wrap gap-2 mb-2">
-            {ALL_GENRES.map(g => (
-              <button
-                key={g}
-                type="button"
-                onClick={() => toggleGenre(g)}
-                className={`px-3 py-1.5 rounded-full text-sm border transition-all ${
-                  form.genres.includes(g)
-                    ? 'bg-indigo-500/30 text-indigo-300 border-indigo-500/50'
-                    : 'bg-slate-800 text-slate-400 border-slate-700 hover:border-slate-500'
-                }`}
-              >
-                {form.genres.includes(g) && <span className="mr-1">✓</span>}
-                {g}
-              </button>
-            ))}
-          </div>
-          {form.genres.length > 0 && (
-            <div className="flex flex-wrap gap-1 mt-1">
-              {form.genres.map(g => (
-                <span key={g} className="flex items-center gap-1 text-xs px-2 py-0.5 bg-indigo-500/20 text-indigo-300 rounded-full">
+      <div className="grid grid-cols-1 lg:grid-cols-3 gap-8">
+        <div className="lg:col-span-2 space-y-6">
+          {/* Title */}
+          <div>
+            <label className="block text-sm font-medium text-slate-300 mb-1.5">Story Title *</label>
+            <input
+              value={form.title}
+              onChange={e => setField('title', e.target.value)}
+              placeholder="The Chronicles of Eldoria..."
+              className={`w-full px-4 py-3 bg-slate-800 border rounded-xl text-white placeholder-slate-500 focus:outline-none focus:border-indigo-500 text-lg font-serif ${errors.title ? 'border-rose-500' : 'border-slate-700'}`}
+            />
+            {errors.title && <p className="text-rose-400 text-xs mt-1">{errors.title}</p>}
+          </div>
+
+          {/* Short description */}
+          <div>
+            <label className="block text-sm font-medium text-slate-300 mb-1.5">Short Description * <span className="text-slate-500 font-normal">(shown on story cards)</span></label>
+            <textarea
+              value={form.short_description}
+              onChange={e => setField('short_description', e.target.value)}
+              placeholder="When the last dragon awakens..."
+              rows={3}
+              maxLength={280}
+              className={`w-full px-4 py-3 bg-slate-800 border rounded-xl text-white placeholder-slate-500 focus:outline-none focus:border-indigo-500 resize-none ${errors.short_description ? 'border-rose-500' : 'border-slate-700'}`}
+            />
+            <div className="flex justify-between items-center mt-1">
+              {errors.short_description ? <p className="text-rose-400 text-xs">{errors.short_description}</p> : <span />}
+              <span className="text-slate-600 text-xs">{form.short_description.length}/280</span>
+            </div>
+          </div>
+
+          {/* Content */}
+          <div>
+            <label className="block text-sm font-medium text-slate-300 mb-1.5">Story Content *</label>
+            <textarea
+              value={form.content}
+              onChange={e => setField('content', e.target.value)}
+              placeholder="Begin your story here. This is the introduction that readers will see..."
+              rows={8}
+              className={`w-full px-4 py-3 bg-slate-800 border rounded-xl text-white placeholder-slate-500 focus:outline-none focus:border-indigo-500 resize-y font-serif ${errors.content ? 'border-rose-500' : 'border-slate-700'}`}
+            />
+            {errors.content && <p className="text-rose-400 text-xs mt-1">{errors.content}</p>}
+          </div>
+
+          {/* Genres */}
+          <div>
+            <label className="block text-sm font-medium text-slate-300 mb-2">Genres * <span className="text-slate-500 font-normal">(select 1-3)</span></label>
+            <div className="flex flex-wrap gap-2 mb-2">
+              {ALL_GENRES.map(g => (
+                <button
+                  key={g}
+                  type="button"
+                  onClick={() => toggleGenre(g)}
+                  className={`px-3 py-1.5 rounded-full text-sm border transition-all ${
+                    form.genres.includes(g)
+                      ? 'bg-indigo-500/30 text-indigo-300 border-indigo-500/50'
+                      : 'bg-slate-800 text-slate-400 border-slate-700 hover:border-slate-500'
+                  }`}
+                >
+                  {form.genres.includes(g) && <span className="mr-1">✓</span>}
                   {g}
-                  <button onClick={() => toggleGenre(g)}><X size={10} /></button>
-                </span>
+                </button>
               ))}
             </div>
-          )}
-          {errors.genres && <p className="text-rose-400 text-xs mt-1">{errors.genres}</p>}
+            {form.genres.length > 0 && (
+              <div className="flex flex-wrap gap-1 mt-1">
+                {form.genres.map(g => (
+                  <span key={g} className="flex items-center gap-1 text-xs px-2 py-0.5 bg-indigo-500/20 text-indigo-300 rounded-full">
+                    {g}
+                    <button onClick={() => toggleGenre(g)}><X size={10} /></button>
+                  </span>
+                ))}
+              </div>
+            )}
+            {errors.genres && <p className="text-rose-400 text-xs mt-1">{errors.genres}</p>}
+          </div>
+
+          {/* Mature content */}
+          <div className="flex items-center gap-3">
+            <button
+              type="button"
+              onClick={() => setField('mature_content', !form.mature_content)}
+              className={`w-11 h-6 rounded-full transition-colors ${form.mature_content ? 'bg-rose-500' : 'bg-slate-600'} relative flex-shrink-0`}
+            >
+              <div className={`absolute top-1 w-4 h-4 bg-white rounded-full transition-transform ${form.mature_content ? 'translate-x-6' : 'translate-x-1'}`} />
+            </button>
+            <div>
+              <p className="text-white text-sm font-medium">Mature Content (18+)</p>
+              <p className="text-slate-500 text-xs">Enable for stories with adult themes</p>
+            </div>
+          </div>
+
+          {/* Actions */}
+          <div className="flex gap-3 pt-4 border-t border-slate-700">
+            <Button variant="secondary" className="flex-1" onClick={() => handleSubmit('draft')} loading={loading}>
+              Save as Draft
+            </Button>
+            <Button className="flex-1" onClick={() => handleSubmit('published')} loading={loading}>
+              <Feather size={16} />
+              Publish Story
+            </Button>
+          </div>
         </div>
 
-        {/* Mature content */}
-        <div className="flex items-center gap-3">
-          <button
-            type="button"
-            onClick={() => setField('mature_content', !form.mature_content)}
-            className={`w-11 h-6 rounded-full transition-colors ${form.mature_content ? 'bg-rose-500' : 'bg-slate-600'} relative flex-shrink-0`}
-          >
-            <div className={`absolute top-1 w-4 h-4 bg-white rounded-full transition-transform ${form.mature_content ? 'translate-x-6' : 'translate-x-1'}`} />
-          </button>
-          <div>
-            <p className="text-white text-sm font-medium">Mature Content (18+)</p>
-            <p className="text-slate-500 text-xs">Enable for stories with adult themes</p>
-          </div>
-        </div>
-
-        {/* Actions */}
-        <div className="flex gap-3 pt-4 border-t border-slate-700">
-          <Button variant="secondary" className="flex-1" onClick={() => handleSubmit('draft')} loading={loading}>
-            Save as Draft
-          </Button>
-          <Button className="flex-1" onClick={() => handleSubmit('published')} loading={loading}>
-            <Feather size={16} />
-            Publish Story
-          </Button>
+        {/* AI Suggestions Sidebar */}
+        <div className="lg:col-span-1">
+          <StoryCreationAIPanel
+            ref={aiPanelRef}
+            title={form.title}
+            description={form.short_description}
+            content={form.content}
+            genres={form.genres}
+          />
         </div>
       </div>
Index: chapterx-frontend/src/pages/writer/EditStoryPage.tsx
===================================================================
--- chapterx-frontend/src/pages/writer/EditStoryPage.tsx	(revision b62cefc14094ca5ac7154f7d48797a1e6c444935)
+++ chapterx-frontend/src/pages/writer/EditStoryPage.tsx	(revision acf690c1403ecbecd948a46d950278f177f2d408)
@@ -63,4 +63,5 @@
     addToast('Story updated!')
     setSaving(false)
+    navigate(`/story/${story.story_id}`)
   }
 
Index: chapterx-frontend/src/store/authStore.ts
===================================================================
--- chapterx-frontend/src/store/authStore.ts	(revision b62cefc14094ca5ac7154f7d48797a1e6c444935)
+++ chapterx-frontend/src/store/authStore.ts	(revision acf690c1403ecbecd948a46d950278f177f2d408)
@@ -27,5 +27,5 @@
       token: null,
       showMatureContent: true,
-      allUsers: [...mockUsers],
+      allUsers: [],
 
       login: async (emailOrUsername, password) => {
@@ -36,21 +36,26 @@
             : get().allUsers.find(u => u.username === emailOrUsername)?.email || emailOrUsername
           const res = await axios.post(`${API_BASE}/auth/login`, { email, password }, { timeout: 3000 })
-          const { token, userId, username } = res.data
-          const user = get().allUsers.find(u => u.user_id === userId) ||
-            get().allUsers.find(u => u.username === username) || {
-              user_id: userId,
-              username,
-              email,
-              name: username,
-              surname: '',
-              role: 'regular' as const,
-              created_at: new Date().toISOString(),
-              follower_count: 0,
-              following_count: 0,
-            }
+          const { token, userId, username, name, surname, role } = res.data
+          const user: User = {
+            user_id: userId,
+            username,
+            email,
+            name: name ?? username,
+            surname: surname ?? '',
+            role: role ?? 'regular',
+            created_at: new Date().toISOString(),
+            follower_count: 0,
+            following_count: 0,
+          }
           set({ currentUser: user, token })
           return
-        } catch {
-          // Fall through to mock login
+        } catch (err: any) {
+          // Only fall through to mock if the backend is unreachable (network/timeout)
+          // If the backend responded with an error (4xx/5xx), surface it to the user
+          if (err?.response) {
+            const message = err.response.data?.message || err.response.data || 'Invalid email or password.'
+            throw new Error(typeof message === 'string' ? message : 'Invalid email or password.')
+          }
+          // Network error / timeout — fall through to mock login
         }
 
@@ -66,9 +71,29 @@
 
       register: async (data, role) => {
-        // Try backend first
         try {
           await axios.post(`${API_BASE}/auth/register`, data, { timeout: 3000 })
-        } catch {
-          // Fall through to mock register
+          // Register doesn't return a token — auto-login to get one
+          const loginRes = await axios.post(`${API_BASE}/auth/login`, { email: data.email, password: data.password }, { timeout: 3000 })
+          const { token, userId, username } = loginRes.data
+          const newUser: User = {
+            user_id: userId,
+            username,
+            email: data.email,
+            name: data.name,
+            surname: data.surname,
+            role,
+            created_at: new Date().toISOString(),
+            follower_count: 0,
+            following_count: 0,
+          }
+          set(state => ({ allUsers: [...state.allUsers, newUser], currentUser: newUser, token }))
+          return
+        } catch (err: any) {
+          if (err?.response) {
+            const message = err.response.data?.message || err.response.data || 'Registration failed.'
+            throw new Error(typeof message === 'string' ? message : 'Registration failed.')
+          }
+          // Network error / timeout — fall through to mock register
+          console.warn('Backend unreachable during register, using mock:', err?.message)
         }
 
Index: chapterx-frontend/src/store/storyStore.ts
===================================================================
--- chapterx-frontend/src/store/storyStore.ts	(revision b62cefc14094ca5ac7154f7d48797a1e6c444935)
+++ chapterx-frontend/src/store/storyStore.ts	(revision acf690c1403ecbecd948a46d950278f177f2d408)
@@ -23,4 +23,15 @@
 } from '../data/mockData'
 
+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 LikeRecord {
   userId: number
@@ -38,14 +49,19 @@
   likedStories: LikeRecord[]
 
+  // Fetch from backend
+  fetchStories: () => Promise<void>
+  fetchChapters: () => Promise<void>
+  fetchReadingLists: () => Promise<void>
+
   // Story actions
-  addStory: (story: Story) => void
-  updateStory: (id: number, partial: Partial<Story>) => void
-  deleteStory: (id: number) => void
+  addStory: (story: Story) => Promise<number>
+  updateStory: (id: number, partial: Partial<Story>) => Promise<void>
+  deleteStory: (id: number) => Promise<void>
   updateStoryStatus: (id: number, status: StoryStatus) => void
 
   // Chapter actions
-  addChapter: (chapter: Chapter) => void
-  updateChapter: (id: number, partial: Partial<Chapter>) => void
-  deleteChapter: (id: number) => void
+  addChapter: (chapter: Chapter) => Promise<void>
+  updateChapter: (id: number, partial: Partial<Chapter>) => Promise<void>
+  deleteChapter: (id: number) => Promise<void>
   incrementViewCount: (chapterId: number) => void
 
@@ -74,8 +90,8 @@
 
   // Reading list actions
-  createReadingList: (list: ReadingList) => void
-  addStoryToList: (listId: number, item: ReadingListItem) => void
-  removeStoryFromList: (listId: number, storyId: number) => void
-  deleteReadingList: (listId: number) => void
+  createReadingList: (list: ReadingList) => Promise<number>
+  addStoryToList: (listId: number, item: ReadingListItem) => Promise<void>
+  removeStoryFromList: (listId: number, storyId: number) => Promise<void>
+  deleteReadingList: (listId: number) => Promise<void>
 }
 
@@ -90,13 +106,97 @@
   likedStories: [],
 
-  addStory: (story) =>
-    set(state => ({ stories: [...state.stories, story] })),
-
-  updateStory: (id, partial) =>
+  fetchStories: async () => {
+    try {
+      const res = await axios.get(`${API}/stories`)
+      const data: any[] = res.data?.stories ?? res.data ?? []
+      const stories: Story[] = data.map((s: any) => ({
+        story_id: s.id,
+        user_id: s.userId,
+        title: s.shortDescription,
+        short_description: s.shortDescription,
+        content: s.content,
+        mature_content: s.matureContent,
+        status: 'published' as StoryStatus,
+        author_username: '',
+        created_at: s.createdAt,
+        updated_at: s.updatedAt,
+        total_likes: 0,
+        total_comments: 0,
+        total_chapters: 0,
+        total_views: 0,
+        genres: [],
+      }))
+      if (stories.length > 0) set({ stories })
+    } catch {
+      // keep mock data on failure
+    }
+  },
+
+  fetchChapters: async () => {
+    try {
+      const res = await axios.get(`${API}/chapters`)
+      const data: any[] = res.data?.chapters ?? res.data ?? []
+      const chapters: Chapter[] = data.map((c: any) => ({
+        chapter_id: c.id,
+        story_id: c.storyId,
+        title: c.title ?? c.name,
+        content: c.content,
+        chapter_number: c.number,
+        word_count: c.wordCount ?? 0,
+        view_count: c.viewCount ?? 0,
+        is_published: true,
+        created_at: c.createdAt,
+        updated_at: c.updatedAt,
+      }))
+      if (chapters.length > 0) set({ chapters })
+    } catch {
+      // keep mock data on failure
+    }
+  },
+
+  addStory: async (story) => {
+    set(state => ({ stories: [...state.stories, story] }))
+    const res = await axios.post(`${API}/stories`, {
+      matureContent: story.mature_content,
+      shortDescription: story.title || story.short_description,
+      image: null,
+      content: story.content,
+      userId: story.user_id,
+    }, { headers: getAuthHeaders() })
+    const backendId = res.data?.id ?? res.data
+    if (backendId && backendId !== story.story_id) {
+      set(state => ({
+        stories: state.stories.map(s =>
+          s.story_id === story.story_id ? { ...s, story_id: backendId } : s
+        ),
+        chapters: state.chapters.map(c =>
+          c.story_id === story.story_id ? { ...c, story_id: backendId } : c
+        ),
+      }))
+      return backendId
+    }
+    return story.story_id
+  },
+
+  updateStory: async (id, partial) => {
     set(state => ({
       stories: state.stories.map(s => (s.story_id === id ? { ...s, ...partial } : s)),
-    })),
-
-  deleteStory: (id) =>
+    }))
+    try {
+      const story = get().stories.find(s => s.story_id === id)
+      if (!story) return
+      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,
+        content: partial.content ?? story.content,
+      }, { headers: getAuthHeaders() })
+    } catch {
+      // keep optimistic update on failure
+    }
+  },
+
+  deleteStory: async (id) => {
     set(state => ({
       stories: state.stories.filter(s => s.story_id !== id),
@@ -104,5 +204,11 @@
       comments: state.comments.filter(c => c.story_id !== id),
       collaborations: state.collaborations.filter(c => c.story_id !== id),
-    })),
+    }))
+    try {
+      await axios.delete(`${API}/stories/${id}`, { headers: getAuthHeaders() })
+    } catch {
+      // keep optimistic delete on failure
+    }
+  },
 
   updateStoryStatus: (id, status) =>
@@ -113,5 +219,5 @@
     })),
 
-  addChapter: (chapter) =>
+  addChapter: async (chapter) => {
     set(state => ({
       chapters: [...state.chapters, chapter],
@@ -121,14 +227,45 @@
           : s
       ),
-    })),
-
-  updateChapter: (id, partial) =>
+    }))
+    const res = await axios.post(`${API}/chapters`, {
+      number: chapter.chapter_number,
+      name: chapter.title,
+      title: chapter.title,
+      content: chapter.content,
+      storyId: chapter.story_id,
+    }, { headers: getAuthHeaders() })
+    const backendId = res.data?.id ?? res.data
+    if (backendId && backendId !== chapter.chapter_id) {
+      set(state => ({
+        chapters: state.chapters.map(c =>
+          c.chapter_id === chapter.chapter_id ? { ...c, chapter_id: backendId } : c
+        ),
+      }))
+    }
+  },
+
+  updateChapter: async (id, partial) => {
     set(state => ({
       chapters: state.chapters.map(c =>
         c.chapter_id === id ? { ...c, ...partial, updated_at: new Date().toISOString() } : c
       ),
-    })),
-
-  deleteChapter: (id) =>
+    }))
+    try {
+      const chapter = get().chapters.find(c => c.chapter_id === id)
+      if (!chapter) return
+      await axios.put(`${API}/chapters/${id}`, {
+        id,
+        number: partial.chapter_number ?? chapter.chapter_number,
+        name: partial.title ?? chapter.title,
+        title: partial.title ?? chapter.title,
+        content: partial.content ?? chapter.content,
+        wordCount: partial.word_count ?? chapter.word_count,
+      }, { headers: getAuthHeaders() })
+    } catch {
+      // keep optimistic update on failure
+    }
+  },
+
+  deleteChapter: async (id) => {
     set(state => {
       const chapter = state.chapters.find(c => c.chapter_id === id)
@@ -143,5 +280,11 @@
           : state.stories,
       }
-    }),
+    })
+    try {
+      await axios.delete(`${API}/chapters/${id}`, { headers: getAuthHeaders() })
+    } catch {
+      // keep optimistic delete on failure
+    }
+  },
 
   incrementViewCount: (chapterId) =>
@@ -218,5 +361,5 @@
   fetchSuggestions: async () => {
     try {
-      const res = await axios.get('https://localhost:7125/api/aisuggestions')
+      const res = await axios.get(`${API}/aisuggestions`)
       const data = res.data.aiSuggestions ?? res.data
       const mapped: AISuggestion[] = data.map((s: any) => ({
@@ -248,5 +391,5 @@
     }))
     try {
-      await axios.put(`https://localhost:7125/api/aisuggestions/${id}`, {
+      await axios.put(`${API}/aisuggestions/${id}`, {
         id,
         originalText: s.original_text,
@@ -268,5 +411,5 @@
     }))
     try {
-      await axios.put(`https://localhost:7125/api/aisuggestions/${id}`, {
+      await axios.put(`${API}/aisuggestions/${id}`, {
         id,
         originalText: s.original_text,
@@ -284,5 +427,5 @@
     set(state => ({ aiSuggestions: [...state.aiSuggestions, { ...suggestion, suggestion_id: tempId }] }))
     try {
-      const res = await axios.post('https://localhost:7125/api/aisuggestions', {
+      const res = await axios.post('${API}/aisuggestions', {
         originalText: suggestion.original_text,
         suggestedText: suggestion.suggested_text,
@@ -306,17 +449,72 @@
     set(state => ({ genres: state.genres.filter(g => g.genre_id !== id) })),
 
-  createReadingList: (list) =>
-    set(state => ({ readingLists: [...state.readingLists, list] })),
-
-  addStoryToList: (listId, item) =>
+  fetchReadingLists: async () => {
+    try {
+      const [listsRes, storiesRes] = await Promise.all([
+        axios.get(`${API}/readinglists`),
+        axios.get(`${API}/stories`),
+      ])
+      const data: any[] = listsRes.data?.readingLists ?? listsRes.data ?? []
+      const storiesData: any[] = storiesRes.data?.stories ?? storiesRes.data ?? []
+      const lists: ReadingList[] = data.map((l: any) => ({
+        list_id: l.id,
+        user_id: l.userId,
+        username: '',
+        name: l.name,
+        description: l.content ?? '',
+        is_public: l.isPublic,
+        created_at: l.createdAt,
+        stories: (l.readingListItems ?? []).map((i: any) => {
+          const story = storiesData.find((s: any) => s.id === i.storyId)
+          return {
+            item_id: i.id ?? 0,
+            list_id: l.id,
+            story_id: i.storyId,
+            story_title: story?.title ?? story?.shortDescription ?? `Story #${i.storyId}`,
+            author_username: story?.authorUsername ?? '',
+            added_at: i.addedAt ?? new Date().toISOString(),
+            genres: story?.genres ?? [],
+          }
+        }),
+      }))
+      if (lists.length > 0) set({ readingLists: lists })
+    } catch {
+      // keep mock data on failure
+    }
+  },
+
+  createReadingList: async (list) => {
+    set(state => ({ readingLists: [...state.readingLists, list] }))
+    const res = await axios.post(`${API}/readinglists`, {
+      name: list.name,
+      content: list.description ?? null,
+      isPublic: list.is_public,
+      userId: list.user_id,
+    }, { headers: getAuthHeaders() })
+    const backendId = res.data?.id ?? res.data
+    if (backendId && backendId !== list.list_id) {
+      set(state => ({
+        readingLists: state.readingLists.map(l =>
+          l.list_id === list.list_id ? { ...l, list_id: backendId } : l
+        ),
+      }))
+      return backendId
+    }
+    return list.list_id
+  },
+
+  addStoryToList: async (listId, item) => {
     set(state => ({
       readingLists: state.readingLists.map(l =>
-        l.list_id === listId
-          ? { ...l, stories: [...l.stories, item] }
-          : l
-      ),
-    })),
-
-  removeStoryFromList: (listId, storyId) =>
+        l.list_id === listId ? { ...l, stories: [...l.stories, item] } : l
+      ),
+    }))
+    await axios.post(`${API}/readinglistitems`, {
+      readingListId: listId,
+      storyId: item.story_id,
+    }, { headers: getAuthHeaders() })
+  },
+
+  removeStoryFromList: async (listId, storyId) => {
     set(state => ({
       readingLists: state.readingLists.map(l =>
@@ -325,9 +523,21 @@
           : l
       ),
-    })),
-
-  deleteReadingList: (listId) =>
+    }))
+    try {
+      // find the item id from backend list items to delete
+      const res = await axios.get(`${API}/readinglistitems`)
+      const items: any[] = res.data?.readingListItems ?? res.data ?? []
+      const item = items.find((i: any) => i.readingListId === listId && i.storyId === storyId)
+      if (item) await axios.delete(`${API}/readinglistitems/${item.id}`, { headers: getAuthHeaders() })
+    } catch {
+      // optimistic update already applied
+    }
+  },
+
+  deleteReadingList: async (listId) => {
     set(state => ({
       readingLists: state.readingLists.filter(l => l.list_id !== listId),
-    })),
+    }))
+    await axios.delete(`${API}/readinglists/${listId}`, { headers: getAuthHeaders() })
+  },
 }))
