Skip to content

About

A mobile-first React SPA implementing a PopX-style onboarding flow (signup, signin, profile) with client-side validation and localStorage state. Built using Vite, React Router, and Tailwind CSS, featuring clean architecture and seamless navigation.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

PopX ✨

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.

Vite React React Router Tailwind CSS GitHub Pages


What This Project Is 🧭

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.


Tech Stack 🧰

Core Framework

  • React (component UI)
  • Vite (dev server and build)

UI / Styling

  • Tailwind CSS v4 (via @tailwindcss/vite and @theme in src/index.css)
  • Rubik font (bundled in src/assets/fonts)

Routing

  • React Router (client-side routes)

Tooling

  • ESLint (React hooks + React refresh config)
  • Prettier + prettier-plugin-tailwindcss
  • GitHub Actions workflow for GitHub Pages deployment

Architecture Overview 🏗️

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]
Loading

Project Structure 🗂️

.
├─ .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.

Core Modules 🧩

src/main.jsx

  • Purpose: app entry point, mounts React into the document and wires routing.
  • Interactions: loads global styles from src/index.css and renders src/App.jsx inside BrowserRouter.

src/App.jsx

  • Purpose: top-level route map and app shell.
  • Interactions: reads user_data from localStorage and passes it into SignIn and Profile screens.
  • 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, and Button components; writes to localStorage and 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_data is found.

src/screens/profile.jsx

  • Purpose: displays stored user information and allows logout.
  • Interactions: reads userData props, uses assets from src/assets, and sets isLoggedIn to false on logout.

src/components/button.jsx

  • Purpose: shared button with optional navigation.
  • Interactions: uses useNavigate to support an href prop for route changes.

src/index.css

  • Purpose: Tailwind v4 setup, design tokens, and base layout styling.
  • Design decisions: uses @theme variables and a fixed, centered device-sized layout.

vite.config.js

  • Purpose: Vite configuration and path aliases.
  • Interactions: sets base from VITE_BASE_PATH and defines @ alias to src.

Runtime Flow 🔁

Typical usage path:

  • User opens the home screen.
  • User signs up or signs in.
  • The app saves form data to localStorage and navigates to the profile screen.
  • Clicking the camera icon in the profile header logs the user out and returns to /.

Setup & Installation 🛠️

Prerequisites:

  • Node.js and npm

Install dependencies:

npm install

Running the Project ▶️

Development server:

npm run dev

Production build:

npm run build

Preview the production build locally:

npm run preview

Lint the codebase:

npm run lint

Configuration ⚙️

Environment 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

Usage ✅

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

Limitations ⚠️

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

License 📄

MIT License. See License: MIT.

About

A mobile-first React SPA implementing a PopX-style onboarding flow (signup, signin, profile) with client-side validation and localStorage state. Built using Vite, React Router, and Tailwind CSS, featuring clean architecture and seamless navigation.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Contributors

Languages