This episode guides you through creating your first Redux store with configureStore, introduces the default middleware and built-in DevTools, and wraps the application with Provider from react-redux. You'll also organize the app folder for the store and the features folder for per-feature slices.

The first two episodes gave you the theory and the architectural map. Now it's time to write real code. Episode 3 is the first step every Redux application uses: creating the store and connecting it to React.
We'll use configureStore, wrap the application with Provider from react-redux, and organize a clean project structure using the app/ and features/ pattern. By the end of this episode, you'll have a store that actually runs — even though there aren't any slices filling state in it yet.
configureStore is the official way to create a store in Redux Toolkit. It does a lot automatically that used to require manual setup: installs default middleware, connects Redux DevTools, and combines reducers.
import { configureStore } from "@reduxjs/toolkit"
export const store = configureStore({
reducer: {
counter: counterReducer,
},
})
export type RootState = ReturnType<typeof store.getState>
export type AppDispatch = typeof store.dispatchconfigureStore accepts a configuration object; the reducer property can be a single reducer or a map of named reducers. export type RootState and AppDispatch will be used for typing — full details in episode 7.
With no configuration at all, configureStore already installs:
import logger from "redux-logger"
export const store = configureStore({
reducer: {},
middleware: (getDefaultMiddleware) => getDefaultMiddleware().concat(logger),
})getDefaultMiddleware().concat(logger) is the pattern for inserting extra middleware alongside the defaults. This approach is used in episodes 12 and 16.
The store can't be read by components until we wrap the application with Provider from react-redux. Provider accepts the store prop and makes the store available across the entire component tree.
import { Provider } from "react-redux"
import { store } from "./app/store"
createRoot(document.getElementById("root")!).render(
<Provider store={store}>
<App />
</Provider>,
)<Provider store={store}> makes the store accessible from any component through the useSelector and useDispatch hooks — with no prop drilling at all. Provider is usually placed as high as possible, right at the root of the application.
The pattern recommended by the Redux team is to separate the app/ and features/ folders:
src/
app/
store.ts
features/
counter/
counterSlice.ts
Counter.tsx
main.tsxapp/ holds application-global concerns: store creation and, later, typed hooks like useAppSelector. It doesn't contain feature logic.
features/ holds one folder per feature. Each folder contains the slice, components, and supporting files that belong only to that feature. The counter slice, the Counter component, and its tests live together in features/counter/.
This pattern is called feature-based folders. Its advantage: features can be moved, removed, or lazy-loaded independently. We'll cover combining this pattern with combineSlices for lazy loading in episode 11.
Tip
Avoid type-based structures like folders named components and reducers at the root. Feature-based folders keep code close to its owner so it's easy to maintain as the team and application grow.
Check that the whole chain is connected by running the application:
npm run devOpen Redux DevTools in the browser. You'll see a tab showing an empty store or a store containing the newly created slice. If DevTools displays the state, Provider and the store are connected correctly.
Episode 3 completes the Redux infrastructure foundation: the store is created with configureStore, the application is wrapped with Provider, and the app/ and features/ folder structure is ready to use. This empty store will start filling up in the next episode.
Key takeaways:
configureStore creates a store with default middleware and DevTools automatically.middleware: (getDefaultMiddleware) => ... is how you insert additional middleware.Provider from react-redux provides the store to every component.Provider at the root of the application.app/ folder for the store; the features/ folder for per-feature slices.In the next episode, episode 4, we'll fill that store with createSlice and reducers — writing your first slice with name, initialState, and reducers, experiencing the ease of draft mutation thanks to Immer, and handling external actions through extraReducers.