111 lines
4.0 KiB
Markdown
111 lines
4.0 KiB
Markdown
Here’s a cleaner and more informative version of your README section:
|
||
|
||
---
|
||
|
||
# 🧩 SOA – Service-Oriented Architecture Project
|
||
|
||
## 🚀 Quick Start
|
||
|
||
1. **Start the application stack:**
|
||
|
||
```bash
|
||
docker compose up -d --build
|
||
```
|
||
|
||
2. **Initialize Keycloak configuration:**
|
||
|
||
```bash
|
||
./setup-keycloak.sh
|
||
```
|
||
|
||
3. **Update your `/etc/hosts` file:**
|
||
|
||
```
|
||
127.0.0.1 api.local auth.local
|
||
```
|
||
|
||
---
|
||
|
||
## 🔐 Credentials
|
||
|
||
### Keycloak Admin Panel
|
||
|
||
* 📍 URL: [http://auth.local:8080](http://auth.local:8080)
|
||
* 👤 **Username:** `admin`
|
||
* 🔑 **Password:** `admin`
|
||
|
||
### Private API User
|
||
|
||
* 👤 **Username:** `alexis`
|
||
* 🔑 **Password:** `password`
|
||
|
||
---
|
||
|
||
## 🗂️ API Endpoints Overview
|
||
|
||
All routes are prefixed with `/api/private` and require a **Bearer token**.
|
||
|
||
### 👤 User
|
||
|
||
| Method | Endpoint | Description |
|
||
| ------ | -------- | ----------------------------- |
|
||
| GET | `/me` | Get current user's profile |
|
||
| PUT | `/me` | Update current user's profile |
|
||
|
||
### 🖼️ Galleries
|
||
|
||
| Method | Endpoint | Description |
|
||
| ------ | ----------------------- | --------------------------------- |
|
||
| GET | `/galleries` | List all accessible galleries |
|
||
| GET | `/galleries/mine` | List galleries owned by the user |
|
||
| POST | `/gallery` | Create a new gallery |
|
||
| GET | `/gallery/{gallery_id}` | Get details of a specific gallery |
|
||
| PUT | `/gallery/{gallery_id}` | Update a gallery (owner only) |
|
||
|
||
### 👥 Members
|
||
|
||
| Method | Endpoint | Description |
|
||
| ------ | ------------------------------- | ------------------------- |
|
||
| GET | `/gallery/{gallery_id}/members` | List members of a gallery |
|
||
|
||
### 📩 Invitations
|
||
|
||
| Method | Endpoint | Description |
|
||
| ------ | ----------------------------------- | --------------------------- |
|
||
| POST | `/gallery/{gallery_id}/invite` | Invite user to a gallery |
|
||
| PUT | `/invitations/{gallery_id}/respond` | Accept or reject invitation |
|
||
| GET | `/invitations/received` | List received invitations |
|
||
|
||
### 🖼️ Artworks
|
||
|
||
| Method | Endpoint | Description |
|
||
| ------ | -------------------------------- | ----------------------------------- |
|
||
| GET | `/gallery/{gallery_id}/artworks` | List artworks in a gallery |
|
||
| POST | `/gallery/{gallery_id}/artwork` | Add artwork to gallery (owner only) |
|
||
| GET | `/artwork/{artwork_id}` | Get details of an artwork |
|
||
| PUT | `/artwork/{artwork_id}` | Update an artwork (creator only) |
|
||
| GET | `/artworks/mine` | List artworks created by the user |
|
||
|
||
### 📝 Gallery Reviews
|
||
|
||
| Method | Endpoint | Description |
|
||
| ------ | ------------------------------- | ------------------------------------- |
|
||
| GET | `/gallery/{gallery_id}/reviews` | List reviews for a gallery |
|
||
| POST | `/gallery/{gallery_id}/review` | Submit a review for a gallery |
|
||
| PUT | `/galleries/review/{review_id}` | Update a gallery review (author only) |
|
||
| GET | `/galleries/reviews/given` | Reviews written by the user |
|
||
| GET | `/galleries/reviews/received` | Reviews received on user’s galleries |
|
||
|
||
### 📝 Artwork Reviews
|
||
|
||
| Method | Endpoint | Description |
|
||
| ------ | ------------------------------- | -------------------------------------- |
|
||
| GET | `/artwork/{artwork_id}/reviews` | List reviews for an artwork |
|
||
| POST | `/artwork/{artwork_id}/review` | Submit a review for an artwork |
|
||
| PUT | `/artworks/review/{review_id}` | Update an artwork review (author only) |
|
||
| GET | `/artworks/reviews/given` | Reviews written by the user |
|
||
| GET | `/artworks/reviews/received` | Reviews received on user’s artworks |
|
||
|
||
---
|
||
|