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.
- 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.
- Frontend & Backend: Next.js
- Database: MongoDB
- Authentication:
auth.js
- UI: Fully custom implementation
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"
Follow these steps to set up the application on your local machine:
-
Clone the Repository:
git clone <repository-url> cd <repository-folder>
-
Install Dependencies:
npm install
-
Configure Environment Variables:
- Create a
.env
file in the root of your project. - Add the required environment variables as specified above.
- Create a
-
Run the Application:
npm run dev
-
Access the Application:
- Open your browser and navigate to
http://localhost:3000
.
- Open your browser and navigate to
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
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
-
Sign In with Google:
- Click the "Sign In" button and log in using your Google account.
-
Create a Prompt:
- After signing in, click "New Prompt," enter the details, and save.
-
Edit or Delete Prompts:
- Manage your prompts directly from the interface.
-
View Public Prompts:
- Browse all prompts and associated user details, even without signing in.
- 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!