Skip to content

jinweiyang126-code/earn-task

 
 

Repository files navigation

React + TypeScript + Vite

EarnTask prototype (SPA)

Routes follow 2026-04-12-earntask-platform-design.md: /, /auth/login, /auth/register, /auth/callback, /tasks, /tasks/:id, /dashboard, /wallet. Copy .env.example to .env and set VITE_SUPABASE_URL / VITE_SUPABASE_ANON_KEY for live tasks and auth (same Supabase project as the Next.js MVP).

Homepage stats (active earners, total paid out, countries, app rating) load from the Postgres RPC get_marketing_stats. The Period / Tasks / Earnings / Status table uses get_marketing_earnings_breakdown. Apply ../earntask/supabase/migrations/002_marketing_stats.sql and 003_marketing_earnings_breakdown.sql (or the matching blocks in ../earntask/supabase/schema.sql) in the Supabase SQL editor so anon can execute them. Edit platform_settings.app_rating to change the star rating until a reviews table exists.


This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.

Currently, two official plugins are available:

React Compiler

The React Compiler is not enabled on this template because of its impact on dev & build performances. To add it, see this documentation.

Expanding the ESLint configuration

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...
    },
  },
])

About

Earn money from anywhere in the world Complete simple tasks and get paid instantly. Join 2M+ earners worldwide.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • TypeScript 93.9%
  • CSS 5.0%
  • Other 1.1%