
Build a UGC Live Streaming App with Amazon IVS: Creating a User (Lesson 2.1)
Welcome to Lesson 2.1 in this series where we're looking at building a web based user-generated content live streaming application with Amazon IVS. This entire series is available in video format on the AWS Developers YouTube channel and all of the code related to the sample application used in this series can be viewed on GitHub. Refer to the links at the end of the post for more information.
Channel
, ChatRoom
, and Stage
resources all have a one-to-one relationship with a User
, as illustrated in the following diagram.User
entity. username
and password
are sent to a /register
endpoint via an HTTP form POST
. These values are used to create a new User
and persist that User
to the database.1
2
3
4
5
Route.post('/register', async ({ auth, request, response }) => {
const username: string = request.input('username');
const password: string = request.input('password');
const user: User = await User.create({ username, password });
};
Note: This video series focuses on solving specific problems related to building UGC applications, and **is not meant to illustrate an end-to-end solution**. As such, there are certain best practices that are not addressed such as form input validation, and proper password strength enforcement. These items are left as an exercise for the developer/viewer, and will vary greatly depending on the language, framework, and security model necessary for your application.
User
is created, we can now focus on creating the Channel
, ChatRoom
, and Stage
entities via the AWS SDK for JavaScript (v3). In the StreamCat application, the functionality for working with each entity is encapsulated in a reusable service class, respectively named ChannelService
, ChatRoomService
, and RealTimeService
(for working with Stage
entities).Any opinions in this post are those of the individual author and may not reflect the opinions of AWS.