AD Fixtures Website
A multilingual website built with Next.js, featuring smooth animations, internationalization, and a modern UI design.
Technical Specifications
- Node.js (v18 or higher)
- Next.js 14
- TypeScript
- Tailwind CSS
- Framer Motion for animations
- next-intl for internationalization
- Mailjet for email services
- Cloudinary for image hosting
- React 18
- Zustand for state management
Prerequisites
Before running this project, ensure you have:
- Node.js installed (v18 or higher)
pnpm
installed
- A Mailjet account for email services
- A Cloudinary account for image hosting
Environment Variables
Create a .env.local
file in the root directory with:
MAILJET_API_KEY=your_mailjet_api_key
MAILJET_API_SECRET=your_mailjet_secret
[email protected]
MAILJET_SENDER_NAME=Your Name
[email protected]
MAILJET_RECIPIENT_NAME=Recipient Name
Installation
Clone the repository:
git clone <repository-url>
cd ad-fixtures
Install dependencies:
pnpm install
Development
Run the development server:
pnpm run dev
The site will be available at http://localhost:3000
Project Structure
├── messages/ # Internationalization message files
│ ├── en.json # English translations
│ ├── ja.json # Japanese translations
│ └── zh.json # Chinese translations
├── src/
│ ├── components/ # Reusable components
│ │ ├── layout/ # Layout components
│ │ └── ui/ # UI components
│ ├── pages/ # Next.js pages
│ │ ├── api/ # API routes
│ │ └── landing/ # Landing page sections
│ ├── lib/ # Utility functions
│ └── styles/ # Global styles
├── public/ # Static files
│ └── images/ # Image assets
└── next.config.mjs # Next.js configuration
Features
1. Internationalization
- Supports English, Japanese, and Chinese
- Language switching with URL-based routing
- Middleware-based locale detection
- Separate message files for each language
- SEO-friendly URL structure
2. Animations
- Smooth page transitions using Framer Motion
- Scroll-based animations
- Interactive UI elements
- Staggered animations for list items
- Image carousel transitions
- Email submission through Mailjet
- Form validation
- Success/error notifications
- Rate limiting
- Spam protection
4. Image Optimization
- Cloudinary integration for image hosting
- Next.js Image component optimization
- Responsive images across devices
- Lazy loading
- Blur placeholder support
- Server-side rendering
- Static page generation where applicable
- Optimized font loading
- Code splitting
- Dynamic imports
Building for Production
Build the project:
pnpm run build
Start the production server:
pnpm run start
Deployment
The project is optimized for deployment on Vercel. To deploy:
- Push your code to GitHub
- Connect your repository to Vercel
- Configure environment variables in Vercel dashboard:
- MAILJET_API_KEY
- MAILJET_API_SECRET
- Deploy
Development Guidelines
Adding New Languages
- Create a new translation file in
messages/
directory
- Add the locale to supported languages in
middleware.ts
:
export default createMiddleware({
locales: ['en', 'ja', 'zh', 'new-locale'],
defaultLocale: 'en'
});
- Add flag image in
public/images/flags/
- Update LocaleSwitcher component
Adding New Sections
- Create component in
src/pages/landing/sections/
- Add translations to all language files
- Import and add component to
index.page.tsx
- Add any required images to Cloudinary
- Update types if necessary
Code Style
- Use TypeScript for all new files
- Follow existing component structure
- Use Tailwind CSS for styling
- Implement responsive design
- Add proper TypeScript types
- Use next-intl for all text content
- Optimize images before uploading to Cloudinary
- Use proper image sizes and formats
- Implement lazy loading where appropriate
- Keep bundle size in check
- Use dynamic imports for large components
Available Scripts
pnpm run dev # Start development server
pnpm run build # Build for production
pnpm run start # Start production server
pnpm run lint # Run ESLint
Browser Support
- Chrome (latest 2 versions)
- Firefox (latest 2 versions)
- Safari (latest 2 versions)
- Edge (latest 2 versions)
Troubleshooting
Common Issues
Image loading issues:
- Check Cloudinary configuration
- Verify image paths
- Check image formats
Translation issues:
- Verify message files
- Check locale configuration
- Clear browser cache
Build errors:
- Clear
.next
directory
- Remove
node_modules
and reinstall
- Check TypeScript errors
Contributing
- Fork the repository
- Create a feature branch
- Commit changes
- Push to the branch
- Create a Pull Request
License
This project is private and proprietary. All rights reserved.
Support
For support, please contact the development team or create an issue in the repository.