docs: Add API testing section to README
- Document Bruno API testing collection with organized structure - Include comprehensive setup and usage instructions - Add reference to role-based registration restrictions - Explain admin-only endpoints and authentication requirements
This commit is contained in:
@@ -50,6 +50,35 @@ nano .env # or your preferred editor
|
|||||||
- `JWT_SECRET` - Secure random string for JWT authentication
|
- `JWT_SECRET` - Secure random string for JWT authentication
|
||||||
- `DBPASS` - PostgreSQL database password
|
- `DBPASS` - PostgreSQL database password
|
||||||
|
|
||||||
|
### API Testing
|
||||||
|
|
||||||
|
The `bruno/` directory contains a comprehensive API testing collection organized into logical subfolders for testing all endpoints:
|
||||||
|
|
||||||
|
#### **Collection Structure**
|
||||||
|
```
|
||||||
|
bruno/user/
|
||||||
|
├── auth/ # Authentication requests
|
||||||
|
│ ├── Login User.bru # POST /api/auth/login
|
||||||
|
│ └── Register User.bru # POST /api/auth/register (with restrictions)
|
||||||
|
├── admin/ # Admin-only management
|
||||||
|
│ ├── List Users.bru # GET /api/auth/users (admin only)
|
||||||
|
│ ├── Delete Account.bru # DELETE /api/auth/account (admin override)
|
||||||
|
│ └── Register Admin User.bru # POST /api/auth/register (admin creation)
|
||||||
|
└── profile/ # Profile management
|
||||||
|
├── Get Profile.bru # GET /api/auth/profile
|
||||||
|
├── Update Profile.bru # PUT /api/auth/profile
|
||||||
|
├── Update Email.bru # PUT /api/auth/email
|
||||||
|
├── Update Password.bru # PUT /api/auth/password
|
||||||
|
├── Update Theme.bru # PUT /api/auth/theme
|
||||||
|
└── Update Username.bru # PUT /api/auth/username
|
||||||
|
```
|
||||||
|
|
||||||
|
#### **Usage**
|
||||||
|
1. Install Bruno: https://www.usebruno.com/
|
||||||
|
2. Import Collection: Open Bruno and import the `bruno/` folder
|
||||||
|
3. Select Environment: Choose the "Bookmann" environment
|
||||||
|
4. Authentication Flow: Register → Login → Use Bearer token for protected routes
|
||||||
|
|
||||||
### Generating Secure Values
|
### Generating Secure Values
|
||||||
|
|
||||||
**Generate JWT Secret:**
|
**Generate JWT Secret:**
|
||||||
|
|||||||
Reference in New Issue
Block a user