Skip to content

TrueFeedback is a Next.js application designed βœ’οΈ to facilitate anonymous messaging between users. It incorporates the OpenAI ChatGPT API to generate random prompts, encouraging interaction. With separate interfaces for sending and receiving messages πŸ“© and secure authentication via NextAuth πŸ”’, TrueFeedback ensures a user-friendly and confidential

License

Notifications You must be signed in to change notification settings

Prabal-verma/realfeedback

Repository files navigation

TrueFeedback

TrueFeedback is a Next.js application built with TypeScript that allows users to send and receive anonymous messages. It also leverages the OpenAI ChatGPT API to generate random questions or prompts to encourage interaction. The application features two main interfaces: one for viewing received messages and another for sending anonymous messages. Authentication is implemented using NextAuth.

UI DEMO

HOME PAGE

image

DASHBOARD PAGE

image

PUBLIC PAGE

image

Table of Contents

Features

  • Anonymous Messaging: Users can send and receive anonymous messages.
  • ChatGPT Integration: Generates random prompts or questions using the OpenAI API.
  • Authentication: Secure user authentication with NextAuth.
  • User Interfaces: Separate interfaces for sending and receiving messages.
  • Responsive Design: Optimized for both desktop and mobile devices.

Tech Stack

  • Frontend: Next.js, TypeScript
  • Authentication: NextAuth.js
  • API: OpenAI ChatGPT API
  • Styling: CSS Modules / Styled Components / Tailwind CSS (choose your preferred method)
  • Database: (e.g., MongoDB, PostgreSQL - specify based on your setup)

Getting Started

Prerequisites

Before you begin, ensure you have the following installed:

  • Node.js (>= 14.x)
  • npm or yarn
  • A MongoDB or PostgreSQL database instance (if using a database)
  • An OpenAI API key

Installation

  1. Clone the repository:

    git clone https://github.com/prabal-verma/truefeedback.git
    cd truefeedback
  2. Install dependencies:

npm install
# or
yarn install
  1. Running the Application

Create a .env.local file in the root directory and add the following environment variables:

NEXTAUTH_URL=http://localhost:3000
NEXTAUTH_SECRET=your_nextauth_secret
OPENAI_API_KEY=your_openai_api_key
DATABASE_URL=your_database_url
  1. Running the Development Server

Run the development server:

npm run dev
# or
yarn dev

Configuration

  • NextAuth: Configure providers, callbacks, and other options in pages/api/auth/[...nextauth].ts.
  • OpenAI API: Use the OpenAI API key in your server-side logic to generate random messages.

Project Structure

truefeedback/
β”œβ”€β”€ components/
β”‚ β”œβ”€β”€ MessageList.tsx
β”‚ β”œβ”€β”€ SendMessageForm.tsx
β”‚ └── ...
β”œβ”€β”€ pages/
β”‚ β”œβ”€β”€ api/
β”‚ β”‚ β”œβ”€β”€ auth/
β”‚ β”‚ β”‚ └── [...nextauth].ts
β”‚ β”‚ β”œβ”€β”€ messages.ts
β”‚ β”‚ └── ...
β”‚ β”œβ”€β”€ index.tsx
β”‚ β”œβ”€β”€ send.tsx
β”‚ └── ...
β”œβ”€β”€ public/
β”‚ └── ...
β”œβ”€β”€ styles/
β”‚ β”œβ”€β”€ globals.css
β”‚ └── ...
β”œβ”€β”€ utils/
β”‚ β”œβ”€β”€ openai.ts
β”‚ └── ...
β”œβ”€β”€ .env.local
β”œβ”€β”€ next.config.js
β”œβ”€β”€ package.json
└── README.md

API Endpoints

  • GET /api/messages: Fetch received messages for the authenticated user.
  • POST /api/messages: Send a new anonymous message.
  • GET /api/generate-prompt: Generate a random prompt using ChatGPT.

Contributing

We welcome contributions! Please follow these steps to contribute:

  1. Fork the repository.
  2. Create a new branch for your feature or bugfix.
  3. Commit your changes with clear messages.
  4. Push your changes to your fork.
  5. Create a pull request to the main branch of the original repository.

License

This project is licensed under the MIT License. See the LICENSE file for details.

About

TrueFeedback is a Next.js application designed βœ’οΈ to facilitate anonymous messaging between users. It incorporates the OpenAI ChatGPT API to generate random prompts, encouraging interaction. With separate interfaces for sending and receiving messages πŸ“© and secure authentication via NextAuth πŸ”’, TrueFeedback ensures a user-friendly and confidential

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published