ResumoGPT is a Chrome extension that uses OpenAI's GPT API to summarize selected text. Right click a selection and choose Resumir seleção via GPT, then open the popup to read the summary.
This project requires Node.js 18. Use nvm or a similar tool to ensure this version is installed and active when working on the codebase.
- Navigate to the
frontenddirectory and runnpm installto install dependencies. - Execute
npm run devinsidefrontendto start Vite in watch mode. - Open
chrome://extensions, enable Developer mode and choose Load unpacked. - Select the
frontend/builddirectory to load the extension. - When prompted, provide your OpenAI API token in the popup.
To create a production build with Vite run:
cd frontend
npm run buildThe bundled files will be output to the frontend/build folder.
frontend/
└── src/
├── popup/ # extension popup UI
├── dashboard/ # dashboard page
└── background/ # background script
server/
└── src/ # Express API
A simple Express API with PostgreSQL is provided in the server/ directory. Use docker-compose to start both the database and the API:
docker-compose up --buildEnvironment variables can be configured by copying server/.env.example to server/.env and adjusting the values.
When running the backend locally without Docker you must compile the TypeScript source first:
cd server
npm install
npm run build
npm startThe Docker image performs these steps automatically during docker-compose up.
The API exposes the following endpoints:
POST /register– create a new user with hashed password.POST /login– authenticate and receive a JWT token.GET /me– return the authenticated user (requiresAuthorization: Bearer <token>header).
Sequelize manages the PostgreSQL schema and creates the required tables when the server starts. The server waits for this initialization to finish before it begins accepting requests.
To attach a debugger to the Node.js process in the api container, expose the
inspection port and run the server with the debug script.
-
Update
docker-compose.ymlto map port9229and run the debug command. Theapiservice should look like:api: build: ./server restart: always command: npm run debug ports: - "3000:3000" - "9229:9229"
-
Start the containers:
docker-compose up --build
-
Attach your debugger (e.g. Chrome DevTools or VS Code) to
localhost:9229and set breakpoints normally.
The backend runs Sequelize migrations automatically at startup using Umzug. The Umzug instance passes sequelize.getQueryInterface() as the context so each migration receives the QueryInterface via destructuring:
module.exports = {
up: async ({ context: queryInterface }) => {
// migration logic
},
down: async ({ context: queryInterface }) => {
// rollback logic
}
}This differs from the sequelize-cli format which passes (queryInterface, Sequelize) as separate parameters. When executed programmatically via Umzug (v3 or higher) you must use the context object.
To apply migrations on startup set APPLY_MIGRATIONS=true in server/.env.