Karmalyze is an interactive platform that evaluates user-provided actions and generates a "karma score" based on their ethical impact. By using OpenAI and Firebase, Karmalyze provides users with insightful feedback on the morality of their actions, helping them reflect on their decisions.
- User Authentication: Uses Firebase for secure Google sign-in to manage user sessions and data.
- Action Evaluation: Calls OpenAI's API to assess user actions and generate a karma score ranging from -1000 to +1000, accompanied by an explanatory comment.
- Dynamic Data Updates: Real-time updates to the karma score and action history using Firebase Firestore.
- Responsive Design: Adapts to different screen sizes for seamless user experiences across devices.
- Media Integration: Engages users with loading animations, sound effects, and a visually appealing interface.
- The main component that handles:
- User authentication state.
- Fetching and displaying user data (e.g., karma history and totals).
- Handling user inputs and interfacing with OpenAI API.
- Managing loading states and audio feedback.
- Includes
SignInandSignOutcomponents for managing user authentication with Firebase.
- Contains the
callChatGPTfunction:- Interfaces with OpenAI's API to evaluate user actions and return a comment and karma score.
- Saves the response to Firebase Firestore if valid.
- Implements the
fetchDatafunction to retrieve user data from Firebase Firestore.
- The input component where users can submit actions for evaluation.
- Defines the styling and responsive behavior of the application, including:
- A clean layout with intuitive navigation.
- Animation for the rotating loading image.
- Styling adjustments for different screen sizes using media queries.
loading.png: The rotating image displayed while the evaluation is in progress.loading-sound.mp3: The sound played when a user submits an action.