Beginner totorial. Create a simple todo application using Total.js
I have published some blog posts and videos about Total.js Flow, the famous node-red alternative that is entirely written with the Total.js framework. Then I got many feedbacks from people asking me how to get started with the total.js framework. And I finally decided to create this Total.js tutorial series to help you move from zero to hero with the Total.js framework. I am so happy to publish the first tutorial of this series. Today's tutorial has two parts: part 1 will focus on the server-side implementation of our simple todo application, and part 2 will focus on its client-side implementation. I will share with you the GitHub source-code link and the youtube video link of this tutorial so that you can effectively learn everything about the Total.js framework.
Create project
Before you create a project for this tutorial, make sure that you have node.js v14 or earlier installed on your machine. This is enough to start building anything you want with the Total.js framework. Then we need to open your terminal and type the following commands:
Now you can open the project in your favorite code editor. In my case, I am using VSCode.
Create a main entry file (index.js)
Create a .js
file in the root of your application. The name for the app entry file is usually an index.js
file but you can name it whatever you want! The important thing is that you will need it to start the development server for your application. After you created it, you must put the following simple start script:
That one line of code is enough to start the server in debugging (development) mode!
Then you type the following in the terminal to run it:
The output of that will look like the following:
Create todo API endpoints
Create /controllers/api.js
file to define your application endpoints.
Create schema and actions for the app endpoints
Create /schemas/todos.js
file to define your Todos schema.
Testing the endpoints
Your API development is done! Now you need to test it to make sure that everything is okay. You can use your favorite API testing tool. The most popular is Postman but you can use insomnia or Linux Rest scope (in my case).
POST /todos/create
GET /todos/read/{id}/
PUT /todos/update/{id}/
GET /todos/list
GET /todos/toggle/{id}/
DELETE /todos/remove/{id}/
That is all for our application Server side API implementation. The next step is to implement a nice client-side UI for interacting with our API and this will the Part 2 of this tutorial. If you enjoyed reading this tutorial, please share it with your colleagues, like and leave me some comments. In part 2, I will share the source code link and the video tutorial link too. So consider following me and subscribing to the newsletter to not miss part 2.
Other posts from Total.js Platform
- 2024-10-01September report 2024
- 2024-09-27Total.js UI Builder: #2 designing your first interface
- 2024-09-26Total.js V5: Middlewares
- 2024-09-23Beginner Guide to Total.js UI: # 05 Client-side routing
- 2024-09-23Total.js UI #4: Data Binding (Part 2 – Practical Example)
- 2024-09-20Introduction to Total.js UI Builder: A Beginner’s Guide
- 2024-09-13Total.js v5: #06 Understanding File Routing
- 2024-09-09Total.js v5: Defining Routes for Internal Errors
- 2024-09-09Total.js V5: Dynamic websocket routing
- 2024-09-09Total.js V5: Websocket Routing