Skip to content

Repository files navigation

Neeva – Crafting Worlds with Words

A modern platform where writers discover, create, and share captivating short stories, poetry, and flash fiction with a vibrant community of storytellers.

TypeScript Svelte SvelteKit Tailwind CSS Supabase


🎯 Overview

Neeva is a full-stack web application designed for writers and readers to connect through the art of concise storytelling. Built with modern web technologies, it provides an intuitive platform where creators can craft and share micro-fiction, poetry, and short stories while building engaged communities around their work.

Whether you're a seasoned author or an aspiring writer, Neeva empowers you to tell compelling stories where every word counts.


✨ Key Features

πŸ“š Lens (Story Hub)

  • Discover and read curated short stories organized by genre
  • Intelligent prioritization algorithm to surface quality content
  • View story metadata including word count, genre, and author details
  • Track reading progress across your favorite stories

πŸ“– Bookshelf

  • Personalized library for bookmarks and saved stories
  • Quick-access reading interface with story reader
  • Organize stories into custom categories
  • Track your reading history and preferences

πŸ” Browse & Discovery

  • Advanced filtering by genre, author, and popularity
  • Featured stories and trending content
  • Search functionality to find specific stories and writers
  • Category-based navigation for easy exploration

✍️ Create & Publish

  • Intuitive story editor powered by TipTap (rich text editor)
  • Multi-step story creation workflow
  • Support for story details, content editing, and publication
  • Real-time preview and formatting

πŸ‘₯ Community

  • Community feed to discover stories from other writers
  • Category-based communities for genre-specific discussions
  • Enhanced social interaction and writer collaboration
  • Community search and filtering

πŸ’¬ Comments & Engagement

  • Nested comment system for story discussions
  • Reply threads to foster conversations
  • User avatars and profile integration
  • Real-time comment notifications

πŸ‘€ User Profiles

  • Customizable user profiles with profile images
  • Author bio and story showcase
  • Lens created by the user
  • Reading statistics and engagement metrics

πŸ” Authentication

  • Google OAuth integration for seamless sign-up
  • Secure session management with Supabase
  • Auto-refresh token handling
  • Protected routes and user-specific data access

πŸ—οΈ Tech Stack

Frontend

  • Svelte 5 – Reactive UI framework with minimal JavaScript overhead
  • SvelteKit – Full-stack framework for SSR and routing
  • TypeScript – Type-safe development
  • Tailwind CSS 4 – Utility-first CSS framework
  • DaisyUI – Component library built on Tailwind

Backend & Database

  • Supabase – Open-source Firebase alternative
    • PostgreSQL database
    • Real-time subscriptions
    • Row-level security policies
  • Node.js – Server-side runtime

Libraries & Tools

  • TipTap – Headless rich text editor
  • Iconify – Icon library integration
  • svelte-french-toast – Toast notifications
  • Vite – Lightning-fast build tool
  • ESLint & Prettier – Code quality and formatting

Deployment

  • Vercel – Hosting platform with edge functions
  • Environment variables – Secure configuration management

πŸ“ Project Structure

neeva/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ components/           # Reusable Svelte components
β”‚   β”‚   β”œβ”€β”€ auth/            # Authentication components (Signin, Signup)
β”‚   β”‚   β”œβ”€β”€ bookdetail/      # Book detail view components
β”‚   β”‚   β”œβ”€β”€ Bookshelf/       # Bookshelf feature components
β”‚   β”‚   β”œβ”€β”€ browse/          # Browse & discovery components
β”‚   β”‚   β”œβ”€β”€ comment/         # Comment & discussion components
β”‚   β”‚   β”œβ”€β”€ community/       # Community components
β”‚   β”‚   β”œβ”€β”€ Create/          # Story creation components
β”‚   β”‚   β”œβ”€β”€ lens/            # Lens (story) related components
β”‚   β”‚   β”œβ”€β”€ Profile/         # User profile components
β”‚   β”‚   └── Sidebar.svelte   # Main navigation sidebar
β”‚   β”‚
β”‚   β”œβ”€β”€ lib/                  # Utility and service files
β”‚   β”‚   β”œβ”€β”€ supabase.ts      # Supabase client initialization
β”‚   β”‚   β”œβ”€β”€ database.types.ts # TypeScript database types
β”‚   β”‚   β”œβ”€β”€ appStore.ts      # Global state management
β”‚   β”‚   β”œβ”€β”€ utils.ts         # Helper utilities
β”‚   β”‚   β”œβ”€β”€ lensPriorityCalc.ts # Story ranking algorithm
β”‚   β”‚   └── compressImage.ts # Image compression utility
β”‚   β”‚
β”‚   β”œβ”€β”€ routes/              # SvelteKit routes (file-based routing)
β”‚   β”‚   β”œβ”€β”€ +layout.svelte   # Root layout
β”‚   β”‚   β”œβ”€β”€ +page.svelte     # Home page
β”‚   β”‚   β”œβ”€β”€ (dashboard)/     # Protected dashboard routes
β”‚   β”‚   β”‚   β”œβ”€β”€ bookshelf/   # Bookshelf page
β”‚   β”‚   β”‚   β”œβ”€β”€ browse/      # Browse stories page
β”‚   β”‚   β”‚   β”œβ”€β”€ community/   # Community page
β”‚   β”‚   β”‚   β”œβ”€β”€ create/      # Story creation pages
β”‚   β”‚   β”‚   β”œβ”€β”€ lens/        # Lens hub page
β”‚   β”‚   β”‚   └── profile/     # User profile page
β”‚   β”‚   └── auth/            # Authentication routes
β”‚   β”‚       β”œβ”€β”€ signin/      # Sign in page
β”‚   β”‚       β”œβ”€β”€ signup/      # Sign up page
β”‚   β”‚       β”œβ”€β”€ callback/    # OAuth callback handler
β”‚   β”‚       └── details/     # Profile details setup
β”‚   β”‚
β”‚   β”œβ”€β”€ app.css             # Global styles with Tailwind
β”‚   β”œβ”€β”€ app.html            # HTML template
β”‚   └── hooks.server.ts     # Server-side hooks (auth middleware)
β”‚
β”œβ”€β”€ static/                  # Static assets
β”œβ”€β”€ tailwind.config.js       # Tailwind configuration
β”œβ”€β”€ svelte.config.js        # Svelte configuration
β”œβ”€β”€ tsconfig.json           # TypeScript configuration
β”œβ”€β”€ vite.config.ts          # Vite configuration
└── package.json            # Project dependencies

πŸš€ Getting Started

Prerequisites

  • Node.js 18+
  • Yarn (package manager)
  • Supabase account (for database and auth)
  • Google OAuth credentials (for authentication)

Installation

  1. Clone the repository

    git clone https://github.com/yourusername/neeva.git
    cd neeva
  2. Install dependencies

    yarn install
  3. Set up environment variables Create a .env.local file in the project root:

    PUBLIC_SUPABASE_URL=your_supabase_url
    PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key
  4. Start the development server

    yarn dev

    The application will be available at http://localhost:5173

Environment Setup

Configure the following in your Supabase project:

  • Authentication: Enable Google OAuth provider
  • URL Configuration: Add callback URLs for local and production environments
  • Database: Set up required tables and row-level security policies

πŸ” Authentication Flow

Neeva implements a secure OAuth2 authentication flow with Supabase:

  1. User Initiates Login

    • User clicks "Continue with Google" on signin/signup page
    • Dynamic redirect URL based on current origin
  2. OAuth Authorization

    • Redirects to Supabase OAuth endpoint
    • User authenticates with Google
    • Supabase handles token exchange
  3. Session Callback

    • /auth/callback route exchanges auth code for session
    • Server-side session validation
    • User data loaded into global store
  4. Session Management

    • Client listens for auth state changes
    • Auto-refresh tokens enabled
    • Secure session persistence

🎨 Core Architecture

State Management

  • Global Store (appStore.ts): Centralized state for user session, UI states
  • Svelte Stores: Reactive store pattern for component-level state
  • Server-side Load Functions: Data fetching with server context

Data Flow

User Action β†’ Component β†’ Server Action β†’ Database β†’ Global Store β†’ UI Update

Security Considerations

  • Row-level security (RLS) policies in Supabase
  • Server-side session validation
  • Protected routes with authentication checks
  • Secure token handling with httpOnly cookies

πŸ“ Available Scripts

# Development
yarn dev              # Start development server with HMR
yarn check           # Run TypeScript and Svelte checks
yarn check:watch     # Run checks in watch mode

# Production
yarn build           # Build for production
yarn preview         # Preview production build locally

# Code Quality
yarn lint            # Run ESLint and Prettier checks
yarn format          # Format code with Prettier

🎯 Key Features Deep Dive

Lens Prioritization Algorithm

The platform uses a sophisticated ranking system to surface quality stories:

  • Engagement metrics (views, likes, comments)
  • Freshness of content (newer stories prioritized)
  • Author reputation and history
  • Genre-specific trending

Rich Text Editor

TipTap integration provides:

  • Formatting options (bold, italic, links, lists)
  • Markdown support
  • Real-time preview
  • Clean, accessible editor interface

Comment System

Nested comment threading enables:

  • Multi-level conversation threads
  • Author identification with avatars
  • Real-time updates (potential)
  • Reply notifications

πŸ”„ Development Workflow

Code Organization Best Practices

  • Components: Small, reusable, single responsibility
  • Stores: Centralized state management
  • Routes: Organized by feature/domain
  • Utilities: Pure functions for data transformation

Type Safety

  • Full TypeScript coverage
  • Generated database types from Supabase schema
  • Type-safe components with props validation

Testing Recommendations

  • Unit tests for utility functions
  • Component testing with Vitest
  • Integration tests for API calls
  • E2E tests with Playwright

πŸ“Š Database Schema Highlights

Key Tables

  • auth.users – User authentication (managed by Supabase)
  • UserDetails – Extended user profile information
  • Lens – Stories with metadata and content
  • Comments – Comment threads and replies
  • Likes – User engagement tracking
  • Bookshelf – Saved stories per user

🌐 Deployment

Vercel Deployment

The project is configured for Vercel with:

  • Automatic deployments from Git
  • Edge function support
  • Environment variable management
  • Preview deployments for pull requests

Build Configuration

  • Vercel adapter for SvelteKit
  • Fallback local adapter for development
  • Optimized bundle splitting

πŸŽ“ Learning Outcomes & Architecture Decisions

Why SvelteKit?

  • Reactivity: Svelte's fine-grained reactivity reduces boilerplate
  • Performance: Compiler-based approach with minimal runtime
  • DX: File-based routing and server hooks simplify development
  • Full-stack: Unified development with server and client in one codebase

Why Supabase?

  • Open-source: Community-driven with transparent development
  • PostgreSQL: Powerful, mature database with RLS
  • Real-time: Built-in real-time subscriptions
  • Developer-friendly: Excellent documentation and tooling

CSS Strategy

  • Tailwind CSS: Utility-first for consistency and rapid development
  • DaisyUI: Pre-built components reduce custom CSS
  • Dark mode: Tailwind's dark mode with DaisyUI support

πŸ“Έ Screenshots & Demo

Visit the live application: neevaverse.com

Main features showcase:

  • Lens Hub: Discover stories by genre and trending
  • Story Reader: Immersive reading experience
  • Create: Write and publish your own stories
  • Community: Engage with other writers

🀝 Contributing

Contributions are welcome! To get started:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Code Standards

  • Follow existing code style (Prettier + ESLint)
  • Write TypeScript for new features
  • Test your changes locally with yarn dev
  • Update documentation as needed

πŸ“‹ Future Roadmap

  • Advanced search and filtering
  • Reading time estimations
  • User notifications system
  • Collaborative writing features
  • Story analytics for authors
  • Content recommendations AI
  • Mobile app (React Native)
  • Real-time collaboration (WebSockets)

πŸ“„ License

This project is private. All rights reserved.


πŸ‘¨β€πŸ’» Author

Cedar – Building platforms for storytellers and writers
GitHub | Portfolio


πŸ™ Acknowledgments

  • Supabase for the excellent backend-as-a-service platform
  • Svelte and SvelteKit communities for amazing frameworks
  • Tailwind CSS and DaisyUI for beautiful UI components
  • All contributors and community members supporting the project

πŸ“ž Support

For questions or issues:

  • Open an issue on GitHub
  • Check existing documentation
  • Review the Supabase documentation for backend questions

Happy writing! πŸ“βœ¨

About

Web platform for writing and sharing short stories

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages