Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/n2duc/jwt-authentication
Authentication for web applications using JWT, React, Express, MongoDB
https://github.com/n2duc/jwt-authentication
express jwt mongodb react
Last synced: about 13 hours ago
JSON representation
Authentication for web applications using JWT, React, Express, MongoDB
- Host: GitHub
- URL: https://github.com/n2duc/jwt-authentication
- Owner: n2duc
- Created: 2024-06-26T13:04:54.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2024-07-18T19:43:43.000Z (4 months ago)
- Last Synced: 2024-07-19T03:36:25.188Z (4 months ago)
- Topics: express, jwt, mongodb, react
- Language: TypeScript
- Homepage:
- Size: 293 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
N2Dev - JWT AuthenticationThis repository contains the code for my authentication repo, where I share my thoughts, projects, and insights. Feel free to explore and get inspired.
## ✨ Features
- ⚡️ Express.js for Server
- ⚛️ React.js with Typescript for Client
- 🎨 Tailwind CSS - for styling
- 🌈 Shadcn UI - accessible UI components
- 🛡 Strict TypeScript and ESLint configuration
- 🔒 Jsonwebtoken - Authentication
- 🍀 MongoDB - Store database## 🔨 Requirements
- [Node.js](https://nodejs.org) `>=20.0.0`
- [Yarn](https://yarnpkg.com/) - package manager
- [Visual Studio Code](https://code.visualstudio.com/)## 👋 Getting Started
Follow these steps to run the project locally on your machine:
1. Clone the repository
```bash
git clone https://github.com/n2duc/jwt-authentication.git
```2. Navigate to the project directory
```bash
cd jwt-authentication
```Stay in folder, redirect to Front-end:
```bash
cd web-client-vite
```And Back-end:
```bash
cd api-server
```3. Change environment variables in .env file
In FE:
```bash
VITE_API_URL = 'your-api-endpoint'
```In BE:
```bash
MONGO_DB_URI = 'mongo-db-uri-here'
PORT = 'port server here'
ACCESS_TOKEN_SECRET_SIGNATURE = 'JWT secret signature here'
REFRESH_TOKEN_SECRET_SIGNATURE = 'JWT secret signature here'
```4. Install dependencies (common to both FE & BE)
```bash
yarn install
```5. Run the development server (common to both FE & BE)
```bash
yarn dev
```
From N2Dev with Love ❤️❤️🔥