This codebase containing real world examples (CRUD, auth, advanced patterns, etc) that adheres to the RealWorld spec and API. Powered by FSD (Feature-Sliced Design) architectural methodology.
As part of the solution to the issues caused by recent changes to the RealWorld API specifications, Iβve forked an backend and created a fully compatible alternative with RealWorld Express + Prisma.
This fork addresses the challenges caused by the deletion of the official API server and demo deployment, and it implements the updated API specifications to keep the project running smoothly.
To get the backend up and running, you can find instructions on how to install and set it up in the RealWorld Express + Prisma repository.
Feel free to contribute or reach out if you have any questions or suggestions!
The example application is a social blogging site (i.e. a Medium.com clone) called "Conduit". It uses a custom API for all requests, including authentication.
- Lazy Loading for React Components and React Router β Components and routes are dynamically loaded only when needed, improving initial load times and optimizing performance.
- React Suspense β Used for handling asynchronous component loading, providing a smooth user experience while waiting for data to load.
- Error Boundaries β Ensures the application remains stable by catching JavaScript errors in component trees and displaying fallback UIs instead of crashing the app.
- Optimistic Updates with React Query β Provides an enhanced user experience by updating the UI immediately before waiting for the server response, making interactions feel faster.
- Lazy Loading for Redux Slices β Dynamically loads Redux slices when required, reducing the initial bundle size and improving app efficiency.
- Zod Validation for Backend Responses β Ensures API responses adhere to expected structures using Zod contracts, improving reliability and preventing unexpected runtime errors.
General functionality:
- Authenticate users via JWT (login/signup pages + logout button on settings page)
- CRU- users (sign up & settings page - no deleting required)
- CRUD Articles
- CR-D Comments on articles (no updating required)
- GET and display paginated lists of articles
- Favorite articles
- Follow other users
To get the frontend running locally:
- Clone this repo
yarn install
to install all the dependencies defined in apackage.json
file.yarn start
to start webpack dev server.
This project is fully compatible with my RealWorld Express + Prisma backend implementation.
To set up the backend:
- Follow the installation instructions in the RealWorld Express + Prisma repository.
- Ensure the backend is running locally or deployed.
yarn start
- Runs the Webpack development server withwebpack serve
, using development mode.yarn build:dev
- Compiles the project in development mode using Webpack.yarn build:prod
- Compiles the project in production mode using Webpack for optimized output.yarn analyze
- Builds the project in development mode and enables Webpack Bundle Analyzer for visualizing bundle contents.yarn test
- Runs Jest to execute unit tests.yarn eslint
- Runs ESLint to lint thesrc
directory, automatically fixing issues and ensuring no unused disable directives remain.yarn prettier
- Formats the entire project using Prettier, respecting.gitignore
rules.yarn graph
- Generates a dependency graph of thesrc
directory usingdependency-cruiser
.1
Footnotes
-
This assumes the GraphViz
dot
command is available - on most linux and comparable systems this will be. In case it's not, see GraphViz' download page for instructions on how to get it on your machine. β©