Simple HTTP Auth designed
This commit is contained in:
60
specs/005-simple-http-auth/quickstart.md
Normal file
60
specs/005-simple-http-auth/quickstart.md
Normal file
@@ -0,0 +1,60 @@
|
||||
# Quickstart: Simple HTTP Auth
|
||||
|
||||
This document provides a quick guide to setting up and testing the Simple HTTP Auth feature.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
- Node.js (LTS)
|
||||
- npm (usually comes with Node.js)
|
||||
- Docker and Docker Compose (for running the full application stack)
|
||||
|
||||
## Setup
|
||||
|
||||
1. **Clone the repository**:
|
||||
```bash
|
||||
git clone <repository_url>
|
||||
cd unisono
|
||||
```
|
||||
|
||||
2. **Create a `.env` file in the `backend/` directory**:
|
||||
```
|
||||
cd backend
|
||||
touch .env
|
||||
```
|
||||
Add the following line to `backend/.env`, replacing `YOUR_PASSPHRASE_HERE` with your desired secret passphrase:
|
||||
```
|
||||
AUTH_PASSPHRASE=YOUR_PASSPHRASE_HERE
|
||||
```
|
||||
*Note: If `AUTH_PASSPHRASE` is missing or empty, the application will start without authentication.*
|
||||
|
||||
3. **Build and run the application using Docker Compose**:
|
||||
```bash
|
||||
cd ../.. # Go back to the project root if you are in backend/
|
||||
docker-compose up --build
|
||||
```
|
||||
This will build the frontend and backend services and start them.
|
||||
|
||||
## Usage
|
||||
|
||||
1. **Access the application**:
|
||||
Open your web browser and navigate to `http://localhost:80`.
|
||||
|
||||
2. **Enter the passphrase**:
|
||||
You will be presented with a screen prompting you to enter the passphrase. Enter the passphrase you configured in `backend/.env`.
|
||||
|
||||
3. **Access the SPA**:
|
||||
Upon successful authentication, you will gain access to the Single Page Application. Your access will be preserved for the duration of your browser session.
|
||||
|
||||
## Testing
|
||||
|
||||
To run the tests for the backend and frontend:
|
||||
|
||||
```bash
|
||||
# For backend tests
|
||||
cd backend
|
||||
npm test
|
||||
|
||||
# For frontend tests
|
||||
cd frontend
|
||||
npm test
|
||||
```
|
||||
Reference in New Issue
Block a user