A responsive React TypeScript homepage for Cornell Climate Smart Farming, showcasing tools, team, and resources for climate-adaptive agriculture.
This project implements a modern, responsive homepage for Cornell's Climate Smart Farming initiative. The site features:
- Featured Tools: Interactive grid showcasing agricultural tools and calculators
- Team Section: Cornell team members with contact information
- Resources Section: Educational materials and research publications
- Responsive Design: Mobile-first approach with tablet and desktop breakpoints
- Modern Tech Stack: React 18, TypeScript, Vite, CSS Modules
- Node.js 16+
- npm or yarn
# Clone the repository
git clone <repository-url>
cd CSFSite
# Install dependencies
npm install
# Start development server
npm run dev
# Build for production
npm run build
# Preview production build
npm run preview
The application will be available at http://localhost:5173
This project is configured for one-click deployment to Railway:
Quick Deploy Steps:
- Push this repository to GitHub
- Connect GitHub to Railway
- Deploy automatically with zero configuration
For detailed deployment instructions, see DEPLOYMENT.md
Live Demo: [Coming Soon - Will be deployed to Railway]
src/
βββ components/
β βββ layout/
β β βββ Header/ # Fixed navigation header
β β β βββ Header.tsx
β β β βββ Header.module.css
β β β βββ MobileMenu.tsx
β β β βββ MobileMenu.module.css
β β βββ Footer/ # Site footer with links
β β βββ Footer.tsx
β β βββ Footer.module.css
β βββ sections/
β β βββ HeroSection/ # Main hero with title/subtitle
β β β βββ HeroSection.tsx
β β β βββ HeroSection.module.css
β β βββ FeaturedTools/ # Tools grid section
β β β βββ FeaturedTools.tsx
β β β βββ ToolCard.tsx
β β β βββ FeaturedTools.module.css
β β βββ TeamSection/ # Team member grid
β β β βββ TeamSection.tsx
β β β βββ TeamMember.tsx
β β β βββ TeamSection.module.css
β β βββ ResourcesSection/ # Resources with left border
β β βββ ResourcesSection.tsx
β β βββ ResourceCard.tsx
β β βββ ResourcesSection.module.css
β βββ common/
β βββ Container/ # Responsive container wrapper
β β βββ Container.tsx
β β βββ Container.module.css
β βββ SectionTitle/ # Reusable section headers
β βββ SectionTitle.tsx
β βββ SectionTitle.module.css
βββ pages/
β βββ HomePage/ # Main page assembly
β βββ HomePage.tsx
β βββ HomePage.module.css
βββ styles/
β βββ globals.css # Global styles and resets
β βββ variables.css # CSS custom properties
βββ data/
β βββ tools.ts # Mock tool data and types
β βββ team.ts # Team member data
β βββ resources.ts # Resource data and types
βββ App.tsx # Root application component
βββ main.tsx # Application entry point
/* Primary Colors */
--color-primary-green: #2e7d32 /* Cornell green */
--color-primary-green-light: #43a047 /* Light green */
--color-primary-green-accent: #66bb6a /* Accent green */
/* Neutral Colors */
--color-neutral-white: #ffffff
--color-neutral-off-white: #fafafa
--color-neutral-light-gray: #f5f5f5
--color-neutral-gray: #e0e0e0
--color-neutral-dark-gray: #666666
--color-neutral-charcoal: #333333
--color-neutral-dark-charcoal: #2e3d2e
- Primary Font: System font stack (-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto)
- Heading Font: Georgia, serif
- Responsive Font Sizes: Automatically scale on mobile devices
- Header: 80px (fixed)
- Hero: 320px
- Featured Tools: ~500px
- Team: ~450px
- Resources: ~400px
- Footer: 280px
- Mobile: <768px
- Tablet: 768px - 1200px
- Desktop: >1200px
Section | Desktop | Tablet | Mobile |
---|---|---|---|
Tools | 4 columns | 2 columns | 1 column |
Team | 6 columns | 3 columns | 2 columns |
Resources | 3 columns | 2 columns | 1 column |
- React 18: UI library with functional components and hooks
- TypeScript: Type safety and enhanced developer experience
- Vite: Fast build tool and dev server
- CSS Modules: Scoped styling with automatic class name generation
- ESLint: Code linting and formatting
- Accessibility: ARIA labels, keyboard navigation, focus management
- Performance: Optimized builds with code splitting
- SEO: Semantic HTML structure and proper heading hierarchy
- Cross-browser: Modern browser support with graceful degradation
Mock data is organized in TypeScript modules:
tools.ts
: Tool cards with categories and descriptionsteam.ts
: Team member profiles with contact inforesources.ts
: Educational resources with metadata
npm run dev # Start development server
npm run build # Build for production
npm run preview # Preview production build
npm run lint # Run ESLint
- Components: Use functional components with TypeScript
- Styling: CSS Modules for component-scoped styles
- State: React hooks for component state management
- Types: Define interfaces for all props and data structures
- Accessibility: Include ARIA attributes and keyboard navigation
// In src/data/tools.ts
{
id: 'new-tool',
title: 'New Tool Name',
description: 'Tool description...',
icon: 'π§',
link: '/tools/new-tool',
category: 'weather' // or 'crop', 'soil', 'climate'
}
// In src/data/team.ts
{
id: 'member-id',
name: 'Member Name',
role: 'Position',
specialty: 'Area of expertise',
email: 'email@cornell.edu'
}
- β Responsive homepage with all sections
- β Interactive tool cards with hover effects
- β Team member grid with contact functionality
- β Resource cards with metadata and tags
- β Mobile-responsive navigation with hamburger menu
- β Fixed header with smooth scrolling
- β Cornell branding and color scheme
- β Accessibility features (ARIA, keyboard nav)
- β TypeScript type safety throughout
- Routing system for multi-page navigation
- Search and filtering for tools/resources
- Content management system integration
- User authentication and personalization
- Analytics and usage tracking
- Dark mode support
- Internationalization (i18n)
The application has been tested for:
- Responsive behavior across mobile, tablet, and desktop
- Accessibility with keyboard navigation and screen readers
- Cross-browser compatibility in modern browsers
- Performance with optimized builds and assets
- Follow the established code style and patterns
- Use TypeScript for all new components
- Add CSS Modules for component styling
- Include accessibility attributes
- Test responsive behavior across breakpoints
- Update documentation for significant changes
This project is part of Cornell University's Climate Smart Farming initiative.
Built with β€οΈ for sustainable agriculture and climate adaptation