Welcome to the Rakt Food Truck App repository! Follow these tasty steps to get your food truck up and running using Docker Compose.
- A hungry appetite π΄
- Docker installed on your device. Need it? Get it fresh from Docker's official website.
-
Open your "food truck window" aka terminal.
-
Place your order with the chef by cloning the repository using this command:
git clone https://github.com/hugobrilhante/rakt.git
-
Let's head to the food truck window:
cd rakt
-
Spice up your dish by finding the secret recipe book named
.env.example
in the food truck's main pantry. -
Whisper to the chef: "Hey chef, I want to customize my meal!" Rename
.env.example
to.env
using this magic spell:mv .env.example .env
-
Mix and match ingredients in the
.env
file to personalize your meal just the way you like it.
-
To prepare your food truck, build the Docker containers by running:
docker compose build
-
Before starting your food truck, let's set up the kitchen! Execute the following command to perform database migrations:
docker compose run --rm server python manage.py migrate
-
Now, it's time to stock up your food truck! Use this command to populate the food trucks in your database using a CSV file:
docker compose run --rm server python manage.py populate_food_trucks food-truck-data.csv
-
Check if the food truck is open (aka Docker is running).
-
Now, let's serve your order! Shout out your request to the chef using this command:
docker compose up -d
-
Watch the kitchen heat up and the aromas fill the air as your meal gets ready. You'll see logs showing the progress.
-
Once your meal is prepared, taste it at http://localhost:port/nearest-food-trucks/?latitude={latitude}&longitude={longitude}, where
port
is your food truck's special serving number.
-
To close up and rest the food truck, say goodbye with this command:
docker compose down --volumes
-
Open your terminal.
-
Install
pre-commit
to keep your code tasty and fresh:pip install pre-commit
-
Set up
pre-commit
hooks by navigating to your project directory and running:pre-commit install
-
Ensure Docker is running on your machine.
-
Run the following command to execute the tests using Docker Compose:
docker compose run --rm server python manage.py test
This Rakt Food Truck App has been crafted with decisions tailored for production:
- Utilization of
django-configurations
library for streamlined configuration management, including URL-based cache, database, email, and search settings. - Prepared for production with robust logging, containerization, and served using a well-configured Gunicorn server.
- Integration of GeoDjango to efficiently handle geographic coordinates within the application.
I might not be a programming genius, but I'm always eager to learn! Consultation of documentation and forums has been instrumental in resolving challenges faced during development, especially the part regarding GeoDjango, which was something I was familiar with but hadn't yet applied. It's a simple application, but I aimed to cover all areas of real-world application.
That's it! You've successfully set up pre-commit
hooks, executed tests using Docker Compose after building the containers, and ensured the deliciousness of your Rakt Food Truck App in the development environment. Bon appΓ©tit! πππ₯€