This repository contains:
current_website/: the Django website and Tailwind build setupcurrent_website/mobile_app/: the Expo mobile shell that loads the Django site in a WebViewold_website/: older reference files only
Most day-to-day work happens inside current_website/.
Use these versions so everyone on the team is testing against the same baseline:
- Python:
3.12.xrecommended - pip: latest available in the virtual environment
- Node.js:
20 LTSrecommended - npm:
10.xrecommended - Expo SDK:
54.0.33(already pinned incurrent_website/mobile_app/package.json) - React Native:
0.81.5(already pinned)
Notes:
- The Django app dependencies are pinned in
current_website/requirements.txt. - The website Tailwind tooling is defined in
current_website/package.json. - The mobile app uses the local Expo dependency from the repo. Do not rely on an old globally installed
expo-cli.
- Clone the repo.
- Open the workspace root in VS Code.
- Use PowerShell or Windows Terminal.
- Run all Django website commands from
current_website/. - Run all mobile commands from
current_website/mobile_app/.
From the repository root:
cd .\current_website
py -3.12 -m venv venv
.\venv\Scripts\Activate
python -m pip install --upgrade pip
pip install -r requirements.txt
npm installIf py -3.12 is not available, install Python 3.12 first or use the matching launcher/version already installed on your machine.
Create a file named .env inside current_website/.
For local development, this is a good starter file:
SECRET_KEY=replace-this-with-a-local-dev-secret
DEBUG=True
ALLOWED_HOSTS=127.0.0.1,localhost
CSRF_TRUSTED_ORIGINS=http://127.0.0.1:8000,http://localhost:8000
SITE_URL=http://127.0.0.1:8000
DJANGO_ADMIN_URL=admin
DEFAULT_FROM_EMAIL=no-reply@example.com
NEWSLETTER_FROM_EMAIL=news@example.com
CONTACT_RECIPIENT=company@mirandainsights.com
SUPPORT_EMAIL=support@mirandainsights.com
COMPANY_NOTIFICATION_EMAIL=company@mirandainsights.com
EMAIL_BACKEND=django.core.mail.backends.console.EmailBackend
EMAIL_HOST=
EMAIL_PORT=587
EMAIL_HOST_USER=
EMAIL_HOST_PASSWORD=
EMAIL_USE_TLS=False
EMAIL_USE_SSL=False
TURNSTILE_SITE_KEY=
TURNSTILE_SECRET_KEY=
TURNSTILE_VERIFY_URL=https://challenges.cloudflare.com/turnstile/v0/siteverifyLocal notes:
- Leaving the Turnstile keys blank disables Turnstile for local development.
- Using the console email backend prints outgoing emails in the terminal instead of sending them.
- If you need real email delivery, replace the email settings with valid SMTP credentials.
From current_website/ with the virtual environment activated:
python manage.py migrate
npm run build:css
python manage.py runserverOpen these URLs in your browser:
- Website:
http://127.0.0.1:8000/ - Admin:
http://127.0.0.1:8000/admin/by default, orhttp://127.0.0.1:8000/<DJANGO_ADMIN_URL>/if you changed the env var
Optional but useful:
python manage.py createsuperuser
python manage.py check
python manage.py testIf you are actively editing Tailwind styles, keep this running in a second terminal from current_website/:
npm run watch:cssThe mobile app lives in current_website/mobile_app/ and uses Expo to load the Django site.
From the repository root:
cd .\current_website\mobile_app
npm installCreate current_website/mobile_app/.env.
Use one of these values for EXPO_PUBLIC_INSIGHTS_SITE_URL:
- Physical phone on same Wi-Fi as your computer: use your computer's LAN IP, for example
http://192.168.1.172:8000 - Android emulator:
http://10.0.2.2:8000 - iOS simulator or local desktop testing:
http://127.0.0.1:8000
Example:
EXPO_PUBLIC_INSIGHTS_SITE_URL=http://192.168.1.172:8000Important:
- Start the Django server first before opening the mobile app.
- On a physical phone, your phone and computer must be on the same network.
- Windows Firewall may prompt you to allow Python/port
8000; allow local network access or the phone will not reach Django.
- Start the Django site from
current_website/. - Open a second terminal.
- Change into
current_website/mobile_app/. - Run one of the commands below.
Recommended start command:
npx expo startAvailable scripts:
npm start
npm run start:tunnel
npm run android
npm run ios
npm run web
npm run typecheckMobile testing notes:
npm startandnpx expo startuse the Expo version pinned in this repo.- Install Expo Go on your test phone to scan the QR code.
npm run iosrequires Apple/iOS tooling and is usually not the primary workflow on Windows.npm run typecheckis the quickest sanity check for the TypeScript mobile app.
Inside current_website/:
landingpage/: Django project settings, urls, and project-level configurationapps/: Django apps such as accounts, clients, chat, and newstemplates/: project-level templatesstatic/: project-level CSS, JavaScript, and PWA assetsmedia/: uploaded files for local developmentmanage.py: Django management entry pointpackage.json,postcss.config.js,tailwind.config.js: Tailwind/PostCSS tooling
These should not be committed:
.envvenv/db.sqlite3node_modules/current_website/mobile_app/.expo/
This repo already ignores the main local-generated files in .gitignore.
Before opening a PR or handing the project to another teammate, verify these all work:
# from current_website/
python manage.py check
python manage.py migrate
npm run build:css
# from current_website/mobile_app/
npm run typecheckThen confirm:
- the Django site loads in the browser
- the admin page opens
- CSS changes compile correctly
- the mobile app connects to the local Django server
- Make sure you are using Python
3.12.x. - Upgrade pip inside the activated virtual environment before installing requirements.
- Run
npm run build:cssonce for a manual build. - Use
npm run watch:csswhile editing CSS.
- Use your computer's LAN IP in
mobile_app/.env. - Confirm the Django server is running on port
8000. - Confirm Windows Firewall is not blocking the connection.
- Confirm both devices are on the same Wi-Fi network.
- Delete
current_website/mobile_app/node_modules/. - Run
npm installagain. - Start Expo with
npx expo start.
If a new teammate is setting this up from scratch, the shortest successful order is:
- Set up Python and Node.
- Install website dependencies in
current_website/. - Create
current_website/.env. - Run Django migrations and start the site.
- Install mobile dependencies in
current_website/mobile_app/. - Create
current_website/mobile_app/.envwith the correct local URL. - Start Expo and test from Expo Go or an emulator.