ā± This guide takes less than 10 minutes.
This guide is meant to show you around Begin's CRUD app which demonstrates how to build a simple todo app using Begin Data.
āš½ You will need git, node.js and a GitHub account to follow along.
First click the Deploy to Begin button below
Next name your app and click the "Create..." button to have Begin create a new app and GitHub repo for it.
Check out your apps' activity feed!
Now click the Staging link in the upper left corner to see your app running in your staging environment.
You should see something like the image below:
Way to go!
Now go back to Begin and follow the prompts on the intro cards to see the system in action.
š” Learn more about CI/CD environments
If you followed the intro cards in the activity view you are ready to review your project's structure on your local machine.
.
āāā public/
ā āāā 404.html
ā āāā index.html
āāā todos/
āāā create/
ā āāā index.js
āāā delete/
ā āāā index.js
āāā read/
ā āāā index.js
āāā update/
āāā index.js
Let's go over each of the directories in the project.
public/
The public
directory is where we serve our static assets from.
For this project the file to look at is /public/index.html
.
š Look for the
<form>
tags and inspect theiraction
attribute to see what HTTP Function they make requests to.
todos/
This folder is where we keep HTTP Functions for the apps CRUD actions.
todos/create/
POST
requests to the /todos
route are processed by the handler function inside index.js
in this folder.
This handler creates todos by storing form data posted to it with Begin Data.
todos/read/
GET
requests to the /todos
route are processed by the handler function inside index.js
in this folder.
This handler gets all the stored todos from Begin Data.
todos/update/
POST
requests to the /todos/:id
route are processed by the handler function inside index.js
in this folder.
This handler updates the todo with the same id
as the one passed in from the URL parameter.
todos/delete/
POST
requests to the /todos/delete
route are processed by the handler function inside index.js
in this folder.
This handler deletes a todo with the same id
as the one passed in from the form data.
You've just built a CRUD todo app and API, and seen how Begin Data can persist data for your application's storage needs.
Now go show it off ā people need to see this thing!
AWS DynamoDB is a fully managed, highly durable, non-relational key value and document database for applications that need performance at any scale.
Learn more about DynamoDB here!