Skip to main content

Explanation of Sample Membership Site

This page provides an explanation of the structure and specifications of our company's open-source sample membership site, for those who are using it as a template when constructing Kuroco.

Repository: https://github.com/diverta/front_nuxt_auth
Demo Site: https://dev-nuxt-auth.g.kuroco-front.app/

API Used

We will explain the APIs used in the sample membership site.
This section describes the role of each endpoint, so please check your own site created from the free trial to see what specific parameters are set.

Authentication

PathModel::OperationDescription
/rcms-api/1/loginLogin::login_challengeUsed for login.
When you POST email and password to this endpoint, the login process is executed.
/rcms-api/1/logoutLogin::logoutUsed for logout.
When you send a request to this endpoint, the logout process is executed.
/rcms-api/1/profileLogin::profileWhen you send a request while logged in, information on name1 and name2 is returned. Used to confirm whether the user is logged in or not.
/rcms-api/1/reminderLogin::reminderUsed for password reset functionality.
When you POST email, a password reminder email is sent, and a temporary password and token are issued.
When you POST token, temp_pwd, and login_pwd, then the password is updated.
/rcms-api/1/reset_passwordLogin::reset_passwordAn endpoint for updating the password by POSTing login_id, current_password, and new_password, but it is not used in the frontend of the sample membership site.

Content

PathModel::OperationDescription
/rcms-api/1/content/listTopics::listAn API that retrieves a list of content structures with ID=1.
You can extract data by specifying the count and topics_id in the query parameters.
/rcms-api/1/content/details/{topics_id}Topics::detailsAn API that retrieves the details of the content.
/rcms-api/1/content/categoryTopicsCategory::listAn API that retrieves a list of categories registered with content structure ID=1.
/rcms-api/1/content/previewTopics::previewAn API for previewing content before saving it.
/rcms-api/1/content/update/{topics_id}Topics::updateAn API for updating content. It is not used in the frontend of the sample membership site.

Members

PathModel::OperationDescription
/rcms-api/1/member/{member_id}Member::detailsAPI to retrieve the detailed information of a member.
Only the member information with Group ID = 104 (user) can be retrieved and requests from ID=104 (user) are restricted.
This API is not used in the frontend of the sample membership site because the list API is used instead.
/rcms-api/1/member/listMember::listAPI to retrieve the list of members with Group ID = 104 (user).
Up to 1000 items can be retrieved and requests from ID=104 (user) are restricted.
/rcms-api/1/member/updateMember::updateAPI to update the information of a member.
Only the information of the caller can be updated.
/rcms-api/1/member/registerMember::insertAPI to add a new member.
The member added with this API will be registered as a member of the group with Group ID = 104 (user).
/rcms-api/1/member/settingsMemberForm::detailsAPI to return the member information settings.
This API is not used in the frontend of the sample membership site.
/rcms-api/1/member/meMember::detailsAPI to retrieve the detailed information of the usert that called this API.
Information of other members cannot be retrieved due to restrictions.

Favorites

PathModel::OperationDescription
/rcms-api/1/favorite/listFavorite::listThis API retrieves a list of favorites.
By setting module_id and module_type as query parameters, the favorite list of the Reference member can be retrieved.
/rcms-api/1/favorite/register Favorite::insertThis API adds a favorite.
When module_id and module_type are POSTed, the favorite is added to [Activities] -> [Favorites].
/rcms-api/1/favorite/deleteFavorite::deleteThis API deletes a favorite.
When module_id and module_type are POSTed, the favorite is deleted from [Activities] -> [Favorites].

Forms

PathModel::OperationDescription
/rcms-api/1/inquiry/{inquiry_id}InquiryForm::detailsThis API retrieves the details of a form.
Used to display the form items.
/rcms-api/1/inquiry/1InquiryMessage::sendThis API sends the answers to the form.
When the input items in the form are POSTed, the answers are added to the form with form ID=1 under [Campaigns] -> [Forms].

Files

PathModel::OperationDescription
/rcms-api/1/uploadFiles::uploadThis API uploads a file and stores it in the Kuroco temporary storage area.
Used when uploading files from a form.

Specifications for Frontend and Operation

General

  • To support multi-language through i18n, texts are displayed by using the {{ $t('top.latest_articles') }} syntax to fetch and display the text set in /src/locales.
  • Processing completion and error messages are displayed using Vuetify's Snackbar.
  • The Snackbar is described in /src/layouts/default.vue, and the messages generated on each page are passed to default.vue through /src/store/snackbar.js.

TOP Page(/)

Reference file

https://github.com/diverta/front_nuxt_auth/blob/main/src/pages/index.vue

Description of operation

  • The /src/components/Login.vue is displayed when the user is not logged in, by using the <Login v-if="!$auth.loggedIn" /> syntax.
  • When logging in with /src/components/Login.vue, the $axios.defaults.baseURL determines the API request destination and can be overwritten at.
    This enables a common frontend and a backend (Kuroco management screen) switching behaviour with each site key.
  • If the user is logged in, the navigation, content list, and favorite list are displayed.
  • The slider section uses Vuetify's v-carousel.
  • The grid display of content is modularized, displayed by <TopicsGrid :topics="topics" /> calling /src/components/topics/Grid.vue.
  • The list display of favorite is modularized, displayed by <TopicsList :topics="favourite" /> calling /src/components/topics/List.vue.

/topics_list

Reference file

https://github.com/diverta/front_nuxt_auth/blob/main/src/pages/topics_list.vue

Description

  • Retrieves and displays a list of categories and content.
  • The grid display of content is modularized, displayed by <TopicsGrid :topics="topics" /> calling /src/components/topics/Grid.vue.
  • Pagination uses Vuetify's v-pagination.

/topics_detail/{topics_id}

Reference file

https://github.com/diverta/front_nuxt_auth/blob/main/src/pages/topics_detail/_id.vue

Description

  • Retrieves and displays Kuroco's content corresponding to the ID obtained from the URL.
  • If the URL is /topics_detail/preview/, it sends a request to the preview endpoint and displays preview of the content details before being published.
  • Clicking the star icon posts module_id to the /rcms-api/1/favorite/register endpoint to register it as a favorite.
  • Clicking the star icon for a registered favorite content posts module_id to the /rcms-api/1/favorite/delete endpoint to delete it from favorites.

/favorite

Reference file

https://github.com/diverta/front_nuxt_auth/blob/main/src/pages/favourite.vue

Description

  • By accessing, it retrieves a list of topics_id that have been favorited from the /rcms-api/1/favorite/list endpoint.
    Then it sends a request to the /rcms-api/1/content/list endpoint by passing the topics_id list as a query parameter to obtain a list of favorites.
  • The list display of favorites is modularized, displayed by <TopicsList :topics="favourite" /> calling /src/components/topics/List.vue.
  • Pagination uses Vuetify's v-pagination.

/member

Reference file

https://github.com/diverta/front_nuxt_auth/blob/main/src/pages/member/index.vue

Desciption

  • Retrieves and displays a list of members using the /rcms-api/1/member/list endpoint.
  • Only members belonging to the member group are displayed.
  • Only administrators or editor members can access the member list. Members who are registered from the frontend (as a 'User' group) cannot access it.
  • The behavior of the filter at the top of the screen is handled on the frontend using Vuetify's v-autocomplete.
  • Pagination uses Vuetify's v-pagination.

/member/detail/{member_id}

Reference file

https://github.com/diverta/front_nuxt_auth/tree/main/src/pages/member/detail/_id.vue

Description

  • Retrieves and displays member details by passing the member ID obtained from the URL as a query parameter to the /rcms-api/1/member/list endpoint.

/profile

Reference file

https://github.com/diverta/front_nuxt_auth/blob/main/src/pages/profile/index.vue

Description

  • Displays the profile information of logged in user obtained from the /rcms-api/1/member/me endpoint.

/profile/edit

Reference file

https://github.com/diverta/front_nuxt_auth/blob/main/src/pages/profile/edit/index.vue

Description

  • Displays the profile information of logged in user obtained from the /rcms-api/1/member/me endpoint.
  • When submit is clicked, the entered data is posted to the /rcms-api/1/member/update endpoint.
  • The form display uses FormulateForm.

/inquiry

Reference file

Reference file: https://github.com/diverta/front_nuxt_auth/blob/main/src/pages/inquiry.vue

Description

  • Displays form items obtained from the /rcms-api/1/inquiry/1 endpoint.
  • The form display uses FormulateForm.
  • Clicking Submit posts data to the /rcms-api/1/inquiry/1 endpoint.
  • The entered content is saved as a response in Form ID=1.

/signup

Reference file

Reference file: https://github.com/diverta/front_nuxt_auth/blob/main/src/pages/signup.vue

Description

  • The form display uses FormulateForm.
  • Clicking Submit posts data to the /rcms-api/1/member/register endpoint, completing the member's registration.
  • Members registered from here belong to the 'User' group.

/reminder

Reference file

Reference file: https://github.com/diverta/front_nuxt_auth/blob/main/src/pages/reminder.vue

Description

  • Clicking "Reset my password posts" will POST email to /rcms-api/1/reminder and password reset email will be sent.
  • The password reset email uses the login/reset_password email template and contains the token information issued by the reminder API.
  • When accessing the reminder API with the token information set in the query parameter, the temporary and new password input fields will be displayed.
  • Clicking "SUBMIT" will POST login_pwd, temp_pwd, and token to the /rcms-api/1/reminder endpoint, completing the password update.

Used plugins

Several plugins are used to build the frontend of the membership sample site.
The main plugins used are introduced below, refer to each document for the description and specification of the plugin part.

Plugin NameOfficial Documentation
nuxtjs/axioshttps://axios.nuxtjs.org/
nuxtjs/authhttps://auth.nuxtjs.org/
nuxtjs/pwahttps://pwa.nuxtjs.org/
nuxtjs/i18nhttps://i18n.nuxtjs.org/
Vuetifyhttps://vuetifyjs.com/getting-started/installation/
VueFormulatehttps://vueformulate.com/guide/

We have prepared tutorials on how to implement each function.
The following tutorials introduce the implementation method of each function with simple code.


Support

If you have any other questions, please contact us or check out Our Slack Community.