https://github.com/yuriyvyatkin/redux-user-auth
https://github.com/yuriyvyatkin/redux-user-auth
Last synced: 8 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/yuriyvyatkin/redux-user-auth
- Owner: yuriyvyatkin
- License: gpl-3.0
- Created: 2023-04-17T16:22:23.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2023-04-17T16:26:25.000Z (over 2 years ago)
- Last Synced: 2025-01-04T01:38:24.490Z (9 months ago)
- Language: JavaScript
- Size: 324 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# User Authentication with Redux Toolkit
Authentication workflow built with the MERN stack & Redux Toolkit. [Project demo here](https://redux-user-auth.herokuapp.com/)## Features
* User Login & Register
* Protected routes with React Router v6
* JWT storage with localStorage
* Automatically fetches user details on page load (Header.js)
* Redux Toolkit's `createAsyncThunk`## Usage
### Starter files
Clone the `starter-files` branch with the following command:```bash
git clone --branch starter-files --single-branch https://github.com/Chinwike1/redux-user-auth.git
```### ES Modules in Node
ECMAScript is used on the backend instead of CommonJS. This requires you to add the `.js` extension when importing a file — not package.### MongoDB Setup
[Getting started with MongoDB Atlas](https://www.mongodb.com/docs/atlas/getting-started/)### Environment Variables
```
NODE_ENV = development
PORT = 5000
MONGO_URI = 'insert_your_mongodb_uri'
JWT_SECRET = "any_string"
```### Install Dependencies
Backend & Frontend
```
npm install
cd frontend
npm install
```### Available Scripts
```bash
# Run frontend (:3000) & backend (:5000)
npm run dev# Run backend only
npm run server# Run frontend only
npm run client
```## License
GPL-3.0 — Open source license. Software can be used, copied, modified, e.t.c, free of charge.