/TDT4140

App made in TDT4140 Software Engineering, with group 67

Primary LanguageTypeScriptMIT LicenseMIT

ShopStop


ShopStop

ShopStop is a mobile application to make organizing shopping easier!

Getting startedRunning testsDeploymentLicenseLinks


Getting started

Our application is divided into two main parts, a React Native frontend and a Django backend.

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Prerequisites

# Clone this repository
$ git clone https://gitlab.stud.idi.ntnu.no/tdt4140-2020/67.git

Setting up Backend

# Navigate to the backend folder
$ cd 67/shopstop_backend

# Install the required python dependencies
# If you are running Windows and this step fails, remove "uWSGI" from requirements.txt and try again
$ pip install -r requirements.txt

# Migrate the database
$ python manage.py migrate

# Run the server
$ python manage.py runserver IPADDRESS:8000

Where IPADDRESS is the IPv4 address of your machine.

⚠️ You need to manually change ENV.dev.apiUrl in 67/shopstop-frontend/environment.js to IPADDRESS:8000. ⚠️

If you have trouble setting up the backend locally, you can change ENV.dev.apiUrl in 67/shopstop-frontend/environment.js to https://staging.shopstop.xyz/ though this is not recommended.

Setting up Frontend

# Install expo-cli globally
$ npm install -g expo-cli

# Navigate to the frontend folder
$ cd 67/shopstop-frontend

# Install the node dependencies
$ yarn

# Start the Expo server
$ yarn start

The console should now show a QR code.

  • If you are using an Android device, you can scan the QR code using the expo app for android.
  • If you are using an Iphone you can scan the QR code using your Apple Camera App, but you need the expo app for Iphone installed.

Running tests

ESLint

# Navigate to the frontend folder
$ cd 67/shopstop-frontend

# Run the linter
$ yarn lint

# Some problems are fixable using
$ yarn lint --fix

Flake8

# Navigate to the backend folder
$ cd 67/shopstop_backend

# Run the linter
$ flake8 shopstop

Unit tests

# Navigate to the backend folder
$ cd 67/shopstop_backend

# Run the test suite
$ coverage run --source="shopstop" manage.py test

# Get report of the tests ran
$ coverage report

Deployment

This project utilizes the continuous deployment features of gitlab.

The frontend must be distributed manually. By using expo publish you can get an .apk or .ipa depending on if you want to distribute on Android or Iphone, which can be published on their respective app store. Whenever you run expo publish the .apk or .ipa will get the updated version with OTA (over-the-air) updates, which means you do not need to redistribute the application.

License

This project is distributed under the MIT license

Links