Pebble is a generative AI service that automatically creates a personalized diary of your studies, based on your Chrome search history. This project leverages Express for the backend, React for the frontend, and JavaScript to seamlessly integrate a Chrome extension that captures browsing data. Using AI, Pebble generates meaningful summaries, images, and entries for each day, giving you a reflective diary about your learning journey.
-
Backend: Express, Node.js, MySQL, AWS
-
Frontend: React
-
Chrome Extension: JavaScript, Chrome Storage API
-
Generative AI: OpenAI API (GPT-4, DALL-E 3)
Pebble
├─ Pebble.chrome_extension
│ └─ chrome_extension
├─ Pebble.server
│ ├─ config
│ ├─ controllers
│ └─ routes
└─ Pebble.web
├─ public
└─ src
└─ Pages
-
Pebble.chrome_extension: Contains the Chrome extension code for capturing browsing history.
-
Pebble.server: Backend Express server for handling diary entries, APIs, and database operations.
-
config: Configuration files, including environment variables and database connection.
-
controllers: Handles business logic for diary operations.
-
routes: Defines API endpoints for generating and retrieving diary entries.
-
-
Pebble.web: React frontend for viewing diary entries.
-
public: Static assets.
-
src/Pages: React components for rendering calendar and diary pages.
-
-
Chrome Extension: Collects search history, specifically Stack Overflow URLs.
-
Backend API: Generates diary entries from your browsing history and provides RESTful APIs for data retrieval. Uses OpenAI API to generate titles, summaries, and visual content for diary entries.
-
Frontend Interface: Allows users to view and interact with diary entries on a calendar.
-
Node.jsandnpminstalled -
MySQLdatabase setup -
Chrome Browserfor extension use
- Clone the repository:
git clone https://github.com/SeungjaeLim/pebble.git
cd pebble/Pebble.server
- Install dependencies:
npm install
- Set up environment variables:
- Create a
.envfile in the project root directory with the following content:OPENAI_API_KEY=your_openai_api_key MYSQL_HOST=localhost MYSQL_USER=your_mysql_user MYSQL_PASSWORD=your_mysql_password MYSQL_DATABASE=your_database_name - Set up MySQL database:
CREATE TABLE IF NOT EXISTS diary ( id INT AUTO_INCREMENT PRIMARY KEY, user_id VARCHAR(255), date DATE, picture TEXT, title VARCHAR(255), post TEXT, parsed_post TEXT, url TEXT, UNIQUE INDEX idx_user_url (user_id, url) );
- Run the server:
npm run start
Server will run on http://localhost:8000.
- Navigate to the frontend directory:
cd ../Pebble.web
- Install dependencies:
npm install
- Run the frontend:
npm start
The frontend will run on http://localhost:3000.
-
Navigate to
Pebble.chrome_extension/chrome_extension. -
Open Chrome and go to
chrome://extensions/. -
Enable
Developer modeand clickLoad unpacked. -
Select the
chrome_extensionfolder to load the extension.
-
Collect Browsing History: Use the Chrome extension to capture search history when visiting Stack Overflow.
-
Generate Diary: The backend will use the collected URLs to generate diary entries, leveraging OpenAI to create titles, summaries, and images.
-
View Diary: Use the React frontend to view your generated diary entries. Navigate through the calendar to select specific days.
Swagger documentation is available at http://localhost:8000/api-docs after running the backend server. It provides detailed information on the following endpoints:
Generates diary entries based on provided Stack Overflow URLs for a specific user.
- Request Body:
{ "userid": "string", "history": [ { "date": "YYYY-MM-DD", "url": "https://stackoverflow.com/questions/sample-question" } ] } - Response:
201 Created: Diary entries generated successfully.500 Internal Server Error: Failed to generate diary entries.
Retrieves diary entries for a specified user, grouped by date.
-
Path Parameters:
userId (string): ID of the user to retrieve diary entries for.
-
Response:
200 OK: Returns user-specific diary entries grouped by date.500 Internal Server Error: Database query error.
-
Fork the repository.
-
Create your feature branch (
git checkout -b feature/AmazingFeature). -
Commit your changes (
git commit -m 'Add some AmazingFeature'). -
Push to the branch (
git push origin feature/AmazingFeature). -
Open a pull request.
Distributed under the MIT License. See LICENSE for more information.



