Skip to content

Commit

Permalink
docs: update README for clarity and completeness
Browse files Browse the repository at this point in the history
  • Loading branch information
rashidpathiyil committed Apr 1, 2024
1 parent 25d2660 commit 9159485
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 10 deletions.
62 changes: 54 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ Find and replace all on all files (CMD+SHIFT+F):
- Description: My new Nuxt module
-->

# My Module
# App Lock for Nuxt 3

[![npm version][npm-version-src]][npm-version-href]
[![npm downloads][npm-downloads-src]][npm-downloads-href]
[![License][license-src]][license-href]
[![Nuxt][nuxt-src]][nuxt-href]

My new Nuxt module for doing amazing things.
The **App Lock** module adds a password protection layer to your Nuxt 3 applications, ideal for controlling access during development or quality control (QC) phases. This module is designed to prevent search engines from indexing development sites and to restrict unauthorized access to non-production environments.

- [ Release Notes](/CHANGELOG.md)
<!-- - [🏀 Online playground](https://stackblitz.com/github/your-org/my-module?file=playground%2Fapp.vue) -->
Expand All @@ -23,19 +23,65 @@ My new Nuxt module for doing amazing things.
## Features

<!-- Highlight some of the features your module provide here -->
- &nbsp;Foo
- 🚠 &nbsp;Bar
- 🌲 &nbsp;Baz
- **Environment-Driven Activation**: The lock screen is enabled only when the `APP_LOCK_PASSWORD` environment variable is set, ensuring that production environments remain unaffected.
- **Password Protection**: Access to the Nuxt application requires entering a valid password, defined in the environment variable `APP_LOCK_PASSWORD`.
- **Prevention of Indexing and Unauthorized Access**: Helps to prevent search engines from indexing development sites and restricts public access to QC or development environments.

## Quick Setup

## Quick Setup

Install the module to your Nuxt application with one command:

```bash
npx nuxi module add my-module
npx nuxi module add @rashidpathiyil/app-lock
```

OR

## Installation

1. **Install the Module**

```bash
npm install @rashidpathiyil/app-lock
```

or if you use yarn:

```bash
pnpm add @rashidpathiyil/app-lock
```

2. **Configure Nuxt**

Add the module to your `nuxt.config.ts` file:

```ts
export default defineNuxtConfig({
modules: ['@rashidpathiyil/app-lock'], // Replace with your actual module name
})
```

## Configuration

1. **Set the Environment Variable**

Define the `APP_LOCK_PASSWORD` in your `.env` file to activate the App Lock.

```env
APP_LOCK_PASSWORD=yourpasswordhere
```

That's it! You can now use My Module in your Nuxt app ✨
Replace `yourpasswordhere` with the password you wish to use for accessing your Nuxt application.

## Usage

When the `APP_LOCK_PASSWORD` environment variable is set, the App Lock screen will automatically activate, requiring users to enter the password to access the application. If the variable is not set or is removed, the App Lock screen will not appear, allowing normal access to the application.

## Security Note

- This module is intended for use in development and QC environments. Do not rely on it as the sole security measure for sensitive or production environments.
- Always ensure your environment variables are securely managed and not exposed in your application's client-side code.


## Contribution
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "app-lock",
"version": "1.0.0",
"description": "Lock your nuxt application with a password",
"repository": "your-org/my-module",
"description": "The App Lock module adds a password protection layer to your Nuxt 3 applications",
"repository": "https://github.com/rashidpathiyil/app-lock",
"license": "MIT",
"type": "module",
"exports": {
Expand Down

0 comments on commit 9159485

Please sign in to comment.