This is the first step towards building my first full web application: the AirBnB clone. This first step is very important because i will use what i build during this project with all other following projects: HTML/CSS templating, database storage, API, front-end integration...
In this first part, the console (which is simillar to a sandbox usually used for testing new feature and troubleshooting) was implemented.
This givs us the ability to perfom CRUD operations by entring pre defined commands.
It indefinitely displays a prompt asking the user to enter a command. The command is then read, analyzed and executed using the Cmd class (which works miracles) and the set of predefined methods that accompany it.
Most of them were overwritten in our user defined class which inherit from the Cmd class.
More simply, we will be able to :
- create new objects
- retrieve an object from the database (file storage)
- perform some operations on the objects
- update attributes of an object
- destroy/delete an object
Using the following commands :
show
create
update
destroy
count
To make the use of the console more user-friendly, other commands are also available :
- help
- exit
- git
- python3
- ...
Fabrice Eklou | twitter : fabeklou linkedin : Fabrice Eklou