Skip to content

Keamo0713/Whisper

Repository files navigation

✨ Whisper: Anonymous Confessions with AI Advice ✨

[https://whisper-hsgq.onrender.com]

📝 Table of Contents About Whisper 🤫

Features 🌟

Technologies Used 🛠️

Setup and Installation 🚀

Prerequisites ✅

Project Setup 🏗️

API Key Configuration 🔑

Running the Application ▶️

Usage 💡

Project Structure 📁

Future Enhancements 💡

License 📄

🤫 About Whisper Whisper is a serene and secure web application designed to provide a safe, anonymous space for individuals to share their deepest confessions. Upon submission, our intelligent AI assistant steps in to offer empathetic and concise advice. Users then have the heartfelt choice to anonymously publish their confession and the accompanying AI guidance to a public feed, fostering a unique sense of shared experience and understanding within the community.

The application boasts a sleek, professional design, embracing a dark, immersive theme with transparent elements and subtle white outlines, creating a truly polished and inviting user interface.

🌟 Features Anonymous Confession Submission: Share your thoughts freely, knowing your identity remains private. 👤

AI-Powered Advice: Receive insightful and compassionate advice generated by the cutting-edge Google Gemini API. 🔮

Anonymous Publishing: Decide whether to share your confession and its advice with the wider community, completely anonymously. 🕊️

Public Confession Feed: Browse a curated collection of anonymously published confessions and their comforting advice. 📖

Professional UI: Experience a clean, modern, and immersive design with a dark aesthetic, crisp white outlines, and subtle, elegant animations. ✨

🛠️ Technologies Used Backend: ASP.NET Core MVC (C#) 🚀

Frontend: Razor Pages, HTML, Tailwind CSS (via CDN) 🎨

AI Integration: Google Gemini API (gemini-2.0-flash) 🧠

Package Management: NuGet 📦

🚀 Setup and Installation ✅ Prerequisites Before embarking on this journey, please ensure you have the following essentials installed on your machine:

.NET SDK 9.0 or a later version. 💻

A reliable code editor (e.g., Visual Studio Code, Visual Studio). ✍️

Access to the Google Gemini API and your personal API Key. 🔑

🏗️ Project Setup Follow these straightforward command-line steps in your terminal:

Create the ASP.NET Core MVC project:

dotnet new mvc -n Whisper

Navigate into your new project directory:

cd Whisper

Create the essential folders and files:

mkdir Models type nul > Models\Confession.cs # For Windows

touch Models/Confession.cs # For macOS/Linux

mkdir Services type nul > Services\GeminiApiService.cs # For Windows

touch Services/GeminiApiService.cs # For macOS/Linux

mkdir Views\Confession type nul > Views\Confession\Create.cshtml # For Windows

touch Views/Confession/Create.cshtml # For macOS/Linux

type nul > Views\Confession\Advice.cshtml # For Windows

touch Views/Confession/Advice.cshtml # For macOS/Linux

type nul > Views\Confession\Index.cshtml # For Windows

touch Views/Confession/Index.cshtml # For macOS/Linux

Add the necessary NuGet packages:

dotnet add package Microsoft.Extensions.Http dotnet add package Microsoft.Extensions.Configuration.Abstractions dotnet add package System.Text.Json

Optionally, remove the default Home controller and its views for a cleaner project structure:

del Controllers\HomeController.cs # For Windows

rm Controllers/HomeController.cs # For macOS/Linux

rmdir /s /q Views\Home # For Windows

rm -rf Views/Home # For macOS/Linux

🔑 API Key Configuration Open the appsettings.json file, located at the root of your Whisper project.

Kindly add a Gemini section and insert your precious API Key:

{ "Logging": { "LogLevel": { "Default": "Information", "Microsoft.AspNetCore": "Warning" } }, "AllowedHosts": "*", "Gemini": { "ApiKey": "YOUR_GOOGLE_GEMINI_API_KEY" # ✨ Replace this with your actual API key! ✨ } }

Update Project Files Please replace the content of the following files with the most recent code provided in our previous interactions (it's essential to use the latest versions, especially after all the styling and API changes):

Models/Confession.cs

Services/GeminiApiService.cs

Controllers/ConfessionController.cs

Views/Confession/Create.cshtml

Views/Confession/Advice.cshtml

Views/Confession/Index.cshtml

Views/Shared/_Layout.cshtml

Program.cs

💡 Crucial Tip for _Layout.cshtml: Remember to ensure the @keyframes rule within the <style> block is correctly escaped using Html.Raw() as demonstrated in the final _Layout.cshtml code provided previously, to gracefully handle Razor parsing.

▶️ Running the Application Halt any previously running instances of the application. If you encounter stubborn file lock errors (Access to the path ... is denied), please use your system's Task Manager (Windows) or Activity Monitor (macOS) to diligently terminate any dotnet.exe or Whisper.exe processes. A quick taskkill /IM Whisper.exe /F in a new terminal window can also work wonders!

Perform a thorough clean of your project (this is vital after any file modifications):

dotnet clean

Build the project to ensure everything is in order:

dotnet build

Should you encounter "Out of memory" or "paging file too small" errors, a gentle reminder: you might need to expand your system's virtual memory (paging file size) and perform a quick computer restart. 🔄

Finally, launch your application:

dotnet run

Open your favorite web browser and gracefully navigate to the URL displayed in your console (e.g., http://localhost:5204/). Enjoy your Whisper experience! 🌐

💡 Usage Confess: On the main page, pour your heart out into the spacious text area and click "Whisper" to receive a thoughtful piece of AI-generated advice. ✍️

Publish: After soaking in the wisdom, you'll be presented with the option to "Publish Anonymously" – a chance to share your confession and its advice with the world, completely incognito. 🌍

View Confessions: A simple click on "Anonymous Confessions" in the navigation bar will transport you to a beautifully presented list of all publicly shared confessions, a testament to shared human experience. 📖

📁 Project Structure Whisper/ ├── Controllers/ │ └── ConfessionController.cs # Manages confession logic 🧠 ├── Models/ │ └── Confession.cs # Defines the confession data structure 📋 ├── Services/ │ └── GeminiApiService.cs # Handles AI (Gemini API) interactions 🤖 ├── Views/ │ ├── Confession/ # Views specific to confessions │ │ ├── Advice.cshtml # Displays confession and AI advice 💬 │ │ ├── Create.cshtml # Form for new confessions 📝 │ │ └── Index.cshtml # Lists anonymous confessions 📜 │ └── Shared/ │ └── _Layout.cshtml # The main layout for the application 🎨 ├── appsettings.json # Application configuration (including API keys) ⚙️ ├── appsettings.Development.json # Development-specific configurations 🛠️ ├── Program.cs # Application startup and service configuration 🚀 └── Whisper.csproj # Project file defining dependencies and build settings 📦

💡 Future Enhancements We envision many exciting possibilities for Whisper:

Database Persistence: Transition from in-memory storage to a robust database solution (e.g., SQL Server, SQLite) using Entity Framework Core for lasting confessions. 💾

User Authentication: Introduce optional user accounts for personalized confession management, if desired (while maintaining the core anonymous sharing). 🔐

Content Moderation: Implement features for responsible moderation of published confessions to ensure a safe community. 🛡️

Advanced AI Features: Delve deeper into the Gemini API for richer functionalities like sentiment analysis, diverse advice styles, or conversational follow-ups. 🗣️

Search & Filter: Empower users to easily search or filter the anonymous confessions by keywords or themes. 🔍

Enhanced Responsiveness: Further optimize the user interface for a flawless experience across all devices and screen sizes. 📱💻

image one image 3 image 2

About

This is a web Application where users are able to confess anonymously, and AI responds with advice

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors