Skip to content

gayaldassanayake/book-marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 

Repository files navigation

book-marketplace

This sample project is a book marketplace where,

  • Sellers can sell books.
  • Buyers can buy books from sellers.
  • Admin can ban sellers and buyers.

Overview of the book market

You will learn the following topics by completing the tasks in this project.

  1. Writing REST APIs
  2. Using bal persist to connect with databases
  3. Adding configurable variables
  4. Ballerina package structure
  5. Using connectors - gmail
  6. Writing unit tests.
  7. OAuth2 authentication

Steps to follow to complete the exercise

Step 1

Start the oauth ballerina-sts service by executing the following command.

$ cd ballerina-sts
$ bal run

This will start a service that will provide the oauth2 functionality for the book-marketplace service.

Step 2

Gmail API configurations can be obtained from this google doc.

Step 3

Complete the TODOs in the book-marketplace service.

Step 4

Start the book-marketplace service by executing the following command inside the book-marketplace directory.

$ bal run

Step 5

You can use this postman collection to test the APIs.

Note that there is a header Authorization that is already set. A token generated by the sts server must be provided for this header. You can find the tokens for each user in this google doc

Once you have completed the tasks,

Generate the OpenAPI definition of the service using the openapi CLI command.

About

Demo project used for UoM Ballerina workshop

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages