A modern news website built with Next.js 15 and Contentstack TypeScript SDK, featuring dynamic content management through various content types.
- Global Setting: Header configuration with logo, title, and live status
- News Channel: Main news content with various field types
- Sidebar News: Latest updates displayed in sidebar
- Breaking Alert: Real-time breaking news alerts
- News Category: Content categorization system
- News Author: Author information and profiles
- Language Switch Button: Multi-language support with dropdown and language options
- Next.js 15: Latest React framework with App Router
- Contentstack TypeScript SDK: Type-safe content management
- Tailwind CSS: Modern utility-first CSS framework
- TypeScript: Full type safety throughout the application
- ✅ Text fields (title, description, URL)
- ✅ File fields (images, documents)
- ✅ Date fields (publishing dates)
- ✅ Number fields (priority, counts)
- ✅ Boolean fields (live status, flags)
- ✅ Link fields (external URLs)
- ✅ Reference fields (content relationships)
- ✅ Taxonomy fields (content categorization)
- ✅ Group fields (nested data structures)
- ✅ Rich text fields (formatted content)
src/
├── app/
│ ├── components/
│ │ ├── Header.tsx # Global Settings header
│ │ ├── Sidebar.tsx # Sidebar News component
│ │ ├── BreakingAlert.tsx # Breaking alerts component
│ │ └── SchemaFieldsDisplay.tsx
│ ├── layout.tsx
│ └── page.tsx # Main page with all components
├── lib/
│ ├── contentstack.ts # SDK configuration & TypeScript interfaces
│ └── contentstack-helpers.ts # Helper functions for data fetching
title: Logo/brand namefile: Logo imagesingle_line: Tagline/descriptiongroup.boolean: Live status indicator
title: News titleurl: External linkdate: Publication datenumber: Channel numberfile: Featured imagereference: Related contenthgvgh767: Boolean flagb12jh7t7: Boolean flag
title: News titlefile: News imagedescrption: News description
title: Alert titlerich_text_editor: Alert contentlink: Related linkboolean: Verification statusreference: Related news
title: Category nameurl: Category URLrich_text_editor: Category descriptionfile: Category imagetaxonomies: Category tags
title: Author namerich_text_editor: Author biofile: Author photo
title: Button display textdropdown: Array of available languageschoose_language: Modular blocks with language optionssingle_line: Language name/textlink: Language-specific URL and title
-
Install dependencies:
npm install
-
Set up environment variables: Create a
.env.localfile with the following variables:# Contentstack Configuration NEXT_PUBLIC_CONTENTSTACK_API_KEY=your_contentstack_api_key_here NEXT_PUBLIC_CONTENTSTACK_DELIVERY_TOKEN=your_contentstack_delivery_token_here NEXT_PUBLIC_CONTENTSTACK_ENVIRONMENT=production # Personalize Edge Configuration NEXT_PUBLIC_PERSONALISE_EDGE_PROJECT_UID=6891ff716f1a09b09e904b21 NEXT_PUBLIC_PERSONALISE_EDGE=https://personalize.contentstack.com # Lytics Configuration NEXT_PUBLIC_LYTICS_TAG_ID=d47835afc82093e811b7b2e88bf93d68 # Email Configuration EMAIL_HOST=smtp.gmail.com EMAIL_PORT=587 EMAIL_SECURE=false EMAIL_USER=your-email@gmail.com EMAIL_PASS=your-app-password # Default Entry UID (for development/testing) NEXT_PUBLIC_DEFAULT_ENTRY_UID=blt0171967259c79e5c # Site Configuration NEXT_PUBLIC_SITE_URL=https://mychannelsabsetej.com NEXT_PUBLIC_SITE_NAME=My Channel Sabse Tej
Note: Copy
env.exampleto.env.localand fill in your actual values. -
Run development server:
npm run dev
-
Build for production:
npm run build
- Uses Global Setting content type
- Displays logo, title, and navigation
- Shows live status indicator
- Includes language switch button with dropdown
- Responsive design with mobile menu
- Displays Sidebar News content
- Shows latest updates with images
- Includes quick stats
- Responsive layout
- Real-time breaking news display
- Animated alerts with verification status
- Links to full articles
- Prominent visual styling
- Contentstack SDK: Type-safe data fetching
- Helper Functions: Centralized data access
- TypeScript Interfaces: Full type safety
- React Components: Dynamic content rendering
- Fallback Data: Graceful error handling
- Static Generation: Pre-rendered pages for fast loading
- Image Optimization: Next.js Image component support
- TypeScript: Compile-time error checking
- Responsive Design: Mobile-first approach
- Error Boundaries: Graceful error handling
- Define TypeScript interface in
contentstack.ts - Add helper function in
contentstack-helpers.ts - Create React component in
app/components/ - Integrate into main page
- Compile-time type checking
- IntelliSense support
- Refactoring safety
- Documentation through types
This project is built with Next.js and Contentstack TypeScript SDK for modern content management.