A modern, responsive full-stack web application built with Fastify backend and React + Material-UI frontend.
- Modern UI: Beautiful Material-UI components with responsive design
- Full-Stack: Fastify backend API with React frontend
- Real-time: Hot Module Replacement (HMR) for development
- Responsive: Mobile-first design that works on all devices
- Themeable: Custom Material-UI theme with consistent styling
- Interactive: Sample components including counter, navigation drawer, and more
- React 19 - Latest React with modern hooks
- Material-UI (MUI) 7 - Professional UI component library
- Vite 7 - Fast build tool and dev server
- Emotion - CSS-in-JS styling solution
- Material Icons - Comprehensive icon library
- Fastify 5 - Fast and low overhead web framework
- Node.js - JavaScript runtime
- Node.js (v20.19.0 or higher recommended)
- npm or yarn package manager
-
Clone the repository
git clone <your-repo-url> cd my_fastify_app
-
Install client dependencies
cd client npm install -
Install server dependencies
cd ../server npm install
-
Start the backend server
cd server node index.jsThe Fastify server will start on
http://localhost:3001 -
Start the frontend client (in a new terminal)
cd client npm run devThe React app will start on
http://localhost:5173
-
Build the frontend
cd client npm run build -
Preview the production build
npm run preview
my_fastify_app/
βββ client/ # React frontend
β βββ src/
β β βββ App.jsx # Main application component
β β βββ main.jsx # Application entry point
β β βββ assets/ # Static assets
β βββ package.json # Frontend dependencies
β βββ vite.config.js # Vite configuration
βββ server/ # Fastify backend
β βββ index.js # Server entry point
β βββ package.json # Backend dependencies
βββ package.json # Root package.json
- AppBar - Top navigation bar
- Drawer - Side navigation menu
- Card - Content containers
- Grid - Responsive layout system
- Typography - Text components
- Button - Interactive buttons
- Paper - Surface containers
- Container - Content width management
- Box - Layout utility component
npm run dev- Start development server with HMRnpm run build- Build for productionnpm run preview- Preview production buildnpm run lint- Run ESLint
node index.js- Start the server
GET /api/hello- Returns a greeting message from the backend
- Increment and reset functionality
- Material-UI button variants
- Real-time state management
- Collapsible side menu
- Icon-based navigation items
- Responsive design
- Grid-based layout system
- Mobile-first approach
- Breakpoint-aware components
The app uses a custom Material-UI theme defined in App.jsx:
const theme = createTheme({
palette: {
primary: {
main: '#1976d2',
},
secondary: {
main: '#dc004e',
},
},
})- Import required components from
@mui/material - Use Material-UI's
sxprop for custom styling - Follow Material Design principles for consistency
- Build the project:
npm run build - Deploy the
dist/folder to your hosting service - Configure your server to serve the built files
- Ensure Node.js is installed on your server
- Install dependencies:
npm install - Start the server:
node index.js - Consider using PM2 or similar for production process management
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
This project is licensed under the ISC License.