Skip to content

GPT-Prompt is a modern web application for saving, managing, and sharing high-quality AI prompts. Built with Next.js, NextAuth, and MongoDB, it allows users to browse community prompts publicly and manage their own prompts after authenticating with Google.

Notifications You must be signed in to change notification settings

developerEhsan/gpt-prompt

Repository files navigation

Promptly: Social Prompts Management Application

A Next.js application for managing and sharing prompts. Users can sign in via Google, create, edit, and delete their prompts. All prompts are public, enabling both authenticated and non-authenticated users to view them and their associated user details.


Table of Contents


Features

  • Google Authentication: Users can sign in using Google.
  • Prompt Management: Create, edit, and delete prompts.
  • Public Access: All prompts and user details are visible to everyone, including non-authenticated users.
  • Secure User Authentication: Managed using auth.js.
  • Custom UI: A unique user interface built without third-party libraries.

Tech Stack

  • Frontend & Backend: Next.js
  • Database: MongoDB
  • Authentication: auth.js
  • UI: Fully custom implementation

Environment Variables

To run this application, configure the following environment variables in a .env file at the root of your project:

GOOGLE_CLIENT_ID="<your-google-client-id>"
GOOGLE_CLIENT_SECRET="<your-google-client-secret>"
MONGODB_URI="mongodb://localhost:27017"

Setup Locally

Follow these steps to set up the application on your local machine:

  1. Clone the Repository:

    git clone <repository-url>
    cd <repository-folder>
  2. Install Dependencies:

    npm install
  3. Configure Environment Variables:

    • Create a .env file in the root of your project.
    • Add the required environment variables as specified above.
  4. Run the Application:

    npm run dev
  5. Access the Application:

    • Open your browser and navigate to http://localhost:3000.

Setup mongo locally using Docker

docker run -d -p 27017:27017 --name=mongo-gpt-prompt mongo:latest

Then on the .env file you can use this as your mongoDB URI mongodb://localhost:27017


How to get Client ID and client secret

Well to get client id and client secret you need to go to console.cloud.google select any of your project then go to the clients section from the sidebar here you can see your project's client Id and client secret these keys will be used to authenticate using google account.

So, That's will be good if you keep it secret


Usage

  1. Sign In with Google:

    • Click the "Sign In" button and log in using your Google account.
  2. Create a Prompt:

    • After signing in, click "New Prompt," enter the details, and save.
  3. Edit or Delete Prompts:

    • Manage your prompts directly from the interface.
  4. View Public Prompts:

    • Browse all prompts and associated user details, even without signing in.

Additional Notes

  • Ensure MongoDB is running locally or update the MONGODB_URI in the .env file for remote usage.
  • Use a valid Google Client ID and Secret for authentication to function.
  • The application is built without any third-party UI libraries, ensuring complete customization.

Happy coding!

About

GPT-Prompt is a modern web application for saving, managing, and sharing high-quality AI prompts. Built with Next.js, NextAuth, and MongoDB, it allows users to browse community prompts publicly and manage their own prompts after authenticating with Google.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published