Repository navigation
eap
ProGram aims to bring together programmers, developers and other people passionate about informatics, while providing a supportive environment for communication and discussion. Our vision is to create a safe space where like-minded individuals can share ideas, learn new tricks and even start projects together.
- EAP - Architecture Specification and Prototype
The goal of this artifact is to document the architecture of our web app. It specifies the various resources provided, the purpose of each one, the methods associated (CRUD) and the format of its responses. Those responses follow the Open API standard.
| Module | Specification |
|---|---|
| M01: Home and Static Pages | Web resources associated with the home page and pages with static content. Includes the following system features: visualization of public and personalized timelines. |
| M02: Authentication and Individual Profile | Web resources associated with user authentication, user profile and user settings management. Includes the following system features: user login, user registration, user logout, profile visualization and profile edition. |
| M03: Posts and Announcements | Web resources associated with post and announcements, including comments and likes. Includes the following system features: post creation, post edition and post deletion. |
| M04: Search | Web resources associated with the search functionalities. Includes the following system features: full-text searches for users and content. |
| M05: Administration | Web resources associated with administrator pages and actions. Includes the following system features: separate administrator login, user and content management. |
| Acronym | Name | Description |
|---|---|---|
| PUB | Public | Users without privileges |
| USR | User | Authenticated users |
| FOL | Follower | Followers of another user on the platform |
| OWN | Owner | Users that created a post, announcement or comment on the platform |
| ADM | Administrator | Platform administrators |
The OpenAPI specification can also be checked here: a7_openapi.yaml.
openapi: 3.0.3
info:
version: "1.0"
title: "LBAW ProGram Web API"
description: "Web Resources Specification (A7) for ProGram"
# servers:
# - url: http://localhost:8000
# description: 'ProGram Production Server'
externalDocs:
description: "ProGram Wiki"
url: https://github.com/racoelhosilva/LBAW_proGram/wiki
tags:
- name: "M01: Home and Static Pages"
- name: "M02: Authentication and Individual Profile"
- name: "M03: Posts and Announcements"
- name: "M04: Search"
- name: "M05: Administration"
paths:
/:
get:
operationId: R101
summary: "R101: Home Page"
description: "Show the home page of the application. Access: PUB"
tags:
- "M01: Home and Static Pages"
responses:
200:
description: "Ok. Show home page UI."
/login:
get:
operationId: R201
summary: "R201: Login Page"
description: "Show the login page of the application. Access: PUB"
tags:
- "M02: Authentication and Individual Profile"
responses:
200:
description: "Ok. Show login form UI."
post:
operationId: R202
summary: "R202: Login Action"
description: "Process login form information to authenticate user. Access: PUB"
tags:
- "M02: Authentication and Individual Profile"
requestBody:
required: true
content:
application/x-www-form-urlencoded:
schema:
type: object
properties:
email:
type: string
format: email
password:
type: string
format: password
required:
- email
- password
example:
email: "johndoe@gmail.com"
password: "password123"
responses:
302:
description: "Redirect after processing the login request."
headers:
Location:
schema:
type: string
format: uri
examples:
302Success:
description: "Login successful. Redirect to home page."
value: "/"
302Failure:
description: "Login failed. Redirect to login page."
value: "/login"
/register:
get:
operationId: R203
summary: "R203: Register Page"
description: "Show the register page of the application. Access: PUB"
tags:
- "M02: Authentication and Individual Profile"
responses:
200:
description: "Ok. Show register form UI."
post:
operationId: R204
summary: "R204: Register Action"
description: "Process register form information to create a new user. Access: PUB"
tags:
- "M02: Authentication and Individual Profile"
requestBody:
required: true
content:
application/x-www-form-urlencoded:
schema:
type: object
properties:
name:
type: string
email:
type: string
format: email
handle:
type: string
password:
type: string
format: password
required:
- name
- email
- handle
- password
example:
name: "John Doe"
email: "johndoe@gmail.com"
handle: "johndoe2024"
password: "password123"
responses:
302:
description: "Redirect after processing the register request."
headers:
Location:
schema:
type: string
format: uri
examples:
302Success:
description: "Registration successful. Redirect to home page."
value: "/"
302Failure:
description: "Registration failed. Redirect to register page."
value: "/register"
/logout:
post:
operationId: R205
summary: "R205: Logout Action"
description: "Process logout action to end user session. Access: USR"
tags:
- "M02: Authentication and Individual Profile"
responses:
302:
description: "Logout successful. Redirect to home page."
headers:
Location:
schema:
type: string
format: uri
example: "/"
/user/{id}:
get:
operationId: R206
summary: "R206: User Profile Page"
description: "Show the user profile page of the authenticated user. Access: PUB"
tags:
- "M02: Authentication and Individual Profile"
parameters:
- name: id
in: path
required: true
description: "ID of the user whose profile is being viewed."
schema:
type: integer
responses:
200:
description: "Ok. Show user profile page UI."
put:
operationId: R207
summary: "R207: Update User Profile Action"
description: "Process update user profile form information to update user profile. Access: OWN"
tags:
- "M02: Authentication and Individual Profile"
parameters:
- name: id
in: path
required: true
description: "ID of the user whose profile is being updated."
schema:
type: integer
requestBody:
required: true
content:
multipart/form-data:
schema:
type: object
properties:
name:
type: string
description:
type: string
is_public:
type: boolean
handle:
type: string
languages:
type: array
items:
type: integer
technologies:
type: array
items:
type: integer
top_projects:
type: array
maxItems: 10
items:
type: object
properties:
name:
type: string
url:
type: string
format: uri
profile_picture:
type: string
format: binary
banner_image:
type: string
format: binary
required:
- name
- is_public
- handle
example:
name: "John Doe 2"
email: "johndoe2@gmail.com"
handle: "johndoe2025"
is_public: true
description: "Revised description."
languages: [1, 2]
technologies: [1, 2]
top_projects: [{ "Big project", "http://bigproject.com" }]
responses:
302:
description: "Redirect after attempting to update the user profile."
headers:
Location:
schema:
type: string
format: uri
examples:
302Success:
description: "Profile update successful. Redirect to user profile page."
value: "/user/{id}"
302Failure:
description: "Profile update failed. Redirect back to user profile edit page."
value: "/user/{id}/edit"
/user/{id}/edit:
get:
operationId: R208
summary: "R208: User Profile Edit Page"
description: "Show the user profile edit page of the authenticated user. Access: OWN"
tags:
- "M02: Authentication and Individual Profile"
parameters:
- name: id
in: path
required: true
description: "ID of the user whose profile is being edited."
schema:
type: integer
responses:
200:
description: "Ok. Show user profile edit page UI."
/post:
post:
operationId: R301
summary: "R301: Create Post"
description: "Process create post form information to create a new post. Access: USR"
tags:
- "M03: Posts and Announcements"
requestBody:
required: true
content:
multipart/form-data:
schema:
type: object
properties:
title:
type: string
text:
type: string
is_public:
type: boolean
is_announcement:
type: boolean
tags:
type: array
items:
type: integer
required:
- title
- is_public
- is_announcement
example:
title: "Java is not JavaScript"
text: "There is clearly one language that is far better built and useful."
is_public: true
is_announcement: false
tags: [3, 4]
responses:
302:
description: "Redirect after attempting to create the post."
headers:
Location:
schema:
type: string
format: uri
examples:
302Success:
description: "Post creation successful. Redirect to post page."
value: "/post/{id}"
302Failure:
description: "Post creation failed. Redirect back to post creation page."
value: "/post/create"
/post/create:
get:
operationId: R302
summary: "R302: Post Creation Page"
description: "Show the post creation page. Access: USR"
tags:
- "M03: Posts and Announcements"
responses:
200:
description: "Ok. Show post creation form."
/post/{id}:
get:
operationId: R303
summary: "R303: Post Page"
description: "Show the post page of the specified post. Access: FOL"
tags:
- "M03: Posts and Announcements"
parameters:
- name: id
in: path
required: true
description: "ID of the post being viewed."
schema:
type: integer
responses:
200:
description: "Ok. Show post page UI."
put:
operationId: R304
summary: "R304: Update Post Action"
description: "Process edit post form information to update the specified post. Access: OWN"
tags:
- "M03: Posts and Announcements"
parameters:
- name: id
in: path
required: true
description: "ID of the post being updated."
schema:
type: integer
requestBody:
required: true
content:
application/x-www-form-urlencoded:
schema:
type: object
properties:
title:
type: string
text:
type: string
is_public:
type: boolean
is_announcement:
type: boolean
tags:
type: array
items:
type: integer
required:
- title
- is_public
- is_announcement
example:
title: "Java is not JavaScript"
text: "There is clearly one language that is far better built and useful."
is_public: true
is_announcement: false
tags: [3, 4]
responses:
302:
description: "Redirect after attempting to update the post."
headers:
Location:
schema:
type: string
format: uri
examples:
302Success:
description: "Post update successful. Redirect to post page."
value: "/post/{id}"
302Failure:
description: "Post update failed. Redirect back to post edit page."
value: "/post/{id}/edit"
delete:
operationId: R305
summary: "R305: Delete Post Action"
description: "Process delete post action to remove the specified post. Access: OWN"
tags:
- "M03: Posts and Announcements"
parameters:
- name: id
in: path
required: true
description: "ID of the post being deleted."
schema:
type: integer
responses:
302:
description: "Redirect after attempting to delete the post."
headers:
Location:
schema:
type: string
format: uri
examples:
302Success:
description: "Post deletion successful. Redirect to author profile page."
value: "/user/{id}"
302Failure:
description: "Post deletion failed. Redirect back to edit post page."
value: "/post/{id}"
/post/{id}/edit:
get:
operationId: R306
summary: "R306: Post Edit Page"
description: "Show the post edit page of the specified post. Access: OWN"
tags:
- "M03: Posts and Announcements"
parameters:
- name: id
in: path
required: true
description: "ID of the post being edited."
schema:
type: integer
responses:
200:
description: "Ok. Show post edit form."
/api/post/{id}/like:
post:
operationId: R307
summary: "R307: API Like Post Action"
description: "Process like post action to like the specified post, using the logged-in user account, returning the like info as JSON. Access: FOL"
tags:
- "M03: Posts and Announcements"
parameters:
- name: id
in: path
required: true
description: "ID of the post to be liked."
schema:
type: integer
responses:
201:
description: "Post like successfully created. Return like information as a JSON"
content:
application/json:
schema:
type: array
items:
type: object
properties:
id:
type: integer
liker_id:
type: integer
post_id:
type: integer
example:
id: 1
liker_id: 2
post_id: 3
400:
description: "Post like creation failed, due to post already being liked. Return error message as JSON"
content:
application/json:
schema:
type: object
properties:
error:
type: string
example: "You have not liked this post."
delete:
operationId: R308
summary: "R308: API Unlike Post Action"
description: "Process unlike post action to unlike the specified post, using the logged-in user account. Access: FOL"
tags:
- "M03: Posts and Announcements"
parameters:
- name: id
in: path
required: true
description: "ID of the post to be unliked."
schema:
type: integer
responses:
200:
description: "Post like successfully deleted. Return success message as JSON"
content:
application/json:
schema:
type: object
properties:
message:
type: string
example: "Post like removed successfully."
400:
description: "Post like deletion failed, due to post not being liked. Return error message as JSON"
content:
application/json:
schema:
type: object
properties:
error:
type: string
example: "You have not liked this post."
/api/comment/{id}/like:
post:
operationId: R309
summary: "R309: API Like Comment Action"
description: "Process like comment action to like the specified comment, using the logged-in user account. Access: FOL"
tags:
- "M03: Posts and Announcements"
parameters:
- name: id
in: path
required: true
description: "ID of the comment to be liked."
schema:
type: integer
responses:
201:
description: "Comment like successfully created. Return like info as JSON"
content:
application/json:
schema:
type: object
properties:
id:
type: integer
liker_id:
type: integer
comment_id:
type: integer
example:
id: 4
liker_id: 5
comment_id: 6
400:
description: "Comment like creation failed, due to comment already being liked. Return error message as JSON"
content:
application/json:
schema:
type: object
properties:
error:
type: string
example: "You have already liked this comment."
delete:
operationId: R310
summary: "R310: API Unlike Comment Action"
description: "Process unlike comment action to unlike the specified comment, using the logged-in user account. Access: FOL"
tags:
- "M03: Posts and Announcements"
parameters:
- name: id
in: path
required: true
description: "ID of the comment to be unliked."
schema:
type: integer
responses:
200:
description: "Comment like successfully deleted. Return success message as JSON"
content:
application/json:
schema:
type: object
properties:
message:
type: string
example: "Comment like successfully removed."
400:
description: "Comment like deletion failed, due to comment not being liked. Return error message as JSON"
content:
application/json:
schema:
type: object
properties:
error:
type: string
example: "You have not liked this comment."
/search:
get:
operationId: R401
summary: "R401: Search Page"
description: "Show the search page of the application, along with the search results. Access: PUB"
tags:
- "M04: Search"
parameters:
- name: query
in: query
required: false
description: "Search query string."
schema:
type: string
responses:
200:
description: "Ok. Show search page UI, with search results."
/admin:
get:
operationId: R501
summary: "R501: Admin Dashboard"
description: "Show the admin page of the application. Access: ADM"
tags:
- "M05: Administration"
responses:
200:
description: "Ok. Show admin dashboard UI."
/admin/login:
get:
operationId: R502
summary: "R502: Admin Login Page"
description: "Show the admin login page of the application. Access: PUB"
tags:
- "M05: Administration"
responses:
200:
description: "Ok. Show admin login form UI."
post:
operationId: R503
summary: "R503: Admin Login Action"
description: "Process admin login form information to authenticate admin. Access: PUB"
tags:
- "M05: Administration"
requestBody:
required: true
content:
application/x-www-form-urlencoded:
schema:
type: object
properties:
email:
type: string
format: email
password:
type: string
format: password
required:
- email
- password
example:
email: "admin@outlook.com"
password: "adminpassword123"
responses:
302:
description: "Redirect after processing the admin login request."
headers:
Location:
schema:
type: string
format: uri
examples:
302Success:
description: "Admin login successful. Redirect to admin dashboard."
value: "/admin"
302Failure:
description: "Admin login failed. Redirect to admin login page."
value: "/admin/login"
/admin/logout:
post:
operationId: R504
summary: "R504: Admin Logout Action"
description: "Process admin logout action to end admin session. Access: ADM"
tags:
- "M05: Administration"
responses:
302:
description: "Admin logout successful. Redirect to admin login page."
headers:
Location:
schema:
type: string
format: uri
example: "/admin/login"
/admin/user:
get:
operationId: R505
summary: "R505: Admin User View Page"
description: "Show the admin user view page. Access: ADM"
tags:
- "M05: Administration"
parameters:
- name: query
in: query
required: false
description: "User info query."
schema:
type: string
responses:
200:
description: "Ok. Show admin user view UI, as well as searched users."
/admin/user/{id}/ban:
post:
operationId: R506
summary: "R506: Admin Ban User Action"
description: "Process ban user action to ban the specified user. Access: ADM"
tags:
- "M05: Administration"
parameters:
- name: id
in: path
required: true
description: "ID of the user to be banned."
schema:
type: integer
responses:
302:
description: "Redirect after attempting to ban the user."
headers:
Location:
schema:
type: string
format: uri
examples:
302Success:
description: "User ban successful. Redirect to admin user view page."
value: "/admin/user"
302Failure:
description: "User ban failed. Redirect back to admin user view page."
value: "/admin/user"
/admin/ban:
get:
operationId: R507
summary: "R507: Admin Ban View Page"
description: "Show the admin ban view page. Access: ADM"
tags:
- "M05: Administration"
parameters:
- name: query
in: query
required: false
description: "Ban info query."
schema:
type: string
responses:
200:
description: "Ok. Show admin ban view page UI."
/admin/ban/{id}/revoke:
post:
operationId: R508
summary: "R508: Admin Revoke Ban Action"
description: "Process revoke ban action to inactive an existing ban. Access: ADM"
tags:
- "M05: Administration"
parameters:
- name: id
in: path
required: true
description: "ID of the ban to be revoked."
schema:
type: integer
responses:
302:
description: "Redirect after attempting to revoke the ban."
headers:
Location:
schema:
type: string
format: uri
examples:
302Success:
description: "Ban revocation successful. Redirect to admin ban view page."
value: "/admin/ban"
302Failure:
description: "Ban revocation failed. Redirect back to admin ban view page."
value: "/admin/ban"
/admin/post:
get:
operationId: R509
summary: "R509: Admin Post View Page"
description: "Show the admin post view page. Access: ADM"
tags:
- "M05: Administration"
parameters:
- name: query
in: query
required: false
description: "Post info query."
schema:
type: string
responses:
200:
description: "Ok. Show admin post view page UI."This artifact describes the work developed for the vertical prototype of our web app including the implemented features (associated with user stories and web resources). We will also share the code of the prototype and credentials associated to explore the app.
| User Story Identifier | Name | Priority | Responsible | Description | State |
|---|---|---|---|---|---|
| US101 | View Public Profiles | High | José | As a user, I want to view public profiles of other users, so that I can learn more about them and potentially connect or interact with them | 100% |
| US102 | Search for Public Users | High | Bruno | As a user, I want to search for public users on the platform, so that I can find and connect with people who share my interests | 100% |
| US103 | View Public Timeline | High | Rodrigo | As a user, I want to view a public timeline of posts, so that I can see what content is available and engage with the community | 100% |
| US104 | Full-text Search | High | Bruno | As a user, I want to perform full-text searches, so that I can find relevant posts, users, or groups based on partial matches or broader search terms | 100% |
| US105 | Exact Match Search | High | Bruno | As a user, I want to be able to perform an exact match search, so that I can quickly find specific posts, users, or groups based on precise keywords | 100% |
| US201 | Registration | High | Henrique | As a guest, I want to be able to register myself into the system, so that I can authenticate myself and have access to additional features | 100% |
| US202 | Login | High | Henrique | As a guest, I want to be able to login into my account (if I already have one), so that I become an authenticated user and have access to additional features | 100% |
| US301 | Logout | High | Henrique | As an authenticated user, I want to be able to securely log out of my account, so that I can end my session and protect my data | 100% |
| US302 | Create Post | High | Rodrigo | As an authenticated user, I want to create posts (with text, images, tags, ...), so that I can share content in the platform | 100% |
| US303 | Edit Post | High | Rodrigo | As a post author, I want to edit my posts (text, images, tags, ...), so that I can update or correct the content I have shared | 100% |
| US304 | Delete Post | High | Rodrigo | As a post author, I want to delete my posts, so that I can remove content that is no longer relevant | 100% |
| US305 | View Personalized Timeline | High | Rodrigo | As an authenticated user, I want to view a personalized timeline of content based on my preferences and interactions, so that I can engage with relevant posts and updates | 100% |
| US306 | View My Profile | High | José | As an authenticated user, I want to view my profile, so that I can see my information and the content I have posted on the platform | 100% |
| US307 | View User Profiles | High | José | As an authenticated user, I want to view profiles of other users, so that I can learn more about them and their content | 100% |
| US308 | Edit Profile | High | José | As an authenticated user, I want to edit my profile, so that I can update my personal information and preferences | 100% |
| US309 | Add Profile Picture | Medium | José | As an authenticated user, I want to upload and modify my profile picture, so that I can personalize my presence on the platform | 100% |
| US321 | Like Posts | Medium | Henrique | As an authenticated user, I want to like posts, so that I can quickly express my appreciation for the content | 100% |
| US322 | Like Comment | Medium | Henrique | As an authenticated user, I want to like comments, so that I can quickly express my appreciation for the comment | 100% |
| US333 | Manage Post Visibility | Low | Bruno | As a post author, I want to manage the visibility of my posts, so that I can control who can view or interact with them | 100% |
| US601 | Manage Users | High | Henrique | As an administrator, I want to have a dashboard for managing, searching and modifying user accounts, so that I can effectively control user access, activity and permissions | 100% |
| US602 | Manage Content | High | Henrique | As an administrator, I want to manage groups and posts, so that I can moderate the community by deleting inappropriate content | 100% |
| US603 | Administrator Login | High | Henrique | As an administrator, I want to login into my dashboard in a special way, so that I can have different control of the platform and better manage it | 100% |
| US604 | Ban Users | Medium | Henrique | As an administrator, I want to ban a user account from the system, so that I can restrict access for users who violate policies or pose security risks | 100% |
| US605 | Unban Users | Medium | Henrique | As an administrator, I want to unban previously banned user accounts, so that they can regain access to the platform after their ban has been reconsidered and lifted | 100% |
Note: Besides the user stories mentioned above, we also have working versions of some other user stories for content available in the vertical prototype (for example, search for content is available for users and posts, but not for groups as these are not yet implemented).
| Web Resource Reference | URL |
|---|---|
| R101: Home Page (UI01) | GET / |
| Web Resource Reference | URL |
|---|---|
| R201: Login Page (UI02) | GET /login |
| R202: Login Action | POST /login |
| R203: Register Page (UI03) | GET /register |
| R204: Register Action | POST /register |
| R205: Logout Action | POST /logout |
| R206: User Profile Page (UI16) | GET /user/{id} |
| R207: Update User Profile Action | PUT /user/{id} |
| R208: User Profile Edit Page (UI25) | GET /user/{id}/edit |
| Web Resource Reference | URL |
|---|---|
| R301: Create Post | POST /post |
| R302: Post Creation Page (UI10) | GET /post/create |
| R303: Post Page (UI09) | GET /post/{id} |
| R304: Update Post Action | PUT /post/{id} |
| R305: Delete Post Action | DELETE /post/{id} |
| R306: Post Edit Page (UI24) | GET /post/{id}/edit |
| R307: API Like Post Action | POST /api/post/{id}/like |
| R308: API Unlike Post Action | DELETE /api/post/{id}/like |
| R309: API Like Comment Action | POST /api/comment/{id}/like |
| R310: API Unlike Comment Action | DELETE /api/comment/{id}/like |
| Web Resource Reference | URL |
|---|---|
| R401: Search Page (UI05) | GET /search |
| Web Resource Reference | URL |
|---|---|
| R501: Admin Dashboard (UI11) | GET /admin |
| R502: Admin Login Page (UI15) | GET /admin/login |
| R503: Admin Login Action | POST /admin/login |
| R504: Admin Logout Action | POST /admin/logout |
| R505: Admin User View Page (UI13) | GET /admin/user |
| R506: Admin Ban User Action | POST /admin/user/{id}/ban |
| R507: Admin Ban View Page (UI??) | GET /admin/ban |
| R508: Admin Revoke Ban Action | POST /admin/ban/{id}/revoke |
| R509: Admin Post View Page (UI12) | GET /admin/post |
Note: the sitemap slightly changed with the development of the website, so, some page references are marked with (UI??)
In order to run the project, it is necessary to login into gitlab.up.pt using docker:
docker login gitlab.up.pt:5050After that, the project is available by running the following command to download and run the container:
docker run -d --name lbaw2411 -p 8001:80 gitlab.up.pt:5050/lbaw/lbaw2425/lbaw2411This should make the website available at localhost:8001.
The Release Tag for the Vertical Prototype can be checked here: Vertical Prototype.
Note: shortly after the submission date, we discovered that there was a check missing on one of the conditions of the UserController, therefore, we created a second release of the vertical prototype.
| Password | Role | |
|---|---|---|
| kherrera@program.com | AdminsRule | Admin |
| cindyburton@gmail.com | ILoveProgram | User |
In this delivery, we have used both GhatGPT and Github Copilot to give suggestions on code snippets and documentation.
Changes made to the first submission:
- Added the reference for the tag EAP2 (29/11/2024)
- Added UI references for implemented web resources (21/12/2024)
GROUP2411, November 27, 2024
- Bruno Ricardo Soares Pereira de Sousa Oliveira, up202208700@up.pt (Editor)
- Henrique Sardo Fernandes, up202204988@up.pt
- José Carlos Malheiro de Sousa, up202208817@up.pt
- Rodrigo Albergaria Coelho e Silva, up202205188@up.pt