Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/viet2811/uk-travel-recommendation/llms.txt

Use this file to discover all available pages before exploring further.

This guide walks you through running the full UK Travel Recommendation stack on your local machine — from a fresh clone all the way to swiping through attraction cards on a real device or emulator. The backend runs inside Docker Compose (Django + PostgreSQL with pgvector), while the Expo frontend runs through the standard Expo CLI toolchain. Plan for roughly 10 minutes on a decent internet connection, plus however long it takes Docker to pull the pgvector/pgvector:pg15-bookworm image the first time.

Prerequisites

Before you begin, make sure the following tools are installed and available on your PATH:
ToolMinimum versionNotes
Docker + Docker ComposeDocker 24+Docker Desktop works on macOS and Windows
Node.js18 LTSRequired for the Expo CLI and frontend dependencies
Expo CLILatestInstall globally: npm install -g expo-cli
GitAny recent versionFor cloning the repository

Setup Steps

1

Clone the repository

Pull the project from GitHub. This gives you both the backend/ and frontend/ directories as well as the root docker-compose.yaml.
git clone https://github.com/viet2811/uk-travel-recommendation.git
cd uk-travel-recommendation
2

Create the backend environment file

The Django application and the PostgreSQL service both read their configuration from a shared .env file located inside the backend/ directory. Create it now and fill in values appropriate for your local setup.
touch backend/.env
Then open backend/.env in your editor and add the following variables:
# backend/.env

# Django
DJANGO_SECRET=your-long-random-secret-key-here

# PostgreSQL (must match the values used by the db service)
POSTGRES_DB=uk_travel
POSTGRES_USER=postgres
POSTGRES_PASSWORD=postgres
Never commit backend/.env to version control. The file is already listed in .gitignore, but double-check before pushing to a fork.
3

Start the backend and database

From the repository root, bring up both Docker Compose services. The --build flag ensures the Django image is (re)built from the backend/Dockerfile rather than using a stale cached layer.
docker compose up --build
Docker will:
  1. Pull pgvector/pgvector:pg15-bookworm for the db service (PostgreSQL 15 with the pgvector extension pre-installed).
  2. Build the backend image and install Python dependencies.
  3. Start both containers. The Django dev server will be reachable at http://localhost:8000.
Wait until you see Starting development server at http://0.0.0.0:8000/ in the logs before proceeding.
4

Run database migrations

With the containers running, apply Django’s database migrations to create all required tables — including the pgvector-backed columns used to store attraction and user-profile vectors.
docker exec backend_csproj python manage.py migrate
You should see a series of Applying <app>.<migration>… OK lines. If the command reports a connection error, wait a few seconds for PostgreSQL to finish its initialisation and try again.
5

Load attraction data

Populate the database with UK attraction records by running the custom management command. This command reads from a CSV file and a pre-computed vector pickle file, then bulk-inserts each attraction along with its 777-dimensional finalVector.
docker exec backend_csproj python manage.py load_attractions
load_attractions expects two data files to be present inside the backend/ directory before the image is built:
  • uk_attractions_main_valid_locations.csv — the attraction metadata (name, county, region, summary, etc.)
  • uk_attractions_vectors.pkl — pre-computed label and summary embeddings for every attraction
If either file is missing the command will exit with an error. Obtain these files from the project maintainer or regenerate them using the data-preparation notebooks included in the repository.
6

Install frontend dependencies

Open a new terminal window (leave Docker Compose running in the first one), then navigate to the frontend/ directory and install Node packages.
cd frontend
npm install
7

Configure the frontend environment

The Expo app needs to know where your Django backend is listening. Create a .env file inside the frontend/ directory:
touch frontend/.env
Add the following line, replacing the IP address with your machine’s local network address if you plan to use a physical device (Expo Go resolves localhost to the phone itself, not your computer):
# frontend/.env
EXPO_PUBLIC_BACKEND_URL=http://localhost:8000
If you are running the app on a physical phone via Expo Go, replace localhost with your machine’s local IP address (e.g. http://192.168.1.42:8000). You can find your IP with ipconfig on Windows or ifconfig / ip addr on macOS/Linux. Alternatively, use an Android or iOS simulator where localhost resolves correctly.
8

Start the Expo development server

Launch the Metro bundler and Expo development server from the frontend/ directory:
npx expo start
A QR code will appear in your terminal. Scan it with the Expo Go app (available on the App Store and Google Play) to load the app on your phone, or press i for the iOS Simulator or a for an Android Emulator.

Verify Everything Is Working

Once the app loads, you should land on the registration screen. Create an account, complete the initial preference setup, and you will be taken to the swipe feed where personalised UK attraction cards are served from your local backend. You can also confirm the API is healthy by hitting the root endpoint directly:
curl http://localhost:8000/api/recommendations/
A 401 Unauthorized response (rather than a connection error) confirms Django is running and routing correctly.

Stopping the Stack

To stop all running containers cleanly:
docker compose down
Add -v if you also want to remove the PostgreSQL data volume (this will erase all loaded attraction data and user accounts):
docker compose down -v

Build docs developers (and LLMs) love