Creating a project
To begin developing our chat application, we need to create an Opa project using the following Opa command:
opa create chat
This command will create an empty Opa project. Also, it will generate the required directories and files automatically with the structure as shown in the following screenshot:
Let's have a brief look at what these source code files do:
controller.opa
: This file serves as the entry point of the chat application; we start the web server incontroller.opa
view.opa
: This file serves as an user interfacemodel.opa
: This is the model of the chat application; it defines the message, network, and the chat roomstyle.css
: This is an external stylesheet fileMakefile
: This file is used to build an application
As we do not need database support in the chat application, we can remove --import-package stdlib.database.mongo
from the FLAG option in Makefile
. Type make
and make run
to run the empty application.