A Next.js application that fetches and displays posts from the JSONPlaceholder API in a card-based interface, following SOLID principles.
git clone https://github.com/thiagosrib/posts-app.git
cd posts-app
npm install
npm run dev
src/
āāā app/ # Next.js app router
ā āāā page.tsx # Home page
ā āāā layout.tsx # Root layout
ā āāā globals.css # Global styles
āāā components/ # UI components
ā āāā ui/ # Reusable UI components
ā āāā posts/ # Domain-specific components
āāā hooks/ # Custom React hooks
ā āāā provider.ts # Custom Client Provider
ā āāā use-posts.ts # Posts data handling hook
āāā services/ # API services
ā āāā api/ # API configuration
ā āāā posts/ # Posts-specific service
āāā types/ # TypeScript types
This project follows the SOLID principles:
The application fetches data from the JSONPlaceholder API, a fake online REST API for testing and prototyping.
usePosts
hook handles data fetching, caching, and transformation