A standard, minimal authentication system with node, express, passport, and mongodb. Built as an ideal starting point for web-based applications. Includes a basic front-end, with a jQuery SPA dashboard.
JavaScript HTML
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
app
config
public
.gitattributes
.gitignore
README.md
nodemon.json
package.json
server.js
settings.json

README.md

Mini-Auth

A standard, minimal authentication system with node, express, passport, and mongodb. Built as an ideal starting point for web-based applications. Includes a basic front-end, with a jQuery SPA dashboard. Scroll for setup and feature set.

Setup

If you're interested in using Mini-Auth in your application, setup is relatively simple. You'll need node and npm installed, as well as a mongodb database (local or otherwise).

  1. Clone this project's contents into a new folder for your app.
  2. Run 'npm install' (minus quotes) in the command prompt/terminal on your app folder.
  3. Open /config/database.js and modify the url key to point to your Mongodb installation.
  4. Ensure "setupComplete" in settings.json is set to "false" in order to setup your first super-admin user.
  5. Run 'node server' in the command prompt/terminal on your app folder. If you did everything right, you should find the app at localhost:8080 in your web browser. (optional) Install Nodemon globally and use it to launch the server.

Once the app is running, visit localhost:8080/setup to create your first super-admin user.

Features: 1.3.0-alpha

This release includes the following features:

  • User login/signup; passwords stored in secure salted hashes.
  • One-time setup to create first super-admin (can be reset to go again via settings.json).
  • Routing and public views for homepage, user profile page, login page, and signup page. Additional dashboard view accessible only by admins.
  • User CRUD API that returns json data.
  • User roles (user, admin, and super-admin).
  • Admin users can remove other users, promote users to admins, demote admins to users, and create new users (without a password). This will be refined over time and more features will be added.
  • Super admins have the same permissions as admins but cannot be deleted.
  • Basic jQuery SPA for admin's dashboard which lets the admin delete/promote/demote/create users in a simple web page without reloads.

Future features:

  • More refined and modular User API.
    • Full, modular CRUD capability.
    • Integrate admin middleware to necessary routes.
    • Paginated results for getting all users.
    • More that I haven't even thought up yet.
  • Dashboard and front-end updates for new features as they get implemented.
  • Configurable User roles
  • Email-only signups (in progress/partially-updated).
  • Password reset.
  • Admin controls to force a password reset, as well as create users.
  • Email account confirmation.
  • Login rate-limiting (may need to be updated later).
  • More extensive comments.
  • (maybe) Dummy database migration/seed.

Got a feature idea/request?

Make yourself heard in the Issues section or send me an email at me (at) millansingh.com with the subject line, 'Mini-Auth Feature Request'.

Check out some of my other work:

My portfolio website.

Relevant Disclaimers:

This software should be considered unstable, in that it will change a lot between versions. It should work more or less without bugs however (there is an issue with an admin demoting themself in the dashboard confusing the router).

If you use this software in an app or website, I would appreciate a mention in the site's footer, something like 'Made with Mini-Auth' that links to this Github repo. In the future, I may provide a badge. You are not required to do this, but you'd be making a fellow developer very :).