A single-page React app that implements a PopX-style onboarding flow (home, sign-up, sign-in, profile) with client-side validation and browser-only state.
Built with Vite, React Router, and Tailwind CSS for a small, mobile-first UI.
A small front-end-only account UI that:
- Presents a landing screen with entry points to sign-up and sign-in.
- Collects user details with client-side validation.
- Stores user data and login state in
localStorage. - Shows a profile screen with stored values and a logout action.
Intended for UI prototyping or take-home tasks where a lightweight auth-style flow is needed without a backend.
- React (component UI)
- Vite (dev server and build)
- Tailwind CSS v4 (via
@tailwindcss/viteand@themeinsrc/index.css) - Rubik font (bundled in
src/assets/fonts)
- React Router (client-side routes)
- ESLint (React hooks + React refresh config)
- Prettier +
prettier-plugin-tailwindcss - GitHub Actions workflow for GitHub Pages deployment
This is a client-only SPA. Navigation is handled by React Router, and user data is stored in the browser.
graph TD
User --> UI[React UI]
UI --> Router[React Router]
UI --> Storage[localStorage]
.
├─ .github/
│ └─ workflows/gh-pages.yml
├─ public/
│ ├─ android-chrome-192x192.png
│ ├─ android-chrome-512x512.png
│ ├─ apple-touch-icon.png
│ ├─ favicon-16x16.png
│ ├─ favicon-32x32.png
│ ├─ favicon.ico
│ └─ site.webmanifest
├─ src/
│ ├─ assets/
│ ├─ components/
│ ├─ screens/
│ ├─ App.jsx
│ ├─ index.css
│ └─ main.jsx
├─ index.html
├─ package.json
└─ vite.config.js
src/: application code (screens, components, styles).src/screens/: page-level views (home, sign-in, sign-up, profile).src/components/: reusable form and button UI.src/assets/: static assets (icons, images, fonts).public/: static icons and manifest used by the HTML shell..github/workflows/: GitHub Pages build/deploy workflow.
src/main.jsx
- Purpose: app entry point, mounts React into the document and wires routing.
- Interactions: loads global styles from
src/index.cssand renderssrc/App.jsxinsideBrowserRouter.
src/App.jsx
- Purpose: top-level route map and app shell.
- Interactions: reads
user_datafromlocalStorageand passes it intoSignInandProfilescreens. - Design decisions: routes unknown paths back to
/.
src/screens/signup.jsx
- Purpose: collects account details and creates a local user record.
- Interactions: uses
Input,RadioGroup, andButtoncomponents; writes tolocalStorageand navigates to/profile. - Design decisions: client-side validation for email, phone, and password length.
src/screens/signin.jsx
- Purpose: sign-in form for existing users.
- Interactions: validates inputs, writes login state to
localStorage, and navigates to/profile. - Design decisions: redirects to sign-up if no
user_datais found.
src/screens/profile.jsx
- Purpose: displays stored user information and allows logout.
- Interactions: reads
userDataprops, uses assets fromsrc/assets, and setsisLoggedIntofalseon logout.
src/components/button.jsx
- Purpose: shared button with optional navigation.
- Interactions: uses
useNavigateto support anhrefprop for route changes.
src/index.css
- Purpose: Tailwind v4 setup, design tokens, and base layout styling.
- Design decisions: uses
@themevariables and a fixed, centered device-sized layout.
vite.config.js
- Purpose: Vite configuration and path aliases.
- Interactions: sets
basefromVITE_BASE_PATHand defines@alias tosrc.
Typical usage path:
- User opens the home screen.
- User signs up or signs in.
- The app saves form data to
localStorageand navigates to the profile screen. - Clicking the camera icon in the profile header logs the user out and returns to
/.
Prerequisites:
- Node.js and npm
Install dependencies:
npm installDevelopment server:
npm run devProduction build:
npm run buildPreview the production build locally:
npm run previewLint the codebase:
npm run lintEnvironment variables used by the build:
| Variable | Description | Required |
|---|---|---|
VITE_BASE_PATH |
Base path for the app when deployed (used by Vite and the GitHub Pages workflow). | No (local), Yes for GitHub Pages |
- Open the app in the browser.
- Choose Create Account or Already Registered? Login.
- Fill the form and submit.
- View the profile screen with your stored details.
- No backend or real authentication; all data is stored in
localStorage. - Sign-in does not validate against a real user store; it simply writes the entered values to
localStorage. - Clearing browser storage resets the user state.