A responsive React application for managing friends and acquaintances with component-based architecture, built with TypeScript and Vite.

- 📱 Responsive Design: Optimized for both mobile and desktop
- 🔍 Search Functionality: Search friends by name or nickname
- 👥 Friend Groups: Automatically categorizes friends and acquaintances
- 🎨 .NET MAUI Theme: Purple color scheme matching Microsoft's design language
- 🔧 TypeScript: Full type safety throughout the application
- ⚡ Fast Development: Powered by Vite with hot module replacement
The app uses a centralized configuration system located in src/config/app.config.ts:
You can customize the API base URL through environment variables:
- Copy
.env.exampleto.env.local - Set your custom API base URL:
VITE_API_BASE_URL=https://your-api-domain.com
The app supports two data loading modes:
- Network Mode: Loads data from remote API (default: Azure Blob Storage)
- Local Mode: Loads data from local JSON file
To switch between modes, update the import in src/hooks/useFriends.ts:
// For network data:
import { fetchFriends } from '../services/friendsService';
// For local data:
import { localFriendsService } from '../services/localFriendsService';# Install dependencies
npm install
# Start development server
npm run dev
# Build for production
npm run build
# Preview production build
npm run previewsrc/
├── components/ # Reusable UI components
│ ├── FriendDetails/ # Friend profile view
│ ├── FriendsList/ # Friends listing with groups
│ ├── SearchBar/ # Search functionality
│ └── ...
├── config/ # App configuration
├── data/ # Local JSON data files
├── hooks/ # Custom React hooks
├── services/ # API and data services
├── types/ # TypeScript type definitions
└── utils/ # Utility functions
This application follows React best practices:
- Component-Based Architecture: Modular, reusable components
- Custom Hooks: Business logic separated from UI components
- TypeScript: Full type safety and intellisense
- Responsive Design: Mobile-first CSS with breakpoints
- Service Layer: Abstracted data fetching with error handling
If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules:
export default defineConfig([
globalIgnores(['dist']),
{
files: ['**/*.{ts,tsx}'],
extends: [
// Other configs...
// Remove tseslint.configs.recommended and replace with this
tseslint.configs.recommendedTypeChecked,
// Alternatively, use this for stricter rules
tseslint.configs.strictTypeChecked,
// Optionally, add this for stylistic rules
tseslint.configs.stylisticTypeChecked,
// Other configs...
],
languageOptions: {
parserOptions: {
project: ['./tsconfig.node.json', './tsconfig.app.json'],
tsconfigRootDir: import.meta.dirname,
},
// other options...
},
},
])You can also install eslint-plugin-react-x and eslint-plugin-react-dom for React-specific lint rules:
// eslint.config.js
import reactX from 'eslint-plugin-react-x'
import reactDom from 'eslint-plugin-react-dom'
export default defineConfig([
globalIgnores(['dist']),
{
files: ['**/*.{ts,tsx}'],
extends: [
// Other configs...
// Enable lint rules for React
reactX.configs['recommended-typescript'],
// Enable lint rules for React DOM
reactDom.configs.recommended,
],
languageOptions: {
parserOptions: {
project: ['./tsconfig.node.json', './tsconfig.app.json'],
tsconfigRootDir: import.meta.dirname,
},
// other options...
},
},
])