MCPcopy Create free account
hub / github.com/Chinwike1/redux-user-auth

github.com/Chinwike1/redux-user-auth @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
34 symbols 86 edges 33 files 0 documented · 0% updated 7mo ago★ 87

Browse by type

Functions 19 Types & classes 15
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

User Authentication with Redux Toolkit

Authentication workflow built with the MERN stack, Redux Toolkit & TypeScript. Project demo here

Redux Toolkit authentication demo

Features

  • User Authentication — Login & Register
  • MongoDB
  • Application context with Redux Toolkit
  • Data fetching with RTK Query
  • Protected routes with React Router v6
  • JWT storage with localStorage
  • Automatically fetches user details on page load — Header.tsx
  • TailwindCSS v4 with Dark Mode

Usage

Starter files

If you're following along with the blog post, clone the starter-files branch with the following command:

git clone --branch starter-files --single-branch https://github.com/Chinwike1/redux-user-auth.git

MongoDB Setup

Follow this guide on "Getting started with MongoDB Atlas" to setup your database.

Environment Variables

Environment variables are shown in .env.example files.

Install Dependencies

Run this command first in both dev and production to install dependencies in root, /backend & /frontend:

pnpm run install:all

Start development server

# Run frontend (:5173) & backend (:5000)
pnpm run dev

# Run backend only
pnpm run dev:server

# Run frontend only
pnpm run dev:client

Build

# Build both backend and frontend
pnpm run build

# Build backend only (TypeScript compilation)
pnpm run build:backend

# Build frontend only (Vite production build)
pnpm run build:frontend

Production

# First, build the project
pnpm run build

# Start the production server (serves built frontend)
pnpm start

Docker

You can also deploy using Docker and Docker Compose:

# Build and run with docker compose
docker compose up --build

The container runs on port 5000. Make sure to set the required environment variables (MONGO_URI, JWT_SECRET) either in a .env file or pass them directly to Docker Compose.

License

GPL-3.0 — Open source license. Software can be used, copied, modified, e.t.c, free of charge.

Extension points exported contracts — how you extend this code

browse all types & interfaces →

Core symbols most depended-on inside this repo

browse all functions →

Shape

Function 18
Interface 15
Method 1

Languages

TypeScript100%

Modules by API surface

backend/types/index.ts7 symbols
frontend/src/types/index.ts5 symbols
frontend/src/screens/RegisterScreen.tsx3 symbols
frontend/src/screens/LoginScreen.tsx2 symbols
frontend/src/components/ThemeSwitcher.tsx2 symbols
frontend/src/components/Error.tsx2 symbols
backend/middleware/errorMiddleware.ts2 symbols
frontend/src/screens/ProfileScreen.tsx1 symbols
frontend/src/screens/HomeScreen.tsx1 symbols
frontend/src/routing/ProtectedRoute.tsx1 symbols
frontend/src/features/auth/authActions.ts1 symbols
frontend/src/components/Spinner.tsx1 symbols

Datastores touched

UserCollection · 1 repos
(mongodb)Database · 1 repos

For agents

$ claude mcp add redux-user-auth \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page