React + Vite + Tailwind codebase containing real world examples (CRUD, auth, advanced patterns, etc) that adheres to the RealWorld spec and API.
This codebase was created to demonstrate a fully fledged fullstack application built with React, Vite, TypeScript, Tailwind CSS, and shadcn/ui including CRUD operations, authentication, routing, pagination, and more.
- Framework: React (with Vite)
- Language: TypeScript
- Styling: Tailwind CSS & shadcn/ui
- State Management: Zustand (Client state) & TanStack Query (Server state)
- Routing: React Router v7
- Forms: React Hook Form & Zod
- Rich Text Editor: Lexical
- HTTP Client: Axios
- Authentication: Login, Register, JWT handling.
- Articles: Create, Read, Update, Delete (CRUD) articles.
- Rich Text Editor: Custom Lexical-based editor for writing articles.
- Comments: Comment on articles.
- Social: Follow users, favorite articles.
- Tags: Filter articles by tags.
- Profile: User profile pages with their articles and favorites.
- Responsive Design: Mobile-friendly UI using Tailwind.
This frontend application is built to consume the API provided by the Django Rest Framework Backend. Please refer to that repository for backend setup and API documentation.
- Node.js (Latest LTS recommended)
- npm, yarn, or pnpm
- Clone the repository.
- Navigate to the frontend project directory:
cd frontend - Install dependencies:
npm install
- Create a
.envfile in thefrontenddirectory. - Set the API URL (defaults to localhost if not set, but good practice to define):
VITE_API_URL=http://localhost:8000/api
Start the development server:
npm run devThe application will be available at http://localhost:5173.
To build the application for production:
npm run buildTo preview the production build:
npm run previewThe source code is located in frontend/src:
components: Reusable UI components (including shadcn/ui primitives).hooks: Custom React hooks (React Query mutations, local storage, etc.).layouts: Layout wrappers (Main, Home, Profile, etc.).lib: Utilities, API client configuration, auth helpers.pages: Route components (Login, Editor, ArticleDetails, etc.).schemas: Zod validation schemas.stores: Zustand stores (User, Page persistence).types: TypeScript interface definitions.
MIT


