Skip to content
Project template·Pro

Vite + React + TypeScript

A habit tracker in React and TypeScript, built with Vite 8, with a weekly grid, streaks, a custom hook and a test. It needs the Linux environment with Node.js. The first npm install downloads about 25 packages (around 80 MB).

You need PocketCode Pro to install it.

If PocketCode is installed on your Android device, this opens the page in the app.

Preview

Files

README.md
index.html
package-lock.json
package.json
public/favicon.svg
src/App.tsx
src/index.css
src/main.tsx
src/useLocalStorage.ts
src/week.ts
test/week.test.ts
tsconfig.json
vite.config.ts

README.md

# Habit tracker: Vite + React + TypeScript A small React app in TypeScript, built with Vite: a weekly grid of habits you tick off day by day, with a streak counter. Habits are saved in the browser (localStorage). It shows the usual pieces of a React project: components, state, a custom hook, typed data and a test. ## Run it in PocketCode You need the app's Linux environment with Node.js 20.19 or newer (the Developer pack in Terminal › Linux includes Node.js and npm). 1. Open the terminal in this project's folder (Open Terminal Here, in the editor menu). 2. Install the dependencies. The first time downloads about 25 packages (around 80 MB on disk) and needs internet: ```sh npm install ``` 3. Start the development server: ```sh npm run dev ``` 4. Open http://localhost:5173 in the DevBrowser (or in the phone's browser). Saving a file updates the page. Stop the server with Ctrl+C in the terminal. ## Other commands | Command | What it does | |---|---| | `npm run build` | Type-checks with `tsc` and writes the production build to `dist/` | | `npm run preview` | Serves `dist/` on http://localhost:4173 | | `npm run typecheck` | Only the type check | | `npm test` | Tests for `src/week.ts` with Node's test runner (Node 22.18 or newer) | ## Where things are | Path | What it does | |---|---| | `index.html` | The page Vite serves; it loads `src/main.tsx` | | `src/App.tsx` | The app: form, weekly grid, streaks |

This preview is shortened. You get the full content when you install it.

Changes in 1.0.0

First version.

Related

Next.js + Tailwind + i18nProProject templateNext.js 15 project with next-intl and Tailwind CSS, and one page in English and Spanish at /en and /es. Dark mode follows the system. Needs the Linux environment with Node.js; the first npm install downloads around 400 MB.Vite + Vue + TypeScriptProProject templateA focus timer in Vue 3 and TypeScript, built with Vite 8, with focus sessions, breaks and today's total. The code uses two composables and has a test. It needs the Linux environment with Node.js; the first npm install downloads about 50 packages (around 85 MB).Vite + Svelte + TypeScriptProProject templateFlashcards in Svelte 5 and TypeScript, built with Vite 8. Each card moves through five Leitner boxes and comes back when it is due. It needs the Linux environment with Node.js; the first npm install downloads about 45 packages (around 75 MB).To-do list in plain JavaScriptProProject templateA to-do list in plain JavaScript modules. You can add items, edit them in place, tick them off, filter and clear them, and the list is saved in localStorage. The logic has tests for Node's test runner. It runs in the DevBrowser and on the app's own Node.js, without Linux.Button (React + Tailwind)FreeButtonTypeScript button with primary and secondary styles, a visible focus ring and a loading spinner that also sets aria-busy. The secondary style has dark mode colours.Static landing pageProProject templateA one-page site in plain HTML and CSS with a header and folding menu, a hero, a feature grid, an FAQ and a footer. Colours follow the system's light or dark setting. There is no build step and it doesn't need Linux: open index.html and tap the globe icon.