-
Notifications
You must be signed in to change notification settings - Fork 230
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move petdesk sample application to samples-is
- Loading branch information
1 parent
abfaaed
commit 56b0594
Showing
75 changed files
with
21,422 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# B2C PetDesk Sample Application Setup Guide | ||
|
||
## Prerequisites: | ||
1. Install Ballerina 2201.5.0 https://dist.ballerina.io/downloads/2201.5.0/ballerina-2201.5.0-swan-lake-macos-arm-x64.pkg | ||
2. Install Node 16 LTS (Tested in v16.13.0). | ||
3. Clone https://github.com/wso2/samples-is and the sample will be in the petcare-sample/b2c directory. | ||
|
||
## Deploy API Services | ||
1. Navigate to <PROJECT_HOME>/petcare-sample/b2c/web-app/petdesk/apis/ballerina/pet-management-service and start the | ||
pet management service by executing the following command in the terminal. | ||
``` | ||
bal run | ||
``` | ||
!!! Note | ||
By default, the services store the data in memory. | ||
## Create an Application in WSO2 Identity Server | ||
1. Create a Single-Page Application named `Pet Desk App` in root organization. | ||
2. Add the `Authorized redirect URLs` as `http://localhost:5173`. | ||
3. Go to the `Protocol` tab and copy the `Client ID`. | ||
## Deploy the Front End Application | ||
1. Navigate to <PROJECT_HOME>/petcare-sample/b2c/web-app/petdesk/web/react and update the configuration file | ||
`config.js` with the registered app details. | ||
``` | ||
baseUrl: "https://localhost:9443", | ||
clientID: "<CONFIGURED_SPA_CLIENT_ID>", | ||
signInRedirectURL: "http://localhost:5173", | ||
signOutRedirectURL: "http://localhost:5173", | ||
resourceServerURL: "http://localhost:9090", | ||
scope: ["openid", "email", "profile"] | ||
``` | ||
2. Run the application by executing the following command in the terminal. | ||
``` | ||
npm install | ||
npm run dev | ||
``` | ||
3. Visit the sample application at http://localhost:5173. |
22 changes: 22 additions & 0 deletions
22
...e-sample/b2c/web-app/petdesk/apis/ballerina/pet-management-service/.choreo/endpoints.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# +required Version of the endpoint configuration YAML | ||
version: 0.1 | ||
|
||
# +required List of endpoints to create | ||
endpoints: | ||
# +required Unique name for the endpoint. (This name will be used when generating the managed API) | ||
- name: Pet Management Service | ||
# +required Numeric port value that gets exposed via this endpoint | ||
port: 9090 | ||
# +required Type of the traffic this endpoint is accepting. Example: REST, GraphQL, etc. | ||
# Allowed values: REST, GraphQL, GRPC | ||
type: REST | ||
# +optional Network level visibility of this endpoint. Defaults to Project | ||
# Accepted values: Project|Organization|Public. | ||
networkVisibility: Public | ||
# +optional Context (base path) of the API that is exposed via this endpoint. | ||
# This is mandatory if the endpoint type is set to REST or GraphQL. | ||
context: / | ||
# +optional Path to the schema definition file. Defaults to wild card route if not provided | ||
# This is only applicable to REST endpoint types. | ||
# The path should be relative to the docker context. | ||
schemaFilePath: service_openapi.yaml |
4 changes: 4 additions & 0 deletions
4
petcare-sample/b2c/web-app/petdesk/apis/ballerina/pet-management-service/.devcontainer.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"image": "ballerina/ballerina-devcontainer:2201.4.0", | ||
"extensions": ["WSO2.ballerina"], | ||
} |
9 changes: 9 additions & 0 deletions
9
petcare-sample/b2c/web-app/petdesk/apis/ballerina/pet-management-service/Ballerina.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[package] | ||
org = "WSO2" | ||
name = "pet_management_service" | ||
version = "1.0.0" | ||
export = ["pet_management_service"] | ||
distribution = "2201.3.1" | ||
|
||
[build-options] | ||
observabilityIncluded = true |
3 changes: 3 additions & 0 deletions
3
petcare-sample/b2c/web-app/petdesk/apis/ballerina/pet-management-service/Cloud.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[[container.copy.files]] | ||
sourceFile="./resources/email_template.html" | ||
target="/home/ballerina/resources/email_template.html" |
Oops, something went wrong.