Skip to content

NotYash1066/StoryMate

Repository files navigation

StoryMate - AI-Powered Story Creation Platform

.NET Core AI Powered

StoryMate is a comprehensive web application that leverages artificial intelligence to help users create, manage, and share stories. Built with ASP.NET Core 3.1 and integrated with Google's Gemini API, it provides an intuitive platform for both manual story creation and AI-powered story generation.

🌟 Features

  • πŸ€– AI-Powered Story Generation - Create stories using Google's Gemini 2.5 Pro model
  • πŸ“š Personal Story Library - Manage and organize your stories in a personal collection
  • 🎭 Multiple Genres - Support for Fantasy, Sci-Fi, Mystery, Horror, Romance, and more
  • πŸ” Secure Authentication - User registration and login with ASP.NET Core Identity
  • πŸ‘₯ Admin Dashboard - Comprehensive platform management and user oversight
  • πŸ“± Responsive Design - Modern, mobile-friendly interface built with Bootstrap 4
  • ✍️ Dual Creation Modes - Manual story creation or AI-assisted generation
  • 🎨 Custom Covers - Add cover images to your stories
  • πŸ”’ Privacy Controls - Public/private story visibility settings

πŸ—οΈ Architecture

Technology Stack

  • Backend: ASP.NET Core 3.1 MVC
  • Database: SQLite with Entity Framework Core
  • Authentication: ASP.NET Core Identity
  • AI Service: Google Gemini API (Gemini 2.5 Pro)
  • Frontend: Bootstrap 4, jQuery, Font Awesome
  • UI Framework: Razor Pages with MVC pattern

Project Structure

StoryMate/
β”œβ”€β”€ StoryMate/                 # Main application
β”‚   β”œβ”€β”€ Controllers/           # MVC Controllers
β”‚   β”œβ”€β”€ Data/                  # Database context and models
β”‚   β”œβ”€β”€ Models/                # Domain models
β”‚   β”œβ”€β”€ Services/              # Business logic services
β”‚   β”œβ”€β”€ Views/                 # Razor views
β”‚   └── wwwroot/               # Static files
β”œβ”€β”€ StoryMate.Admin/           # Admin application
β”‚   β”œβ”€β”€ Controllers/           # Admin controllers
β”‚   β”œβ”€β”€ Models/                # Admin view models
β”‚   └── Views/                 # Admin views
└── StoryMate.Shared/          # Shared library

πŸš€ Quick Start

Prerequisites

Installation

  1. Clone the repository

    git clone https://github.com/NotYash1066/StoryMate.git
    cd StoryMate
  2. Restore dependencies

    dotnet restore
  3. Configure the database

    cd StoryMate
    dotnet ef database update
  4. Set up your Gemini API key

    Option A: User Secrets (Recommended for development)

    cd StoryMate
    dotnet user-secrets set "GeminiApiKey" "your-actual-gemini-api-key-here"

    Option B: appsettings.json

    {
    	"GeminiApiKey": "your-actual-gemini-api-key-here"
    }
  5. Run the application

    dotnet run
  6. Access the application

    • Main Application: https://localhost:5001
    • Admin Application: https://localhost:5002 (if running separately)

πŸ”§ Configuration

Database Setup

The application uses SQLite for data storage. The database will be automatically created on first run with the following seeded data:

  • 9 Predefined Genres: Fantasy, Sci-Fi, Mystery, Horror, Romance, Adventure, Drama, Thriller, Comedy
  • Sample Data: No sample stories are created by default

Environment Configuration

Development (appsettings.Development.json)

{
	"ConnectionStrings": {
		"DefaultConnection": "Data Source=storymate.db"
	},
	"Logging": {
		"LogLevel": {
			"Default": "Information",
			"Microsoft": "Warning",
			"Microsoft.Hosting.Lifetime": "Information"
		}
	}
}

Production (appsettings.json)

{
	"ConnectionStrings": {
		"DefaultConnection": "Data Source=storymate.db"
	},
	"GeminiApiKey": "your-production-api-key"
}

πŸ“– Usage Guide

For End Users

1. Getting Started

  1. Register an Account: Click "Get Started Free" on the landing page
  2. Login: Use your credentials to access your personal dashboard
  3. Create Your First Story: Click "Create New Story" to start writing

2. Creating Stories

Manual Creation:

  1. Navigate to "Create New Story"
  2. Fill in the story details (title, genre, content)
  3. Optionally add a cover image URL
  4. Set privacy preferences
  5. Click "Save Story"

AI-Powered Creation:

  1. Go to "Create New Story"
  2. In the AI Story Generator section, enter a creative prompt
  3. Select a genre (optional)
  4. Choose between:
    • Generate Story: Creates content for you to review and edit
    • Generate & Save Story: Automatically creates and saves the story

3. Managing Your Library

  • View Stories: Access your personal story library
  • Edit Stories: Click "Edit" on any story to modify it
  • Delete Stories: Remove stories you no longer need
  • Read Stories: Click "Read" to view the full story

For Administrators

1. Admin Dashboard

  • Statistics Overview: View total stories, users, and content distribution
  • Recent Activity: Monitor latest stories and user registrations
  • Quick Navigation: Access management sections

2. Story Management

  • View All Stories: Complete inventory of platform stories
  • Toggle Visibility: Switch stories between public/private
  • Delete Stories: Remove inappropriate or unwanted content
  • Author Tracking: Monitor story ownership and creation

3. User Management

  • User Overview: Complete list of registered users
  • Story Statistics: Track user activity and story creation
  • Account Information: Monitor user details and engagement

πŸ” Security Features

  • Authentication: Secure user registration and login
  • Authorization: Role-based access control
  • CSRF Protection: Anti-forgery tokens on all forms
  • Input Validation: Comprehensive data validation
  • SQL Injection Prevention: Entity Framework parameterized queries
  • XSS Protection: Razor view encoding
  • Security Headers: Production-ready security configurations

πŸ› οΈ Development

Running in Development Mode

  1. Main Application

    cd StoryMate
    dotnet run
  2. Admin Application (separate instance)

    cd StoryMate.Admin
    dotnet run

Database Migrations

# Add a new migration
dotnet ef migrations add MigrationName

# Update the database
dotnet ef database update

# Remove the last migration
dotnet ef migrations remove

πŸ“ API Endpoints

Main Application

Method Endpoint Description
GET / Landing page
GET /Stories User's story library
GET /Stories/Create Story creation form
POST /Stories/Create Create new story
GET /Stories/Details/{id} View specific story
GET /Stories/Edit/{id} Edit story form
POST /Stories/Edit/{id} Update story
POST /Stories/GenerateAIStory AI story generation (AJAX)
POST /Stories/GenerateAndSaveStory AI generation with save (AJAX)

Admin Application

Method Endpoint Description
GET /Admin Admin dashboard
GET /Admin/Stories Story management
GET /Admin/Users User management
POST /Admin/ToggleStoryVisibility Toggle story visibility (AJAX)
POST /Admin/DeleteStory Delete story (AJAX)

πŸ‘₯ Team & Contributions

This project was developed by a team of three dedicated developers as part of the Computer Engineering program.

Development Team

Developer Roll Number Role Key Contributions
Yash Karthiya CE030 Admin & Platform Management Lead Admin dashboard, user statistics, story visibility management, platform analytics
Akshat Dhanak CE074 Authentication & Security Lead User authentication system, login/registration core, ASP.NET Identity integration
Kalpesh Gangani CE028 AI & Story Management Lead AI story generation logic, Gemini API integration, story management features

Individual Contributions

πŸ”§ Yash Karthiya (CE030)

Admin Side & Platform Management

  • βš™οΈ Designed and implemented complete admin dashboard
  • πŸ“Š Developed user statistics and analytics features
  • πŸ‘οΈ Created story visibility management system (public/private toggle)
  • πŸ—‚οΈ Built admin story management interface
  • πŸ“ˆ Implemented platform-wide analytics and monitoring
  • 🎨 Designed admin UI/UX with Bootstrap 4

πŸ” Akshat Dhanak (CE074)

Authentication & Security

  • πŸ”’ Implemented ASP.NET Core Identity authentication system
  • πŸ‘€ Developed user registration and login functionality
  • πŸ”‘ Integrated secure password hashing and validation
  • πŸ›‘οΈ Set up authorization and role-based access control
  • πŸ“ Created user session management
  • πŸ” Implemented security features (CSRF protection, XSS prevention)

πŸ€– Kalpesh Gangani (CE028)

AI Integration & Story Management

  • 🧠 Integrated Google Gemini 2.5 Pro API for AI story generation
  • ✍️ Developed core story generation logic and algorithms
  • πŸ“š Built story management features (create, edit, delete, read)
  • 🎭 Implemented genre-based story categorization
  • πŸ’Ύ Designed story database schema and models
  • πŸ”„ Created AI prompt processing and response handling

Collaborative Efforts

All team members collaborated on:

  • πŸ—οΈ Overall application architecture and design
  • πŸ—„οΈ Database design and Entity Framework Core setup
  • 🎨 UI/UX consistency and responsive design
  • πŸ§ͺ Testing and debugging
  • πŸ“– Documentation and README preparation
  • πŸš€ Deployment configuration and setup

πŸ™ Acknowledgments


Made with ❀️ by the StoryMate Team

Transform your ideas into captivating stories with the power of AI!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors