Tiago Alves
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    <!-- > Alguns gajos que tiveram ganda 20: > [GIL](https://github.com/pdsam/Bazooki/wiki/a01) > [MOAS](https://github.com/MOAAS/LBAW/wiki/a1) > [EDU](https://github.com/EduRibeiro00/NewsLab-feup-lbaw) > [Rui E Miguel duarte](https://github.com/xRuiAlves/FEUP-LBAW) --> # EAP: Architecture Specification and Prototype This component groups artefacts related to the architecture specification of the information system to be developed and the (vertical) prototype implemented to validate the architecture. ## A7: High-level architecture. Privileges. Web resources specification The following document is used to detail the architecture of the web application, organized in modules. It presents a catalog of resources and their properties, such as references to graphical interfaces and the format of JSON responses. This specification adheres to the OpenAPI standard using YAML. ### 1. Overview | Name | Description | | -------- | -------- | | M01: Authentication & User | Web resources associated with User Authentication and User's Profile, includes the following system features: login/logout, registration, password retrieval, view profile, edit profile and delete profile. | | M02: Home and Search | Web resources associated with Home Page and Search content.| |M03: Blog |Web resources associated with Blog, includes the following system features: view all blog posts, add, filter, updating, delete and comment blog post. | | M04: Events | Web resources associated with Events, includes the following system features: view all events, add, filter by day or id, updating, delete events and add orders.| | M05: Market | Web resources associated with Market, includes the following system features: view all vendors, add vendor and products, filter, update and delete vendor. | ### 2. Permissions |||| |--|--|--| |**PUB**|Public|All Users| |**USR**|User|Authenticated users (Already logged in)| |**EDI**|Editor|Signed in Editors| |**ADM**|Administrator|Signed in Administrators| |**OWN**|Owner|Users that are owners of the information| ### 3. OpenAPI Specification This section includes the complete API specification in OpenAPI (YAML). Link to the OpenAPI YAML file: [a7_openapi.yaml](https://git.fe.up.pt/lbaw/lbaw2021/lbaw2144/-/blob/laravel/a7_openapi.yaml). Link to the [Swagger generated documentation](https://app.swaggerhub.com/apis/tiago-falves/SustainlbawLbaw44/1.0.0#/). ```yaml openapi: 3.0.0 info: version: 1.0.0 title: 'LBAW2144 - Sustainlbaw' description: 'Web Resources Specification (A7)' servers: # Added by API Auto Mocking Plugin - description: SwaggerHub API Auto Mocking url: https://virtserver.swaggerhub.com/tiago-falves/SustainlbawLbaw44/1.0.0 - url: http://lbaw2144.lbaw-prod.fe.up.pt description: Production server - url: http://localhost:8000 description: Development server externalDocs: description: Find more info here... url: https://git.fe.up.pt/lbaw/lbaw2021/lbaw2144 tags: - name: 'M01: Authentication & User' - name: 'M02: Home and Search' - name: 'M03: Blog' - name: 'M04: Events' - name: 'M05: Market' paths: #TODO GLobal search /home: get: operationId: M201 summary: Home page description: 'Home page. Acess: PUB' tags: - 'M02: Home and Search' responses: '200': description: 'OK. Show [UI01](https://git.fe.up.pt/lbaw/lbaw2021/lbaw2144/-/wikis/er#ui01-home)' '404': description: Home page not Found '429': description: Too Many Requests in Home Page default: description: Default /api/search/{search_word}: get: operationId: M202 summary: Searching content description: 'Searching content. Acess: PUB' tags: - 'M02: Home and Search' parameters: - in: path name: search_word schema: type: string required: true responses: '200': description: 'OK. Show [UI01](https://git.fe.up.pt/lbaw/lbaw2021/lbaw2144/-/wikis/er#ui01-home)' content: application/json: schema: type: array items: type: object properties: start_date: type: "string" format: "date-time" end_date: type: "string" format: "date-time" price: # <!--- form field name type: integer minimum: 0 name: type: string image_path: type: string description: type: string editor: type: integer location: type: integer example: - start_date: 2020/01/01 end_date: 2020/01/02 price: 5 name: João Lopes image_path: ../asset/jlopes.jpg description: Eu sou o Jlopes e vou dar 20 a este grupo editor: 15 location: 1 - start_date: 2020/01/03 end_date: 2020/01/04 price: 10 name: Sérgio Nunes image_path: ../asset/sergio.jpg description: Eu sou o Sergio e vou dar 20 a este grupo editor: 10 location: 2 '404': description: Home page not Found '429': description: Too Many Requests in Home Page default: description: Default #TODO Adicionar Search #TODO Adicionar ban user #TODO Editar role. /login: get: operationId: M0101 summary: Showing login form description: 'Login form. Acess: PUB' tags: - 'M01: Authentication & User' responses: '200': description: 'OK. Show [UI06](https://git.fe.up.pt/lbaw/lbaw2021/lbaw2144/-/wikis/er#ui06-sign-in)' '401': description: 'ERROR. Try again' '404': description: Login not Found '429': description: Too Many Requests default: description: Default post: operationId: M0102 summary: 'Login Action' description: 'Processes the login form submission. Access: PUB' tags: - 'M01: Authentication & User' #TODO Isto nao devia estar nos parameters? requestBody: required: true content: application/x-www-form-urlencoded: schema: type: object properties: email: # <!--- form field name type: string password: # <!--- form field name type: string required: - email - password responses: '302': description: 'Redirect after processing the login credentials.' headers: Location: schema: type: string examples: '302 Success': description: 'Successful authentication. Redirect to user profile.' value: '/' '302 Error': description: 'Failed authentication. Redirect to login form.' value: '/login' '204': description: Created '429': description: Too Many Requests default: description: Default /logout: post: operationId: M0103 summary: 'Logout Action' description: 'Logout the current authenticated used. Access: USR' tags: - 'M01: Authentication & User' responses: '302': description: 'Redirect after processing logout.' headers: Location: schema: type: string examples: 302Success: description: 'Successful logout. Redirect to login form.' value: '/login' '204': description: Created '429': description: Too Many Requests default: description: Default /register: get: operationId: M0104 summary: Showing register form description: 'register form. Acess: PUB' tags: - 'M01: Authentication & User' responses: '200': description: 'OK. Show [UI06](https://git.fe.up.pt/lbaw/lbaw2021/lbaw2144/-/wikis/er#ui05-sign-up)' '401': description: 'ERROR. Try again' '404': description: Register not Found '429': description: Too Many Requests default: description: Default post: operationId: M0105 summary: 'Register Action' description: 'Processes the register form submission. Access: PUB' tags: - 'M01: Authentication & User' requestBody: required: true content: application/x-www-form-urlencoded: schema: type: object properties: first_name: type: string last_name: type: string email: # <!--- form field name type: string password: # <!--- form field name type: string confirm_password: type: string subscribe: type: boolean accept_privacy: type: boolean required: - first_name - last_name - email - password - confirm_password - accept_privacy responses: '302': description: 'Redirect after processing the register credentials.' headers: Location: schema: type: string examples: '302 Success': description: 'Successful authentication. Redirect to user profile.' value: '/' '302 Error': description: 'Failed authentication. Redirect to register form.' value: '/register' '204': description: Created Account successfully '429': description: Too Many Requests default: description: Default /password_reset: post: operationId: M0107 summary: 'Passowrd Recovery Action' description: 'Processes password recovery form and sends a reset link to the specified e-mail. Access: OWN' tags: - 'M01: Authentication & User' requestBody: required: true content: application/x-www-form-urlencoded: schema: type: object properties: email: # <!--- form field name type: string required: - email responses: '204': description: Sent recovery e-mail '429': description: Too Many Requests default: description: Default /admin: get: operationId: M0108 summary: View Administration page description: 'Shows the Administration page. Acess: ADM' tags: - 'M01: Authentication & User' responses: '200': description: 'OK. Show [UI14](https://git.fe.up.pt/lbaw/lbaw2021/lbaw2144/-/wikis/er#ui14-administration)' '401': description: 'ERROR. Try again' '404': description: Not Found '429': description: Too Many Requests default: description: Default #/user/{id}/ban: /blog: get: operationId: M0301 summary: All blog posts description: 'Getting all blog posts. Acess: PUB' tags: - 'M03: Blog' responses: '200': description: 'OK. All blog posts returned' '401': description: 'ERROR. Try again' '404': description: Not Found '429': description: Too Many Requests default: description: Default post: operationId: M0302 summary: Add blog post description: 'Adding a new blog post. Acess: EDI' tags: - 'M03: Blog' requestBody: required: true content: application/x-www-form-urlencoded: schema: type: object properties: title: # <!--- form field name type: string content: type: string image_path: type: string author: type: string editor: type: integer required: - title - content - image_path - author - editor responses: '201': description: 'Post created sucessfully' '429': description: Too Many Requests default: description: Default /api/blog/category/{category_id}: get: operationId: M0303 summary: Find blog posts by category description: 'Getting blog posts by category. Acess: PUB' tags: - 'M03: Blog' parameters: - in: path name: category_id schema: type: integer required: true responses: '200': description: 'OK. Blog posts returned' content: application/json: schema: type: array items: type: object properties: blog_post_id: type: integer title: type: string content: # <!--- form field name type: string publication_date: type: string format: "date-time" image_path: type: string editor: type: integer author: type: string example: - blog_post_id: 1 title: 'JLopes Post' content: 'Este é um blog post do João Lopes' publication_date: '2021/05/06' image_path: '../assets/posts.jpg' editor: 1 author: 'jlopes' - blog_post_id: 2 title: 'SNunes Post' content: 'Este é um blog post do Sérgio Nunes' publication_date: '2021/05/06' image_path: '../assets/posts.jpg' editor: 1 author: 'snunes' '401': description: 'ERROR. Try again' '404': description: Not Found '429': description: Too Many Requests default: description: Default post: operationId: M0304 summary: Add category to blog description: 'Adding a new category to blog. Acess: EDT' tags: - 'M03: Blog' parameters: - in: path name: category_id schema: type: integer required: true requestBody: required: true content: application/x-www-form-urlencoded: schema: type: object properties: content: # <!--- form field name type: string required: - content responses: '201': description: 'Comment created sucessfully' '429': description: Too Many Requests default: description: Default /blog/{id}: get: operationId: M0305 summary: Find blog post by ID description: 'Getting a blog post. Acess: PUB' tags: - 'M03: Blog' parameters: - in: path name: id schema: type: integer required: true responses: '200': description: 'OK. Blog post returned' '401': description: 'ERROR. Try again' '404': description: Not Found '429': description: Too Many Requests default: description: Default put: operationId: M0306 summary: Updating blog post description: 'Updating an existing blog post. Acess: EDI' tags: - 'M03: Blog' parameters: - in: path name: id schema: type: integer required: true requestBody: required: true content: application/x-www-form-urlencoded: schema: type: object properties: title: type: string content: type: string image_path: type: string author: type: string editor: type: integer required: - title - content - image_path - author - editor responses: "400": description: "Invalid ID supplied" "404": description: "Blog post not found" "405": description: "Validation exception" '204': description: Created '429': description: Too Many Requests default: description: Default /api/blog/{id}: delete: operationId: M0307 summary: Delete blog post description: 'Deleting an existing blog post. Acess: EDI' tags: - 'M03: Blog' parameters: - in: path name: id schema: type: integer required: true responses: "400": description: "Invalid ID supplied" "404": description: "Blog post not found" '204': description: Created '429': description: Too Many Requests default: description: Default /blog/{id}/edit: get: operationId: M0308 summary: Find blog post edit form by id description: 'Getting the edit blog post page. Acess: PUB' tags: - 'M03: Blog' parameters: - in: path name: id schema: type: integer required: true responses: '200': description: 'OK. Edit Blog post page returned' '401': description: 'ERROR. Try again' '404': description: Not Found '429': description: Too Many Requests default: description: Default /api/blog/{id}/comment: post: operationId: M0309 summary: Add comment to blog post description: 'Adding a new comment to blog post. Acess: USR' tags: - 'M03: Blog' parameters: - in: path name: id schema: type: integer required: true requestBody: required: true content: application/x-www-form-urlencoded: schema: type: object properties: content: # <!--- form field name type: string required: - content responses: '201': description: 'Comment created sucessfully' content: application/json: schema: type: array items: type: object properties: comment_id: type: integer content: # <!--- form field name type: string date: type: string format: "date-time" blog_post_id: type: integer user_id: type: integer example: - comment_id: 1 content: "Este é o comentário com id = 1 ao blog post com id = 3 do user com id = 30!" date: "2021/05/05" blog_post_id: 3 user_id: 30 - comment_id: 2 content: "Tá ganda nice!" date: "2021/05/05" blog_post_id: 3 user_id: 31 '429': description: Too Many Requests default: description: Default /api/blog/comment: patch: operationId: M0310 summary: Updating co content description: 'Updating comment content. Access: OWN' tags: - 'M03: Blog' requestBody: required: true content: application/x-www-form-urlencoded: schema: type: object properties: blog_post_id: type: integer comment_id: type: integer content: type: string required: - id - comment_id responses: "400": description: "Invalid ID supplied" "404": description: "Blog post not found" "405": description: "Validation exception" '200': description: Updated content: application/json: schema: type: array items: type: object properties: comment_id: type: integer content: # <!--- form field name type: string date: type: string format: "date-time" blog_post_id: type: integer user_id: type: integer example: - comment_id: 1 content: "Este é o comentário com id = 1 ao blog post com id = 3 do user com id = 30!" date: "2021/05/05" blog_post_id: 3 user_id: 30 - comment_id: 2 content: "Tá ganda nice!" date: "2021/05/05" blog_post_id: 3 user_id: 31 '429': description: Too Many Requests default: description: default /api/blog/comment/{id}/delete: delete: operationId: M0311 summary: Delete comment from blog post description: 'Deleting comment from. Acess: OWN' tags: - 'M03: Blog' parameters: - in: path name: id schema: type: integer required: true responses: "400": description: "Invalid ID supplied" "404": description: "Blog post not found" '204': description: Created '429': description: Too Many Requests default: description: Default /events: get: operationId: M0401 summary: All events description: 'Getting all events. Acess: PUB' tags: - 'M04: Events' responses: '200': description: 'OK. All event posts returned' '401': description: 'ERROR. Try again' '404': description: Events Not Found '429': description: Too Many Requests default: description: Default /event : post: operationId: M0402 summary: Add an event description: 'Adding a new event. Acess: EDI' tags: - 'M04: Events' requestBody: required: true content: application/x-www-form-urlencoded: schema: type: object properties: start_date: type: "string" format: "date-time" end_date: type: "string" format: "date-time" price: # <!--- form field name type: integer minimum: 0 name: type: string image_path: type: string description: type: string editor: type: integer location: type: integer required: - start_date - end_date - price - name - image_path - description - editor - location responses: '201': description: 'Post created sucessfully' '429': description: Too Many Requests default: description: Default /api/event/today: get: operationId: M0403 summary: All events from today description: 'Getting all events that happen in that day. Acess: PUB' tags: - 'M04: Events' responses: '200': description: 'OK. All event posts from that day returned' content: application/json: schema: type: array items: type: object properties: start_date: type: "string" format: "date-time" end_date: type: "string" format: "date-time" price: # <!--- form field name type: integer minimum: 0 name: type: string image_path: type: string description: type: string editor: type: integer location: type: integer example: - start_date: 2020/01/01 (today) end_date: 2020/01/02 price: 5 name: João Lopes image_path: ../asset/jlopes.jpg description: Eu sou o Jlopes e vou dar 20 a este grupo editor: 15 location: 1 - start_date: 2020/01/01 (today) end_date: 2020/01/04 price: 10 name: Sérgio Nunes image_path: ../asset/sergio.jpg description: Eu sou o Sergio e vou dar 20 a este grupo editor: 10 location: 2 '401': description: 'ERROR. Try again' '404': description: Events Not Found '429': description: Too Many Requests default: description: Default /api/event/this_week: get: operationId: M0404 summary: All events from that week description: 'Getting all events that happen in that week. Acess: PUB' tags: - 'M04: Events' responses: '200': description: 'OK. All event posts from that week returned' content: application/json: schema: type: array items: type: object properties: start_date: type: "string" format: "date-time" end_date: type: "string" format: "date-time" price: # <!--- form field name type: integer minimum: 0 name: type: string image_path: type: string description: type: string editor: type: integer location: type: integer example: - start_date: 2020/01/6 end_date: 2020/01/7 price: 5 name: João Lopes image_path: ../asset/jlopes.jpg description: Eu sou o Jlopes e vou dar 20 a este grupo editor: 15 location: 1 - start_date: 2020/01/03 end_date: 2020/01/04 price: 10 name: Sérgio Nunes image_path: ../asset/sergio.jpg description: Eu sou o Sergio e vou dar 20 a este grupo editor: 10 location: 2 '401': description: 'ERROR. Try again' '404': description: Events Not Found '429': description: Too Many Requests default: description: Default /api/event/next_week: get: operationId: M0405 summary: All events from next week description: 'Getting all events that happen in the following week. Acess: PUB' tags: - 'M04: Events' responses: '200': description: 'OK. All event posts from next week returned' '401': description: 'ERROR. Try again' '404': description: Events Not Found '429': description: Too Many Requests default: description: Default /api/event/this_month: get: operationId: M0406 summary: All events from that month description: 'Getting all events that happen in that month. Acess: PUB' tags: - 'M04: Events' responses: '200': description: 'OK. All event posts from that month returned' content: application/json: schema: type: array items: type: object properties: start_date: type: "string" format: "date-time" end_date: type: "string" format: "date-time" price: # <!--- form field name type: integer minimum: 0 name: type: string image_path: type: string description: type: string editor: type: integer location: type: integer example: - start_date: 2020/01/30 end_date: 2020/01/31 price: 5 name: João Lopes image_path: ../asset/jlopes.jpg description: Eu sou o Jlopes e vou dar 20 a este grupo editor: 15 location: 1 - start_date: 2020/01/20 end_date: 2020/01/21 price: 10 name: Sérgio Nunes image_path: ../asset/sergio.jpg description: Eu sou o Sergio e vou dar 20 a este grupo editor: 10 location: 2 '401': description: 'ERROR. Try again' '404': description: Events Not Found '429': description: Too Many Requests default: description: Default /event/{id}: get: operationId: M0407 summary: Find an event by ID description: 'Getting an event. Acess: PUB' tags: - 'M04: Events' parameters: - in: path name: id schema: type: integer minimum: 0 required: true responses: '200': description: 'OK. Event returned' '401': description: 'ERROR. Try again' '404': description: Event Not Found '429': description: Too Many Requests default: description: Default put: operationId: M0408 summary: Updating an event description: 'Updating an existing event post. Acess: EDI' tags: - 'M04: Events' parameters: - in: path name: id schema: type: integer minimum: 0 required: true requestBody: required: true content: application/x-www-form-urlencoded: schema: type: object properties: start_date: type: "string" format: "date-time" end_date: type: "string" format: "date-time" price: type: integer minimum: 0 name: type: string image_path: type: string description: type: string editor: type: integer location: type: integer required: - start_date - end_date - price - name - image_path - description - editor - location responses: "400": description: "Invalid ID supplied" "404": description: "Event post not found" "405": description: "Validation exception" '204': description: Updated Event '429': description: Too Many Requests default: description: Default delete: operationId: M0409 summary: Delete an event description: 'Deleting an existing event. Acess: EDI' tags: - 'M04: Events' parameters: - in: path name: id schema: type: integer required: true responses: "400": description: "Invalid ID supplied" "404": description: "Event post not found" '204': description: Created '429': description: Too Many Requests default: description: Default /event/category: post: operationId: M0410 summary: Adding a new event category description: 'Adding event category. Acess: EDT' tags: - 'M04: Events' requestBody: required: true content: application/x-www-form-urlencoded: schema: type: object properties: category: type: "string" required: - category responses: '201': description: 'New event category added successfully' '401': description: 'ERROR. Try again' '404': description: Event Not Found '429': description: Too Many Requests default: description: Default /api/event/category/{category_id}: get: operationId: M0411 summary: Getting events by category description: 'Getting events by category. Acess: PUB' tags: - 'M04: Events' parameters: - in: path name: category_id schema: type: integer required: true responses: '200': description: 'Ok. Events by category return' '401': description: 'ERROR. Try again' '404': description: Event Not Found '429': description: Too Many Requests default: description: Default /order: post: operationId: M0412 summary: Add an order description: 'Adding a new order. Acess: USR' tags: - 'M04: Events' requestBody: required: true content: application/x-www-form-urlencoded: schema: type: object properties: event_id: type: "integer" number_tickets: type: "integer" code: type: "string" required: - event_id - number_tickets responses: '201': description: 'Post created sucessfully' '429': description: Too Many Requests default: description: Default #Get vendor #Edit Vendor #Delete Vendor #Insert Vendor e products #Filtrar por local /market: get: operationId: M0501 summary: All vendors description: 'Getting all vendors. Acess: PUB' tags: - 'M05: Market' responses: '200': description: 'OK. All vendors returned' '401': description: 'ERROR. Try again' '404': description: Vendors Not Found '429': description: Too Many Requests default: description: Default post: operationId: M0502 summary: Add Vendor and Products description: 'Adding a new vendor and respective products. Acess: EDI' tags: - 'M05: Market' requestBody: required: true content: application/x-www-form-urlencoded: schema: type: object properties: name: type: string example: Jorge Ribeiro job: type: string example: Agricultor location: type: integer example: 198772 image_path: type: string example: images/Photo.jpeg description: type: string example: I Am Jorge and I am a Farmer products: type: array items: $ref: '#/components/schemas/Product' required: - name - image_path - location - products responses: '201': description: 'Vendor created sucessfully' '429': description: Too Many Requests default: description: Default /market/{id}: get: operationId: M0504 summary: Find a vendor by ID description: 'Getting a Vendor. Acess: PUB' tags: - 'M05: Market' parameters: - in: path name: id schema: type: integer minimum: 0 required: true responses: '200': description: 'OK. Vendor returned' '401': description: 'ERROR. Try again' '404': description: Vendor Not Found '429': description: Too Many Requests default: description: Default put: operationId: M0505 summary: Updating a Vendor description: 'Updating an existing Vendor. Acess: EDI' tags: - 'M05: Market' parameters: - in: path name: id schema: type: integer minimum: 0 required: true requestBody: required: true content: application/x-www-form-urlencoded: schema: type: object properties: name: type: string example: Jorge Ribeiro job: type: string example: Agricultor location: type: integer example: 198772 image_path: type: string example: images/Photo.jpeg description: type: string example: I Am Jorge and I am a Farmer products: type: array items: $ref: '#/components/schemas/Product' responses: "400": description: "Invalid ID supplied" "404": description: "Vendor not found" "405": description: "Validation exception" '204': description: Updated Vendor '429': description: Too Many Requests default: description: Default delete: operationId: M0506 summary: Delete a vendor description: 'Deleting an existing vendor. Acess: EDI' tags: - 'M05: Market' parameters: - in: path name: id schema: type: integer required: true responses: "400": description: "Invalid ID supplied" "404": description: "Vendor post not found" '204': description: Deleted Vendor '429': description: Too Many Requests default: description: Default /api/user/{search_word}: get: operationId: M0109 summary: 'Showing user profile' description: 'Get user profile by ID. Acess: USR' tags: - 'M01: Authentication & User' responses: '200': description: 'User returned successfully!' content: application/json: schema: type: array items: type: object properties: user_id: type: string first_name: type: string last_name: type: string email: type: string role: type: string image_path: type: string example: - user_id: 1 first_name: 'João' last_name: 'Lopes' email: 'jlopes@fe.up.pt' role: 'Admin' image_path: '../assets/jlopes.jpg' '404': description: Not Found '429': description: Too Many Requests default: description: Default parameters: - in: path name: search_word schema: type: string required: true /user/{id}/change_role: patch: operationId: M0110 summary: 'Changing user role' description: 'Changing user role. Acess: ADM' tags: - 'M01: Authentication & User' requestBody: required: true content: application/x-www-form-urlencoded: schema: type: object properties: role: type: string required: - role responses: "400": description: "Invalid ID supplied" "404": description: "User not found" "405": description: "Validation exception" '204': description: Changed '429': description: Too Many Requests default: description: default parameters: - in: path name: id schema: type: integer required: true # TODO Ver os erros do put /user: get: operationId: M112 summary: User Profile description: 'User Profile. Acess: USR' tags: - 'M01: Authentication & User' responses: '200': description: 'OK. Show [UI01](https://git.fe.up.pt/lbaw/lbaw2021/lbaw2144/-/wikis/er#ui07-view/edit-profile)' '404': description: User Profile not Found '429': description: Too Many Requests in User Profile default: description: Default put: operationId: M0113 summary: Edit Profile description: 'Edit user profile info based on the input received. Acess: EDI' tags: - 'M01: Authentication & User' requestBody: required: true content: application/x-www-form-urlencoded: schema: type: object properties: first_name: type: string last_name: type: string email: # <!--- form field name type: string password: # <!--- form field name type: string confirm_password: type: string required: - first_name - last_name - email - password - confirm_password responses: '204': description: Edited Profile successfully '429': description: Too Many Requests default: description: Default /user/delete/{id}: delete: operationId: M0205 summary: Delete User profile description: 'Deleting an existing user. Acess: ADM' tags: - 'M01: Authentication & User' parameters: - in: path name: id schema: type: integer required: true responses: "400": description: "Invalid ID supplied" "404": description: "User not found" '204': description: Deleted User '429': description: Too Many Requests default: description: Default components: schemas: Product: x-swagger-router-model: io.swagger.petstore.model.Order properties: vendor_id: type: integer format: int64 example: 10 name: type: string description: Name of the product image_path: type: string description: Image path example: images/product1.jpeg xml: name: product type: object ``` --- ## A8: Vertical prototype The A8 artifact, known as the Vertical Prototype, includes the implementation of two or more user stories with the intent to validate the architecture presented and, also used, as the first experience with laravel and lbaw framework. ### 1. Implemented Features #### 1.1. Implemented User Stories | User Story reference | Name | Priority | Description | | - | - | - | - | | US01 | See blog posts | high | As a User, I want to be able to see the blog posts, so that I am informed about the network community. | | US02 | See events | high | As a User, I want to be able to see Events, so that I can see the activities the website has to offer. | | US03 | See the Information Pages | high | As a User, I want to be able to see the information about the market and the vendors. | | US05 | Filter blog post | high | As a User, I want to filter blog posts by category, so I can easily find the posts I want. | | US11 | Sign-in | high | As a Visitor, I want to authenticate into the website, so that I can interact and access privileged information. | | US12 | Sign-up | high | As a Visitor, I want to register into the website in order to login later. | | US21 | Logout | high | As a Basic user, I want to log out of my account, so that other people in the same computer don't have access to it. | | US51 | Create Blog Posts | high | As an Editor, I want to be able to create blog posts, in order to share new content with users. | | US52 | Delete Blog Posts | high | As an Editor, I want to be able to delete blog posts, so the users cannot see them anymore. | | US53 | Edit Blog Posts | high | As an Editor, I want to be able to edit blog posts, so that I can fix or modify some information about them. | | US64 | Dashboard | low | As an Administrator I want to have a Dashboard, in order to have a summary of the website activity. | #### 1.2. Implemented Web Resources **Module M01: Authentication & User** | Web Resource Reference | URL | | ---------------------- | ------------------------------ | | R101: Login form | /login | | R102: Login Action | POST /login | | R103: Logout Action | /logout | | R104: Register form | /register | | R105: Register Action | POST /register | | R106: Admin Dashboard Page | /admin | | R107: User Profile | /user | **Module M02: Home and Search** | Web Resource Reference | URL | | ---------------------- | ------------------------------ | | R201: Home page | /home | | R202: Error | /404 | **Module M03: Blog** | Web Resource Reference | URL | | ---------------------- | ------------------------------ | | R301: All blog posts | /blog | | R302: Add blog post | POST /blog | | R303: Find posts by category | /blog/category/{category_id} | | R304: Blog Post by id | /blog/{id} | | R305: Update Blog Post| PUT /blog/{id} | | R306: Delete Blog Post| DELETE /blog/{id} | | R307: Blog Post Edit Form by id | /blog/{id}/edit | | R308: Blog Post CRUD | /blog_post_crud | **Module M04: Events** | Web Resource Reference | URL | | ---------------------- | ------------------------------ | | R401: All Events | /events | | R402: Add event | POST /event | | R403: Event by id | /event/{id} | | R404: Update Event| PUT /event/{id} | | R405: Delete Event| DELETE /event/{id} | | R406: Event Edit Form by id | PUT /event/{id}/edit | | R407: Event Post CRUD | /event_post_crud | **Module M05: Market** | Web Resource Reference | URL | | ---------------------- | ------------------------------ | | R501: All Vendors | /market | | R502: Vendor by id | /market/{id} | | R5032: Vendor CRUD | /vendor_crud | ### 2. Prototype The prototype is available at http://lbaw2144.lbaw-prod.fe.up.pt/ Credentials: - admin user: jlopes@fe.up.pt/123456 - regular user: aluno@fe.up.pt/123456 The code is available at [Laravel branch](https://git.fe.up.pt/lbaw/lbaw2021/lbaw2144/-/tree/laravel). --- ## Revision history Changes made to the first submission: ... *** GROUP2144, 06/05/2021 * Diogo André Barbosa Nunes, up201808546@fe.up.pt * Marina Tostões Fernandes Leitão Dias, up201806787@fe.up.pt (editor) * Rodrigo Campos Reis, up201806534@fe.up.pt * Tiago Alexandre Pinto de Faria Ferreira Alves, up201603820@fe.up.pt

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully