JSONConnect is a complete web application built as an educational showcase for the capabilities of agentic AI. It acts as a unified social dashboard, interacting exclusively with the JSONPlaceholder public mock API.
This application was autonomously designed and built by Google Antigravity, through a process known as "Vibe Coding."
JSONConnect transforms the disparate, raw REST resources provided by JSONPlaceholder (Users, Posts, Comments, Todos, Albums, Photos) into a cohesive, user-friendly social network interface.
- Global Feed (
/): A dynamic feed displaying all network posts. Includes a post creation form and inline, toggleable comment threads. - Network Directory (
/users): A visually appealing directory grid to discover other users on the platform, featuring their contact details and company information. - Interactive User Profiles (
/users/:id): A comprehensive, tabbed profile view for individual users containing:- Posts: A timeline of the user's recent posts.
- Todos: An interactive, scrollable task list.
- Albums: A stunning gallery view where album cards preview thumbnails, and clicking an album opens a full-screen, responsive photo viewer modal.
The application adheres to strict architectural constraints: No backend services, no local databases, and direct API interaction only.
- Frontend Framework: React (scaffolded via Vite for instant HMR and optimized builds).
- State Management & Data Fetching: TanStack Query (React Query). Chosen specifically for its elegant caching mechanisms and built-in support for complex optimistic UI updates.
- Routing: React Router DOM for seamless Single Page Application navigation.
- Styling: Vanilla CSS with CSS Modules. This ensures style encapsulation and a tailored, premium glassmorphism aesthetic without relying on external utility frameworks like Tailwind CSS.
- Icons: Lucide React for clean, modern iconography.
Because JSONPlaceholder does not actually persist state mutations (POST, PUT, DELETE), JSONConnect heavily utilizes Optimistic UI Updates to provide a flawless user experience.
When a user creates a post, deletes a post, or toggles a Todo status:
- Outgoing network refetches are immediately cancelled.
- The current cache state is snapshotted.
- The UI cache is instantly updated with the new state (e.g., the post disappears, or the checkmark appears), providing zero-latency feedback to the user.
- If the mock API request fails, the application seamlessly rolls back to the snapshotted state.
This project was built based on a comprehensive PRD provided to the Antigravity agent. For full details, please refer to the Product Requirements Document (PRD).
src/
├── api/
│ └── client.js # Axios configuration & mock user constants
├── components/
│ ├── domain/ # Feature-specific components (PostCard, AlbumCard, TodoItem)
│ ├── layout/ # Structural components (Navbar)
│ └── ui/ # Shared, reusable primitives (Button, Loader, Modal)
├── hooks/ # TanStack Query custom data hooks
│ ├── usePosts.js # Queries/Mutations for Posts & Comments
│ ├── useUsers.js # Queries/Mutations for Users & Todos
│ └── useAlbums.js # Queries for Albums & Photos
├── pages/ # Route entry points (Feed, Users, Profile)
├── App.jsx # App layout wrapper and Route definitions
├── main.jsx # React root, Router, and QueryProvider setup
└── index.css # Global CSS variables, resets, and design system tokens
To run this project on your local machine:
-
Install Dependencies
npm install
-
Start the Development Server
npm run dev
-
Build for Production
npm run build
This application is fully containerized and optimized for deployment to Google Cloud Run.
The provided Dockerfile uses a multi-stage build:
- It builds the Vite/React application using a Node.js image.
- It serves the static assets using a lightweight Nginx image.
- A custom
nginx.confensures that React Router's client-side routing works correctly and that Nginx listens on port8080, which is the default port expected by Cloud Run.
gcloud run deploy jsonconnect \
--source . \
--platform managed \
--region us-central1 \
--allow-unauthenticatedTo learn more about the concepts and patterns utilized in this project, explore the following resources:
- Vibe Coding Paradigm: Vibe Coding Handbook - The official Google tutorial on agentic development.
- Optimistic UI Updates: TanStack Query Documentation - Explains how to update the UI before a mutation completes for a snappy user experience.
- Component-Based Architecture: Thinking in React - Guidelines on breaking down UIs into reusable, focused components.
- Containerizing React Apps: Dockerizing a React App - Best practices for building efficient Node.js Docker images.
