Strema Content Tool is a Chrome extension built using React.js and Vite. It enables [briefly describe what the extension does, e.g., enhancing content interaction, managing content on web pages, etc.].
Follow these steps to set up the project locally for development and production.
Clone the repository to your local machine:
git clone https://github.com/sourav-backend-dev/Streema-Tool.git
cd Streema-Tool
To install all necessary dependencies for the project, run the following command:
npm install
The project uses a backend API for certain features. To install dependencies for the API, navigate to the Test-api
directory and install them:
cd Test-api
npm install
cd ..
To start the development environment with both the API and client running concurrently, use the following command:
npm run dev
This command will:
- Start the backend API (
server.js
) usingnpm run start-api
. - Launch the frontend client using Vite (
npm run start-client
).
Both the client and the API will be running locally for development.
To build the client for production, run the following command:
npm run build
This will generate the production-ready files in the dist
folder.
Once you have the production build in the dist
folder, you can upload it to Chrome as an unpacked extension.
- Open Chrome and go to the Extensions page:
chrome://extensions/
. - Enable Developer mode in the top right corner.
- Click the Load unpacked button.
- Select the
dist
folder from your project directory. - Your Chrome extension will now be installed and available for use.
-
To lint your code and check for any issues, use:
npm run lint
-
To preview the production build after running
npm run build
, use the following command:npm run preview
This command will start a local server to preview the built client.
The extension is configured with manifest_version
3, and the following key attributes are defined in the manifest.json
:
- Name:
React Chrome Extension
- Version:
1.0.0
- Description:
A Chrome extension built using React.js and Vite.
- Permissions: Includes permissions for
storage
,activeTab
,scripting
,sidePanel
, andtabs
. - Host Permissions: Allows access to all URLs (
https://*/*
). - Side Panel: The extension uses the side panel feature, with
index.html
as the default path. - Background: The background script is handled by
assets/background.js
using a service worker. - Content Scripts: The content script is injected into pages matching
https://*/*
and includesassets/contentScript.js
. - Icons: The extension uses
logo.png
as the icon at64x64
pixels.
Here are the available scripts in the project:
install-all
: Installs all dependencies for both the client and the Test API.start-api
: Starts the Test API by runningserver.js
.start-client
: Starts the client using Vite.start
: Runs both the API and the client concurrently.dev
: Starts the development environment (both API and client).build
: Builds the client for production using Vite.lint
: Lints the project using ESLint.preview
: Previews the built production version of the client.