A modern web application built with Next.js that displays information about countries using the REST Countries API. The project showcases modern web development practices, including TypeScript, SCSS Modules, automated testing, and comprehensive CI/CD pipelines.
- Framework: Next.js 15 with App Router
- Language: TypeScript
- Styling: SCSS Modules with responsive design
- Testing: Jest + React Testing Library
- API: REST Countries API v3.1
- CI/CD: GitHub Actions
- Code Quality: ESLint, SonarQube
- Package Manager: npm
- Clone the repository
- Install dependencies:
npm install
- Start the development server:
npm run dev
- Open http://localhost:3000 in your browser
src/
├── app/ # Next.js App Router pages
├── components/ # Reusable React components
├── contexts/ # React contexts (e.g., ThemeContext)
├── lib/ # Core business logic and API calls
├── styles/ # Global styles and SCSS variables
├── templates/ # Page-level components
└── types/ # TypeScript type definitions
The project maintains high test coverage using Jest and React Testing Library. Tests are automatically checked for existence and run during CI.
# Run tests
npm test
# Run tests in watch mode
npm run test:watch
# Generate coverage report
npm run test:coverageESLint is configured with strict TypeScript and React rules:
npm run lintSonarQube scans are automatically run on pull requests and main branch pushes to ensure:
- Code quality
- Test coverage
- Security vulnerabilities
- Code duplication
- Best practices
GitHub Actions workflow includes:
- Lint Check: Ensures code style consistency
- Unit Tests: Runs all tests and generates coverage report
- Build Check: Verifies the build process
- SonarQube Analysis: Code quality and security analysis
The pipeline runs on:
- Pull requests to main branch
- Direct pushes to main branch
- Responsive design for all screen sizes
- Dark/Light theme support
- Country information display:
- Flags
- Population
- Region
- Capital
- Search and filter capabilities
- Server-side caching for API responses
No environment variables are required for basic development setup.
- React 19
- Next.js 15
- TypeScript 5
- SASS 1.89
- Jest 30
- React Testing Library 16.3
- Create a feature branch from
dev - Make your changes
- Ensure all tests pass and coverage is maintained
- Create a pull request to
dev
This project is private and not licensed for public use.
- Modern React features and hooks
- Next.js App Router and server components
- SCSS Modules for component-level styling
- TypeScript for type safety
- Automated testing and quality checks