A modern React TypeScript application for GRABO Coffee Shop with Contentstack CMS integration.
- React 18 with TypeScript
- React Router for client-side routing
- Contentstack Integration for dynamic content management
- Responsive Design with mobile-first approach
- Modern Component Architecture with reusable components
- Custom Hooks for state management
- Coffee-themed Design with beautiful UI
src/
├── components/ # Reusable React components
│ ├── Header.tsx # Navigation header
│ ├── Footer.tsx # Site footer
│ ├── HeroSection.tsx # Reusable hero section
│ ├── MenuCard.tsx # Coffee menu item card
│ ├── LoadingSpinner.tsx
│ └── ErrorMessage.tsx
├── pages/ # Page components
│ ├── Home.tsx # Homepage
│ ├── About.tsx # About page
│ ├── Services.tsx # Services page
│ ├── Menu.tsx # Menu page with API integration
│ └── Contact.tsx # Contact page
├── services/ # API services
│ ├── apiConfig.ts # Contentstack configuration
│ └── apiService.ts # API service methods
├── types/ # TypeScript type definitions
│ └── index.ts # All type definitions
├── utils/ # Utility functions and custom hooks
│ └── useMenu.ts # Custom hook for menu data
├── assets/ # Static assets
│ ├── styles/ # CSS files
│ └── images/ # Images (copied to public/assets/)
└── App.tsx # Main app component with routing
Runs the app in development mode.
Open http://localhost:3000 to view it in the browser.
Builds the app for production to the build folder.
Launches the test runner in the interactive watch mode.
-
Install Dependencies
npm install
-
Start Development Server
npm start
-
Build for Production
npm run build
The application integrates with Contentstack CMS for dynamic content:
- Content Type:
card(Coffee menu items) - API Key: Configured in
src/services/apiConfig.ts - Environment: Development
- Features:
- Real-time menu loading
- Fallback content when API is unavailable
- Loading states and error handling
- Home (
/) - Homepage with hero section, about, services, and testimonials - About (
/about) - About page - Services (
/services) - Services page with detailed service descriptions - Menu (
/menu) - Dynamic coffee menu from Contentstack - Contact (
/contact) - Contact information page
- Uses existing CSS with React-compatible structure
- Coffee-themed color scheme with gradient logos
- Responsive design for all screen sizes
- Smooth animations and hover effects
- Menu Page: Uses
useMenuhook to fetch data from Contentstack - API Service: Handles all Contentstack API calls
- Type Safety: Full TypeScript support with proper type definitions
- Error Handling: Graceful fallbacks and user-friendly error messages
The app can be deployed to any static hosting service:
- Run
npm run build - Deploy the
buildfolder to your hosting service - Configure routing for single-page application
- Test pages: Visit
/menuto see live Contentstack integration - Check browser console for API call logs
- Verify responsive design on different screen sizes
This React application maintains all functionality from the original HTML version:
- ✅ Same visual design and layout
- ✅ Contentstack API integration
- ✅ Responsive behavior
- ✅ Navigation and routing
- ✅ Coffee menu functionality
- ✅ Loading states and error handling
The React version adds:
- ⭐ Component reusability
- ⭐ Type safety with TypeScript
- ⭐ Modern development experience
- ⭐ Better state management
- ⭐ Improved performance