- Purpose: Webpack config for the shell host app consuming 4 remote micro-frontends (Market, Chart, Portfolio, Angular).
- Vercel URL resolution: Prefers
VERCEL_PROJECT_PRODUCTION_URL(stable prod domain) overVERCEL_URL(deployment-specific, unreliable for baked URLs). - Local dev fallback: When both Vercel vars are absent, uses
localhost:3001–3004(overridable viaMF_*_URLenv vars). - Subpath routing: All MFs deploy as subpaths (
/mf-market,/mf-chart, etc.) on the same origin — no CORS, no separate domains. - Module Federation: Shell exposes nothing; consumes 4 remotes via
remoteEntry.jsat runtime. - Shared deps:
reactandreact-domas singletons (^19.0.0) — prevents duplicate React instances and hook errors. - Build: Babel (
preset-env,preset-react) for.js/.jsx; mode toggled byNODE_ENV. - Output:
publicPath: "auto"— critical for MF, lets remotes resolve their own assets correctly.
A pragmatic, battle-tested checklist for reviewing React codebases (React 19+, Hooks era, Next.js-aware). Use it as a scan-during-PR reference — not a rulebook. Context always wins.
- README.md present: Setup, scripts, env vars, architecture diagram. A new dev should be productive in <30 min.
- .gitignore: Excludes
node_modules/,.env*,dist/,build/,.DS_Store,coverage/, IDE folders.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| version: '3.4' | |
| volumes: | |
| postgres_data: | |
| driver: local | |
| services: | |
| postgres: | |
| image: postgres:14.1 | |
| container_name: keycloak-nodejs-example-postgres |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FROM node:18 AS build | |
| WORKDIR /opt/{your app name} | |
| COPY package*.json ./ | |
| RUN npm install | |
| COPY . . | |
| RUN npm run build --build-arg CACHEBUST=${CACHEBUST} | |
| FROM nginx:latest | |
| COPY --from=build /opt/{your app name}/build /usr/share/nginx/html | |
| EXPOSE 81 | |
| COPY nginx.conf /etc/nginx/nginx.conf |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!doctype html> | |
| <html> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <script src="https://cdn.tailwindcss.com"></script> | |
| <script> | |
| tailwind.config = { | |
| theme: { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { createAsyncThunk, createSlice } from '@reduxjs/toolkit'; | |
| export const fetchIssues = createAsyncThunk<string[], void, { rejectValue: string }>( | |
| "githubIssue/fetchIssues", | |
| async (_, thunkAPI) => { | |
| try { | |
| const response = await fetch("https://api.github.com/repos/github/hub/issues"); | |
| const data = await response.json(); | |
| const issues = data.map((issue: { title: string }) => issue.title); | |
| return issues; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <!-- Page title --> | |
| <title>Event Page</title> | |
| <!-- Other possible tags --> | |
| <script></script> | |
| <style></style> | |
| <!-- Can specify document base URL --> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import mongoose from 'mongoose'; | |
| const dbUri = "Your mongo DB URI" // This should be prick from .env file | |
| export default async () => { | |
| await mongoose.connect(dbUri,{}) | |
| .then(() => { | |
| console.log('Mongodb Connection to database'); | |
| }) | |
| .catch(err => { |