Skip to content

krjj/auth

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gitmoji

About

Auth is flexible authentication solution.

✨ Features

  • Is nodejs based.
  • Stores session data in redis store.
  • Persistent data stored in MongoDB.
  • Has active session management functionality.
  • Can display all the logged in/active session.
  • Has ability to perform targeted session invalidation.
  • Has ability to logout from all the sessions.
  • Can store session context data such as : ip, login-time, device.
  • IP to location resolver using GeoLite IP.
  • Has configurable session TTL. Default is 86400 seconds.

💽 Installation

Clone this repo

git clone https://github.com/krjj/auth.git

then install dependencies

yarn install 
or
npm install

🔧 Usage

To start the server in production mode

yarn run start

⚠️ Development mode

yarn run dev

💻 Live Demo

For demo purpose the instance is running on the DO Droplet. Location of the API Server - API Server.

The above server is configured in following way -

  1. Nginx as a reverse proxy.
  2. HTTPS connections handled by Nginx.
  3. Letsencrypt SSL cert generated.
  4. Node-based Auth API Server managed by PM2. Running in daemonized form.
  5. Uses hosted Redis Database. Provided by Redis Labs.
  6. Uses hosted MongoDB provided by Mongo Atlas.

Access demo front-end here

🤖 Environment variables

All the environment variables are store in .env file.

Variable Description
redis-host Host name or an IP address
redis-port Redis port
redis-password If your instance is password protected, used for authentication
mongo-connect-uri Url with mongodb+srv:// protocol
session-ttl-secs Defines how long session should be valid after which the session is invalidated automatically. Default is 86400 seconds or 1 Day.

🛠 Technology Stack

  • NodeJS
  • Fastify
  • Redis
  • MongoDB

🤝 Contribute PRs Welcome

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

📜 License

MIT

About

Authentication Service 🔐

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors