Inspiration
I often get tired of switching between a lot of services in a normal workflow, even when I am just working on a small side project. And a lot of these things could be automated. At the moment there is no good solution to manage a lot of those services in one place easily. But we are in 2021, and a lot of those services provide us with API which we could use to create one app that manages a lot of services in one place. There are a lot of such apps present but they have drawbacks. They are either not cross-platform (there are a lot of cool mac apps that I would love to use) and they are just another app you need to keep open in order to manage things. I think the solution is obvious, to make a command-line app that lives in the console, the natural home for a lot of developers. Command-line apps built using languages with cross-platform libraries can easily solve a lot of those issues. And the text is a universal language unlike objects and different models which could be hacked with to suit any need
What it does
This led me to start building a command-line application that is simple and modular so that adding new abilities would be as easy as adding a new file/module and registering its command with the program. I imagined an app from where I can control my music playback with Spotify, create and manage todos with reminders coming to me in the console, calendar integration for event reminders and sync with a smartphone app to get information when I am away from the terminal. I underestimated the task I was undertaking and also due to me being a beginner and a very inexperienced developer the only functionality I was able to add was a todo list in which we could add, delete tasks along with a detailed description and category information and then beautifully display it in the terminal with colours. no one likes long lines of text in the terminal which looks like its screaming at us
How I built it
When I first had the idea (around 8 hours after the hacking countdown began) I began hacking immediately. The only language I am good with is javascript. I began learning typescript 2 days ago and liked it. So I decided to build the app completely in typescript since it will be a good learning experience. I had never used a database ever in a program and only knew some basic theoretical concepts from my classes. So for a simple database with a javascript wrapper, I went with levelup after a long time of research. I chose it specifically because it was fast, simple key-value database and its also light on the ram. Developers have a lot of apps open at once and putting more load on the ram is not a good idea which is what redis the most popular option for this does. For building out the command line interface I chose 'commander' which helps us by only having to worry about the command with which the user interacts and abstracts the platform-specific implementations. For outputting coloured text I chose 'chalk' which has great cross-platform support and the best windows command line support by far. For user input, I chose Inquirerjs, mainly because of its beautiful UI which is among the best I have seen in a command-line application and I love beautiful command-line interfaces which are rare.
Challenges I ran into
Apart from underestimating the time and complexity required to build such an encompassing app, I also heavily underestimated the difficulty of getting user input from command line reliably and predictably in nodejs. Which is the point which caused me a lot of pain and since I was learning about things for the first time and building and using them at the same time didn't help much. This was also the first time I worked with promises in an app. Handling them and knowing how to chain promises was a big problem which was difficult to solve. The solution for my specific use case turned out to be quite simple after a bit of searching and I learned more about promises in that hunt for a solution than any amount of blog posts.
Accomplishments that I'm proud of
This project involved a lot of firsts for me: The first time I built a typescript app The first time I set up and configured a build system myself The first time I used a database in an app The first time I made a nodejs based app that did not abstract away the nodejs functionalities The first time I made an app that interacted with the user in the command line in javascript The first time I made an app that produced colour output
What I learned
They were all a great learning experience. I learned more in these 2 days than I did in the last 1 year. And being able to all of this myself without following video tutorials or a teacher guiding me through every step or just falling back on a pre-built project on GitHub to understand things is a big accomplishment for me and I am very proud of that
What's next for ConCom - A console companion app with a todo list
I have just added a todo list. At the moment it doesn't work well and I haven't yet tested the cross-platform aspect of it. it is on GitHub under the MIT license so that people can take it and make it their own. I want this to be an app that becomes the hub for all services that I use which have an API. I wish to add calendar sync, make a smartphone app that syncs data when I learn to make one. I also want to add Spotify integration to control my music from the command line. I will be learning these things and try to enhance my knowledge and skill and use them to make concom even better so that one day I wonder how I ever lived without it. And I hope a lof of more people will also feel the same way.
Built With
- chalk
- commander
- inquirerjs
- levelup
- typescript
Log in or sign up for Devpost to join the conversation.