A responsive frontend application built with Next.js, Tailwind CSS, and Redux RTK Query for SM Technology's development task.
- Framework: Next.js 15.5.4 with App Router
- Language: TypeScript
- Styling: Tailwind CSS 4
- State Management: Redux Toolkit with RTK Query
- Testing: Jest with React Testing Library
- Linting: ESLint with Next.js config
- β Responsive design across all devices
- β Modern UI components with Tailwind CSS
- β Redux RTK Query for API integration
- β TypeScript for type safety
- β Component-based architecture
- β Testing setup with Jest
- β SEO optimized with Next.js
- β Performance optimized
- Node.js 18.0 or later
- npm or yarn package manager
git clone <repository-url>
cd sm-technology-frontendnpm installCreate a .env.local file in the root directory:
# API Configuration
NEXT_PUBLIC_API_BASE_URL=https://your-live-server-url.com
# App Configuration
NEXT_PUBLIC_APP_NAME=SM Technology
NEXT_PUBLIC_APP_VERSION=1.0.0npm run devOpen http://localhost:3000 in your browser to see the application.
src/
βββ app/ # Next.js App Router
β βββ layout.tsx # Root layout
β βββ page.tsx # Home page
β βββ globals.css # Global styles
βββ components/ # Reusable components
β βββ layout/ # Layout components
β β βββ Header.tsx
β β βββ Footer.tsx
β βββ sections/ # Page sections
β β βββ Hero.tsx
β βββ ui/ # UI components
β β βββ Button.tsx
β β βββ Input.tsx
β β βββ LoadingSpinner.tsx
β βββ providers/ # Context providers
β βββ Providers.tsx
βββ store/ # Redux store
β βββ index.ts # Store configuration
β βββ hooks.ts # Typed hooks
β βββ api/ # API slices
β βββ apiSlice.ts
βββ types/ # TypeScript types
β βββ index.ts
βββ config/ # Configuration
βββ env.ts
npm run dev- Start development servernpm run build- Build for productionnpm run start- Start production servernpm run lint- Run ESLintnpm run test- Run testsnpm run test:watch- Run tests in watch modenpm run test:coverage- Run tests with coverage
The application uses Redux RTK Query for API integration. The base configuration is set up in src/store/api/apiSlice.ts.
- Define your endpoint in the
apiSlice.tsfile:
export const api = createApi({
// ... existing config
endpoints: (builder) => ({
getUsers: builder.query<User[], void>({
query: () => 'users',
providesTags: ['User'],
}),
createUser: builder.mutation<User, Partial<User>>({
query: (user) => ({
url: 'users',
method: 'POST',
body: user,
}),
invalidatesTags: ['User'],
}),
}),
})- Export the generated hooks:
export const {
useGetUsersQuery,
useCreateUserMutation,
} = api- Use in your components:
import { useGetUsersQuery } from '@/store/api/apiSlice'
function UsersList() {
const { data: users, error, isLoading } = useGetUsersQuery()
if (isLoading) return <LoadingSpinner />
if (error) return <div>Error loading users</div>
return (
<ul>
{users?.map(user => (
<li key={user.id}>{user.name}</li>
))}
</ul>
)
}The project uses Tailwind CSS for styling. Follow these guidelines:
- Use utility classes for styling
- Create custom components for reusable UI elements
- Follow mobile-first responsive design
- Use consistent spacing and color schemes
- Maintain accessibility standards
The project includes Jest and React Testing Library for testing.
Create test files with .test.tsx or .spec.tsx extension:
import { render, screen } from '@testing-library/react'
import { Button } from '@/components/ui/Button'
describe('Button', () => {
it('renders correctly', () => {
render(<Button>Click me</Button>)
expect(screen.getByText('Click me')).toBeInTheDocument()
})
})npm run build- Push your code to GitHub
- Connect your repository to Vercel
- Configure environment variables
- Deploy
The application can be deployed to any platform that supports Node.js:
- Netlify
- AWS Amplify
- Railway
- DigitalOcean App Platform
The application is fully responsive and tested on:
- Mobile devices (320px and up)
- Tablets (768px and up)
- Desktop (1024px and up)
- Large screens (1280px and up)
- Environment variables are properly configured
- API tokens are handled securely
- Input validation is implemented
- XSS protection is enabled
- CSRF protection is configured
- Next.js automatic code splitting
- Image optimization with Next.js Image component
- Lazy loading for components
- Bundle analysis and optimization
- SEO optimization with Next.js metadata
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests for new functionality
- Run the test suite
- Submit a pull request
For any questions or support, please contact:
- Phone: 01886807417
- Email: [email protected]
This project is created for SM Technology's frontend development task.
Project Submission Date: September 27, 2025, 11:59 PM Submission Link: Submit Here# fresh-hervest-management-system