Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
KOSASIH authored Dec 2, 2024
1 parent 7ed62fa commit 02e090f
Showing 1 changed file with 28 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,88 +16,88 @@ To get started with BigBossQ, follow these steps:
Install the required dependencies:

```
1. pip install Flask Flask-SQLAlchemy cryptography PyJWT
1 pip install Flask Flask-SQLAlchemy cryptography PyJWT
```

Run the following command to create the database:

```python

1. >>> from bigboss_q import db
2. >>> db.create_all()
3. >>> exit()
1 >>> from bigboss_q import db
2 >>> db.create_all()
3 >>> exit()
```

Run the BigBossQ system:

```
1. python bigboss_q.py
1 python bigboss_q.py
```

Use a RESTful API client to test the API endpoints:

```
1. Create a user: POST /users
2. Login: POST /login
3. Access protected resource: GET /protected
1 Create a user: POST /users
2 Login: POST /login
3 Access protected resource: GET /protected
```

API Documentation

The following API endpoints are provided:

```
1. POST /users: Create a new user.
1 POST /users: Create a new user.
```

Request body:

```json

1. {
2. "username": "string",
3. "email": "string",
4. "password": "string",
5. "role": "string"
6. }
1 {
2 "username": "string",
3 "email": "string",
4 "password": "string",
5 "role": "string"
6 }
```

Response:

```json

1. {
2. "user_id": "integer"
3. }
1 {
2 "user_id": "integer"
3 }
```

POST /login: Authenticate a user and generate a JWT.

Request body:

```json
{
"username": "string",
"password": "string"
}
1 {
2 "username": "string",
3 "password": "string"
4 }
```

Response:

```json
{
"token": "string"
}
1 {
2 "token": "string"
3 }
```

GET /protected: Access a protected resource.

Response:

```json
{
"message": "string"
}
1 {
2 "message": "string"
3 }
```

# License
Expand Down

0 comments on commit 02e090f

Please sign in to comment.