This app is a Module Federation remote built with Next.js.
It exposes the DashboardShell module for host applications.
Install dependencies:
npm installThis app installs @dasjideepak/* packages from GitHub Packages and requires auth.
Create a Personal Access Token (classic):
- GitHub ->
Settings->Developer settings->Personal access tokens->Tokens (classic) - Click
Generate new token (classic) - Select scopes:
read:packages(required to install private packages)repo(required when package/repository is private)write:packages(only needed for publishing)
- Copy and store the token securely.
This repo expects:
GITHUB_PACKAGES_TOKEN
This app's .npmrc uses it:
@dasjideepak:registry=https://npm.pkg.github.com
//npm.pkg.github.com/:_authToken=${GITHUB_PACKAGES_TOKEN}Set token before install:
export GITHUB_PACKAGES_TOKEN=ghp_xxx_your_token_here
npm installIn Vercel project settings for remote2:
- Go to
Settings->Environment Variables - Add
GITHUB_PACKAGES_TOKEN - Apply to
Production,Preview, andDevelopmentas needed - Redeploy to apply changes
- Never commit tokens to Git.
- Rotate token immediately if exposed.
- Use least privilege (
read:packages+repofor consumers).
Run in development:
npm run devBuild for production:
npm run buildStart production build:
npm run startRun lint:
npm run lint- Remote name:
remote2 - Remote entry file:
static/chunks/remoteEntry.js - Exposed module:
./DashboardShell->./src/components/DashboardShell - Shared singleton deps:
react,react-dom
These rules are mandatory for this remote app:
- Node.js: Use only Node 18 or 20 (LTS).
- Next.js version: Keep Next.js at 15.x. Do not upgrade beyond v15.
- React version: Keep React and ReactDOM on 18.x (current setup:
^18.2.0) and keep both versions aligned. - Bundler mode: Use Webpack mode only (no Turbopack). Keep
NEXT_PRIVATE_LOCAL_WEBPACK=truein scripts. - Routing system: Keep this app on the Pages Router. Do not migrate this remote to App Router.
- Federation sharing: Configure shared packages correctly (especially React/ReactDOM as singletons) to avoid duplicate runtimes.
- Remote contract discipline: Version remote changes carefully and keep host/remote APIs backward-compatible.
- Failure handling: Always provide fallback UI/error handling when a remote fails to load.
By default, app runs on:
http://localhost:3000
Remote entry (when running):
http://localhost:3000/_next/static/chunks/remoteEntry.js