Skip to content

xenioushk/pocket-money-app

Repository files navigation

πŸ’° Pocket Money App

React TypeScript Vite TailwindCSS License

A modern, full-featured platform for managing micro jobs and gig work

Live Demo Β· Report Bug Β· Request Feature


πŸ“‹ Table of Contents


🎯 Overview

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.

Key Highlights

  • βœ… 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

✨ Features

πŸ” User Authentication

  • User registration with validation
  • Secure login/logout
  • Protected routes for authenticated users
  • Profile management
  • Persistent authentication state

πŸ’Ό Job Management

  • 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

🎨 User Experience

  • 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

🎯 Admin Features

  • 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

πŸ›‘οΈ Security & Privacy

  • 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

Core

  • React 18.2 - UI library
  • TypeScript 5.9 - Type safety
  • Vite 5.4 - Build tool & dev server

State Management & Data Fetching

  • TanStack Query 5.90 - Server state management
  • React Context API - Global state (Auth, Theme)
  • React Hook Form 7.39 - Form state management

Routing & Navigation

  • React Router 6.4 - Client-side routing

Styling

  • TailwindCSS 3.2 - Utility-first CSS
  • PostCSS - CSS processing
  • Autoprefixer - CSS vendor prefixing

HTTP & API

  • Axios 1.1 - HTTP client with interceptors

Additional Libraries

  • React Toastify - Toast notifications
  • Google reCAPTCHA - Bot protection

πŸš€ Getting Started

Prerequisites

  • Node.js: 18.x or higher
  • npm: 9.x or higher (or yarn/pnpm)

Installation

  1. Clone the repository

    git clone https://github.com/yourusername/pocket-money-app.git
    cd pocket-money-app
  2. Install dependencies

    npm install
  3. Set up environment variables

    cp .env.example .env

    Edit .env and add your configuration:

    VITE_PM_API_URL=https://your-backend-url.com
    VITE_SEC_SITE_KEY=your_recaptcha_site_key
  4. Start the development server

    npm run dev
  5. Open your browser

    http://localhost:5173
    

πŸ“ Project Structure

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

πŸ“œ Available Scripts

Development

npm run dev       # Start development server (http://localhost:5173)
npm run start     # Alias for npm run dev

Production

npm run build     # Build for production (outputs to /build)
npm run preview   # Preview production build locally

πŸ” Environment Variables

Create 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

Environment Variables Explained

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.


πŸ—οΈ Architecture

Design Patterns

  • 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

Key Features

1. Type Safety

All components use TypeScript interfaces:

interface JobProps {
  job: Job
  single?: boolean
}

2. Server State Management

TanStack Query handles all server interactions:

const { data: jobs, isLoading } = useJobs()
const createJobMutation = useCreateJob()

3. Protected Routes

Authentication-based route protection:

<Route
  path="/dashboard"
  element={
    <PrivateRoute>
      <Dashboard />
    </PrivateRoute>
  }
/>

4. Error Boundaries

Graceful error handling:

<ErrorBoundary fallback={<ErrorFallback />}>
  <App />
</ErrorBoundary>

🀝 Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Code Style

  • 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)

πŸ“ License

This project is licensed under the MIT License - see the LICENSE file for details.


πŸ™ Acknowledgments


πŸ“ž Contact & Support


Made with ❀️ using React & TypeScript

⭐ Star this repo if you find it helpful!

About

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.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages