Prerequisites
Before you begin, ensure you have the following installed:- Node.js (v18 or higher)
- npm (comes with Node.js)
- Git
- Chrome browser (for testing the extension)
Clone the Repository
Building the Project
Option 1: Build Everything (Recommended)
The easiest way to build the entire project is using the automated build script:The
build-all.sh script automatically:- Builds the Next.js dashboard
- Extracts inline scripts for CSP compliance
- Copies dashboard assets to the extension
- Installs extension dependencies
- Builds the Chrome extension with Webpack
chrome-extension/dist/
Option 2: Build Components Separately
If you need to build components individually:Development Setup
Dashboard Development
For local dashboard development with hot reload:Set up environment variables
Copy the example environment file and configure:Edit
.env with your local settings:Extension Development
For Chrome extension development:Loading the Extension in Chrome
Once you’ve built the extension, load it into Chrome for testing:If you’re running in watch mode (
npm run watch), the extension will automatically rebuild when you make changes. You’ll need to click the refresh icon on the extension card in chrome://extensions/ to reload it.Project Structure
Build Scripts Explained
Dashboard Scripts
npm run dev- Start development server with hot reloadnpm run build- Create production build with Next.jsnpm run lint- Run Biome linternpm run format- Format code with Biomenpm run check- Run linting and formatting checksnpm run check:fix- Auto-fix linting and formatting issues
Extension Scripts
npm run build- Build extension with Webpack (production mode)npm run watch- Watch mode for development with auto-rebuild
Troubleshooting
Build Failures
Extension Not Loading
If the extension doesn’t load in Chrome:- Verify the build completed successfully
- Check that
chrome-extension/dist/contains all required files - Look for errors in
chrome://extensions/(enable Developer mode) - Check the Chrome DevTools console for runtime errors
Dashboard Build Issues
If the dashboard fails to build:Missing Dependencies
If you encounter module not found errors:Next Steps
Contributing
Learn how to contribute to ContextFort
Architecture
Understand the system architecture