npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

test-auth-sdk

v1.0.1

Published

A tool for creating project structures with customizable templates.

Readme

Test Auth SDK

Overview

The Test Auth SDK is a complete authentication package for React and Node.js applications. It allows developers to quickly set up authentication in their projects with a pre-defined folder structure for both frontend and backend. This package includes React components, routes, and backend logic to handle user authentication.

Features

  • Frontend: React components and routing for authentication (Signup, Login, Profile, etc.).
  • Backend: Express.js routes and controllers for handling authentication with MongoDB.
  • Pre-built folder structure to organize your codebase efficiently.
  • Easy-to-use templates for starting new projects.

Installation

To install and set up the project, run the following command:

npx test-auth-sdk

This will automatically create the project structure and all required files in the current directory.

Project Structure

The SDK generates the following folder structure:

.
├── backend
│   └── src
│       ├── controllers
│       │   └── authController.js
│       ├── middleware
│       │   └── authMiddleware.js
│       ├── models
│       │   └── User.js
│       ├── routes
│       │   └── authRoutes.js
│       └── server.js
├── frontend
│   └── src
│       ├── components
│       │   ├── Navbar.jsx
│       │   └── Auth
│       │       ├── Login.jsx
│       │       └── Signup.jsx
│       ├── pages
│       │   ├── Home.jsx
│       │   ├── Dashboard.jsx
│       │   ├── Profile.jsx
│       │   └── NotFound.jsx
│       ├── routes.jsx
│       ├── App.jsx
│       ├── main.jsx
│       └── index.css
├── templates
│   ├── package.json
│   ├── tsconfig.json
│   ├── app.ts
│   └── server.js
├── .gitignore
└── package.json

Frontend Details

The frontend is built using React and is organized into the following folders:

  • components/

    • Navbar.jsx: A reusable navigation bar component.
    • Auth/
      • Login.jsx: Login form component.
      • Signup.jsx: Signup form component.
  • pages/

    • Home.jsx: The homepage.
    • Dashboard.jsx: A protected page that requires authentication.
    • Profile.jsx: A user profile page that displays user details.
    • NotFound.jsx: A 404 error page.
  • routes.jsx: Manages application routing.

  • App.jsx: Main application component.

  • main.jsx: Entry point of the React app.

  • index.css: Global styles.

Backend Details

The backend is built using Express.js and organized as follows:

  • controllers/

    • authController.js: Contains logic for signup, login, logout, and getting user profile.
  • middleware/

    • authMiddleware.js: Middleware to protect routes by verifying JWT tokens.
  • models/

    • User.js: MongoDB schema for user data.
  • routes/

    • authRoutes.js: Routes for authentication endpoints (e.g., login, signup, profile).
  • server.js: Entry point for the backend server.

Usage

Running the Backend

  1. Navigate to the backend directory:
    cd backend
  2. Install dependencies:
    npm install
  3. Start the server:
    npm start
    The backend server will run on http://localhost:5000 by default.

Running the Frontend

  1. Navigate to the frontend directory:
    cd frontend
  2. Install dependencies:
    npm install
  3. Start the React development server:
    npm start
    The frontend app will run on http://localhost:5173 by default.

API Endpoints

Authentication Endpoints

  • POST /api/auth/signup: Register a new user.
  • POST /api/auth/login: Authenticate and retrieve a JWT token.
  • POST /api/auth/logout: Invalidate the user's session.
  • GET /api/auth/profile: Retrieve the authenticated user's profile (protected).

Templates

The templates folder contains default templates for:

  • package.json: A pre-configured Node.js project.
  • tsconfig.json: TypeScript configuration for the backend.
  • server.js: Entry point for the backend.
  • app.ts: Example TypeScript server setup.

Customization

Feel free to modify the files and templates according to your project requirements. For example, you can:

  • Add more routes or pages to the frontend.
  • Extend the backend with additional functionality.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Contributing

Contributions are welcome! If you encounter any issues or have suggestions for improvements, please open an issue or submit a pull request.

Support

For support or questions, please contact [[email protected]] or open an issue on the repository. More changes would be added with time