A just-in-time language companion for real-world travel.
- Overview
- Features
- Tech Stack
- Architecture
- Installation
- Environment Variables
- Project Structure
- API Workflow
- Authentication
- Testing
- Roadmap
- Contributors
- License
FANGO is a just-in-time language companion built for travellers. Snap a photo of anythingβstreet food, a monument, a cafΓ© menuβand FANGO instantly:
- Recognizes the object
- Translates it into your chosen language
- Pronounces it for you
- Provides two safe, usable phrases
- Saves everything for later review
Unlike lesson-based apps, FANGO starts with the real world in front of you.
- Upload or take a photo
- AI-powered object detection
- Real-time translation
- Auto-generated pronunciation
- Auto-generated travel-safe short phrases
- Designed for situations when you need answers now
- Helpful for food, signs, labels, products, monuments, etc.
- Review previous translations
- Learn vocabulary naturally
- Pagination and filtering
- Create/manage user account
- Data synced across devices
- JWT authentication
- Learn during travel moments
- No long lessons
- Safe, consistent phrasing
- Python 3.12
- Django 5.2
- Django REST Framework
- PostgreSQL
- Redis
- JWT Auth (SimpleJWT)
- Gunicorn
- Pillow (image processing)
- OpenAI Vision + GPT translation
- React
- TypeScript
- HTML / CSS
- Axios
- Vite
- OpenAI Vision API (Object detection from image)
- GPT for translations, pronunciation, phrase generation
Frontend (React/TS)
β API calls
Backend (Django REST Framework)
β
OpenAI Vision API β Detect object
β
GPT β Translate + Pronounce + Generate phrases
β
PostgreSQL (store history, user data)
Ensure docker is installed.
git pullCopy .env.example contents to local .env and fill in respective values.
Change directory to project root:
cd ../group5_softwareengineering/docker compose up --buildRemember to makemigrations if schema changed with:
docker compose run django-web python manage.py makemigrations
docker compose run django-web python manage.py migrateAlso, run the following to insert the language mock data:
docker compose run -it django-web python manage.py shell
exec(open("fango/insert_mock_languages.py").read())
exit()Start services in .docker-compose.yml in -d detached mode, which runs containers in background
docker compose up -dIf successful, you should see the container, group5_softwareengineering in Docker.
try at localhost:8000/api/persons
Run Django shell:
docker compose run -it django-web python manage.py shellNote that these scripts are normally for fresh databases. There are a few options to seed:
- Seed row
exec(open("fango/insert_mock_data.py").read())- Seed multiple rows
exec(open("fango/insert_mock_languages.py").read())
exec(open("fango/insert_mock_data2.py").read())- Seed edge case data
exec(open("fango/insert_test_data.py").read())
run_edge_case_seeding()- Import models (it should have automatically imported anyway) from fango.models
import AppUser, Word, < other table you want to check >- Retrieve all rows from a table in the db, in this case it's AppUser
AppUser.objects.all()- When you're finished:
exit()docker compose exec db psql -U < DATABASE_USERNAME from .env > -d < DATABASE_NAME from .env >-
List relations
\dt -
Take note of schema names, they should be something like
fango_appuser,fango_quiz, etc. -
You can look at the schema with:
\d fango_appuserpress q when you're done -
Fetch all rows from a table, I'm checking fango_appuser in this example:
SELECT * FROM fango_appuser;press q when you're done -
When you're finished:
exit
docker exec -it fango-redis redis-cliShow all stored keys
KEYS *Show all values of a session key, e.g. user::session
HGETALL user:<uid>:sessionWe use HGETALL because this key is a hash, which is a dictionary stored in Redis
To show number of requests made in the current period of a rate limit key, e.g. ratelimit:<ip/user>:...
GET ratelimit:<ip/user>:...Show the seconds until a key's expiration
TTL <some key>Comment out the RateLimitMiddleware under settings.py
docker restart <container name>docker compose down -v### For frontend updates
rm -rf node_modules package-lock.json pnpm-lock.yaml yarn.lock
npm install
npm run devDJANGO_SECRET_KEY=
DEBUG=
DJANGO_LOGLEVEL=
DJANGO_ALLOWED_HOSTS=
DATABASE_ENGINE=
DATABASE_NAME=
DATABASE_USERNAME=
DATABASE_PASSWORD=
DATABASE_HOST=
DATABASE_PORT=
DATABASE_URL=
TOKEN_SERCRET=
VITE_SERVER_URL=
VITE_REDIRECT_URL=
GROUP5_SOFTWAREENGINEERING/
βββ backend/
β βββ fango/
β β βββ middleware/
β β β βββ JWTRedisMiddleware.py
β β β βββ RateLimitMiddleware.py
β β β
β β βββ migrations/
β β β βββ 0001_initial.py
β β β βββ 0002_appuser_country_appuser_default_lang_id_and_more.py
β β β βββ 0003_appuser_difficulty.py
β β β
β β βββ services/
β β β βββ mock_response.json
β β β βββ openai_service.py
β β β
β β βββ tests/
β β β βββ test_utils.py
β β β βββ test_views.py
β β β
β β βββ image_handling/
β β β βββ (image helper modules)
β β β
β β βββ media/
β β β βββ (uploaded images)
β β β
β β βββ __init__.py
β β βββ admin.py
β β βββ api_urls.py
β β βββ apps.py
β β βββ asgi.py
β β βββ insert_mock_data.py
β β βββ insert_mock_data2.py
β β βββ insert_mock_languages.py
β β βββ insert_test_data.py
β β βββ managers.py
β β βββ models.py
β β βββ redis_client.py
β β βββ serializers.py
β β βββ settings.py
β β βββ urls.py
β β βββ utils.py
β β βββ views.py
β β βββ wsgi.py
β β
β βββ Dockerfile
β βββ manage.py
β βββ requirements.txt
β
β
βββ frontend/
β βββ data/
β β βββ countries.json
β β βββ languages.json
β β
β βββ src/
β β βββ assets/
β β β βββ pingu_signup.jpg
β β β βββ pingu1.jpg
β β β
β β βββ components/
β β β βββ animation/
β β β β βββ SpringMotionLayout.tsx
β β β β
β β β βββ card/
β β β β βββ CardMenu.tsx
β β β β βββ Cards.tsx
β β β β βββ GalleryPage.tsx
β β β β βββ ImageFlipCard.tsx
β β β β
β β β βββ checkbox/
β β β β βββ MultiCheckbox.tsx
β β β β βββ SingleCheckbox.tsx
β β β β
β β β βββ goals/
β β β β βββ options.tsx
β β β β
β β β βββ nav/
β β β β βββ AppLayout.tsx
β β β β βββ BottomNav.tsx
β β β β
β β β βββ utils/
β β β βββ AuthRoute.tsx
β β β βββ CountrySuggest.ts
β β β βββ LanguageSuggest.ts
β β β βββ PasswordInputStep.tsx
β β β βββ SuggestInputStep.tsx
β β β βββ TextInputStep.tsx
β β β βββ JsonPost.tsx
β β β βββ Logout.tsx
β β
β β βββ pages/
β β β βββ quickguide/
β β β β βββ QuickGuide.tsx
β β β β
β β β βββ quiz/
β β β β βββ DailyQuizDefault.tsx
β β β β βββ DailyQuizResult.tsx
β β β β βββ FavWords.tsx
β β β β
β β β βββ signup/
β β β β βββ EmailStep.tsx
β β β β βββ NameStep.tsx
β β β β βββ PasswordStep.tsx
β β β β βββ SetUpTargetLan.tsx
β β β β βββ SignUp.tsx
β β β β βββ SignUpAllSet.tsx
β β β β βββ SignupContext.tsx
β β β β βββ SignUpDifficulty.tsx
β β β β βββ SignUpGoal.tsx
β β β β βββ Types.tsx
β β β β
β β β βββ status/
β β β β βββ 404.tsx
β β β β βββ Loading.tsx
β β β β
β β β βββ translation/
β β β β βββ Camera.tsx
β β β β βββ Processing.tsx
β β β β βββ Result.tsx
β β β β
β β β βββ user/
β β β βββ Login.tsx
β β β βββ Userhistory.tsx
β β β βββ Userhistoryitem.tsx
β β β βββ Userinfo.tsx
β β β βββ Userlearninginfo.tsx
β β
β βββ Dockerfile
β βββ index.html
β βββ package.json
β βββ package-lock.json
β βββ README.md
β βββ tsconfig.json
β βββ tsconfig.app.json
β βββ tsconfig.node.json
β βββ vite.config.ts
β
βββ docker-compose.yml
βββ README.md
-
User uploads or snaps a photo
-
Backend receives image
-
Image sent β OpenAI Vision
-
AI returns object description
-
Backend sends object β GPT model for:
- Translation into selected language
- Pronunciation guide
- Two mini safety-checked phrases
-
Backend saves both the image + results in PostgreSQL
-
Frontend displays translation + history updates
-
JWT (access + refresh) tokens
-
Login / Register endpoints
-
Protected routes:
- Upload photo
- View history
- Manage account
python manage.py testnpm run test- Offline translation mode
- Speech recognition (ask questions verbally)
- AR translation overlay
- Phrase-of-the-day widget
- Multi-language phrase packs
- Dark mode
- Daily Quiz
- Joe Lin A01079256
- Louise Li A01377263
- Blaise Klein A01300754
- Reece Melnick A01349668
- Inez Yoon A01066348