Kebabkhana is a simple web application that allows users to order kebabs online. The application is built using the Crystal Language and Marten Framework. Creating this application was a fun way to learn Crystal and Marten, and to build something useful for my colleagues at work. This project is not meant to be a production-ready application, but rather a learning exercise and a proof of concept.
Kebab day is a tradition at the office where I work. Every Thursday, we order kebab from a local kebab shop. The process of ordering kebab is a bit cumbersome. We have to write down our orders on a slack channel and then someone has to manually organize these orders and call the kebab shop to place the order. I thought it would be nice to have a web application that would allow us to order kebab online. That's how Kebabkhana was born. The application is built around the idea of making it easy for us to order kebab, many of the features are tailored to our specific needs and are not necessarily generalizable to other use cases.
Kebabkhana is built using the following technologies:
- Crystal Language: A statically-typed, compiled programming language with a syntax similar to Ruby.
- Marten Framework: A lightweight web framework for Crystal inspired by Ruby on Rails & Django.
- PostgreSQL: A powerful, open-source object-relational database system.
- Tailwind CSS: A utility-first CSS framework for rapidly building custom designs.
- ESBuild: An extremely fast JavaScript bundler and minifier.
- Docker: A platform for developing, shipping, and running applications in containers.
- Kamal: A simple deployment tool for any type of web application. (Kamal V2 is used for the application deployment).
- Flowbite: A free Tailwind CSS UI kit and components library.
Kebabkhana has 2 applications:
-
Auth: This application is based on the Marten Auth shard and further customized to suit the needs of the Kebabkhana. It provides the following features:
- User registration
- User login
- User logout
- User profile
- User password reset
- User password change
- User management (admin only)
-
Kebabkhana: This application is the main application that allows users to order kebab online. It provides the following features:
- Item management (create, read, update, delete).
- Batch management (create, read, update, delete) - A batch is a collection of orders for a specific day (usually every Thursdays).
- Order management (create, read, update, delete).
- Order payment collection (the actual payment is done offline since we prefer to pay in cash).
To install Kebabkhana, follow these steps:
- Intsall the Crystal Language & Marten Framework by following the instructions on the respective websites.
- Clone the repository and navigate to the project directory.
- Install the required dependencies by running
shards install
. - Start the PostgreSQL database by running
docker-compose up -d
. (make sure to create a.env
file with the required environment variables, and a development database). - Run the database migrations by running
marten migrate
. - Start the application by running
marten serve
.
Kebabkhana is deployed using Kamal, a simple deployment tool for any type of web application. Use the following steps to deploy Kebabkhana on your server:
- You need an amd64 server with a properly configured domain name.
- Update the config/deploy.yml file with your server and domain information.
- Update the .kamal/secrets.yml file with your database and secret key information.
- Install Kamal on your server by following the instructions on the Kamal website. Which is as simple as running
kamal setup
. - Run
kamal redeploy
to deploy new changes to your server.