A modern, full-featured platform for managing micro jobs and gig work
- Overview
- Features
- Tech Stack
- Getting Started
- Project Structure
- Available Scripts
- Environment Variables
- Architecture
- Contributing
- License
Pocket Money App is a comprehensive job management platform that connects people looking for quick tasks with those offering micro jobs. Built with modern React patterns and TypeScript, it provides a seamless experience for posting, browsing, and managing small gigs.
- β Modern Stack: React 18, TypeScript, Vite, TailwindCSS
- β State Management: TanStack Query (React Query) for server state
- β Type Safety: Full TypeScript coverage with strict mode
- β Authentication: Context-based auth with protected routes
- β Form Handling: React Hook Form with validation
- β Responsive Design: Mobile-first approach with Tailwind
- β Dark Mode: Full dark mode with ThemeContext and local storage persistence
- β Code Splitting: Lazy loading for optimal performance
- β Error Boundaries: Graceful error handling
- β URL State Management: Sorting and pagination in URL
- β Category Management: Admin interface for CRUD operations
- β Job Counts: Real-time job counts in category sidebar
- β Modern Components: Confirmation dialogs, pagination, theme toggle
- User registration with validation
- Secure login/logout
- Protected routes for authenticated users
- Profile management
- Persistent authentication state
- Browse Jobs: Filter by category with sidebar navigation
- Search: Real-time search with modern dropdown UI and debouncing
- Post Jobs: Create new job listings with rich details
- Edit Jobs: Update existing job posts
- Categories: Organized job categorization with job counts
- Sorting: Sort jobs by date, price, or title (ascending/descending)
- Pagination: Modern pagination with URL persistence
- URL State: Sorting and pagination reflected in URL for bookmarking
- Responsive Design: Mobile-first approach (mobile, tablet, desktop)
- Dark Mode: Full dark mode support with theme toggle
- Modern UI: Glassmorphism effects, gradients, and smooth animations
- Loading States: Skeleton loaders and spinners
- Toast Notifications: Modern gradient toasts for user feedback
- Breadcrumb Navigation: Context-aware navigation
- Category Sidebar: Job counts and active state indicators
- Search Dropdown: Rich search results with icons and metadata
- Accessibility: ARIA labels and keyboard navigation support
- Job Management: Approve, reject, or delete job posts
- Category Management: Full CRUD operations for categories
- User Creation: Create new users with admin/user roles
- Status Control: Change job status with confirmation dialogs
- Bulk Operations: Filter and manage multiple jobs
- Protected Routes: Role-based access control
- reCAPTCHA: Spam protection for contact forms
- Form Validation: Client and server-side validation
- Input Sanitization: XSS protection
- Protected API Routes: JWT-based authentication
- Role-Based Access: Admin and user permissions
- Confirmation Dialogs: Prevent accidental deletions
- React 18.2 - UI library
- TypeScript 5.9 - Type safety
- Vite 5.4 - Build tool & dev server
- TanStack Query 5.90 - Server state management
- React Context API - Global state (Auth, Theme)
- React Hook Form 7.39 - Form state management
- React Router 6.4 - Client-side routing
- TailwindCSS 3.2 - Utility-first CSS
- PostCSS - CSS processing
- Autoprefixer - CSS vendor prefixing
- Axios 1.1 - HTTP client with interceptors
- React Toastify - Toast notifications
- Google reCAPTCHA - Bot protection
- Node.js: 18.x or higher
- npm: 9.x or higher (or yarn/pnpm)
-
Clone the repository
git clone https://github.com/yourusername/pocket-money-app.git cd pocket-money-app -
Install dependencies
npm install
-
Set up environment variables
cp .env.example .env
Edit
.envand add your configuration:VITE_PM_API_URL=https://your-backend-url.com VITE_SEC_SITE_KEY=your_recaptcha_site_key
-
Start the development server
npm run dev
-
Open your browser
http://localhost:5173
pocket-money-app/
βββ public/ # Static assets
β βββ index.html # HTML template
βββ src/
β βββ components/ # React components
β β βββ base/ # Base components (Pagination, ConfirmDialog, ThemeToggle, etc.)
β β βββ form/ # Form components (AddJob, EditJob, FormInput, etc.)
β β βββ jobs/ # Job-related components (JobItem, Jobs)
β β βββ layout/ # Layout components (JobsLayout with sidebar)
β β βββ pages/ # Page components (Home, Category, AdminDashboard, ManageCategories, etc.)
β β βββ search/ # Search components (SearchBox with modern dropdown)
β β βββ shared/ # Shared components (Header, Footer)
β βββ context/ # React Context providers
β β βββ AuthContext.tsx # Authentication state
β β βββ ThemeContext.tsx # Dark mode theme state
β βββ hooks/ # Custom React hooks
β β βββ useAuth.ts # Authentication hook
β β βββ useDebounce.ts # Debounce hook for search
β β βββ useJobs.ts # Jobs data fetching hook
β β βββ useTheme.ts # Theme toggle hook
β β βββ useToast.ts # Toast notifications hook
β βββ services/ # API services
β β βββ api.ts # Axios instance with interceptors
β β βββ authService.ts # Authentication API
β β βββ categoryService.ts # Category CRUD operations
β β βββ jobService.ts # Job operations
β βββ types/ # TypeScript type definitions
β β βββ index.ts # All interfaces (Job, Category, User, etc.)
β βββ App.tsx # Main app component with routing
β βββ index.tsx # Entry point
β βββ index.css # Global styles with Tailwind utilities
βββ database_seeds.sql # 115 sample jobs for development
βββ .env.example # Environment variables template
βββ package.json # Dependencies and scripts
βββ tsconfig.json # TypeScript configuration
βββ vite.config.ts # Vite configuration
βββ tailwind.config.cjs # Tailwind configuration with dark mode
βββ README.md # This file
npm run dev # Start development server (http://localhost:5173)
npm run start # Alias for npm run devnpm run build # Build for production (outputs to /build)
npm run preview # Preview production build locallyCreate a .env file in the root directory:
# API Configuration
VITE_PM_API_URL=https://your-backend-api.com
# Google reCAPTCHA (optional - app works without it)
VITE_SEC_SITE_KEY=your_recaptcha_site_key_here| Variable | Description | Required |
|---|---|---|
VITE_PM_API_URL |
Backend API base URL | Yes |
VITE_SEC_SITE_KEY |
Google reCAPTCHA v2 site key | No* |
*App will function without reCAPTCHA, but spam protection will be disabled.
- Component Composition: Reusable, composable components
- Custom Hooks: Logic abstraction and reusability
- Context API: Global state management for auth and theme
- Server State: TanStack Query for caching and synchronization
- Code Splitting: Lazy loading for route-based code splitting
All components use TypeScript interfaces:
interface JobProps {
job: Job
single?: boolean
}TanStack Query handles all server interactions:
const { data: jobs, isLoading } = useJobs()
const createJobMutation = useCreateJob()Authentication-based route protection:
<Route
path="/dashboard"
element={
<PrivateRoute>
<Dashboard />
</PrivateRoute>
}
/>Graceful error handling:
<ErrorBoundary fallback={<ErrorFallback />}>
<App />
</ErrorBoundary>Contributions are welcome! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
- Follow TypeScript best practices
- Use functional components with hooks
- Destructure props in function parameters
- Use meaningful variable and function names
- Add comments for complex logic
- Maintain consistent formatting (Prettier recommended)
This project is licensed under the MIT License - see the LICENSE file for details.
- Live Demo: https://pocket-money-23.netlify.app/
- Issues: GitHub Issues
- Discussions: GitHub Discussions
Made with β€οΈ using React & TypeScript
β Star this repo if you find it helpful!