Skip to content

A production ready Link Shortener App. Features a highly scalable architecture desgined using TDD.

License

Notifications You must be signed in to change notification settings

realshovanshah/sample-production-app

Repository files navigation

Link Shortener App

coverage style: very good analysis License: MIT Commitizen friendly

A simple link shortener app. A novel equatable-stack library was born out of this project.


Features

  • The user can type the website URL to shorten them using the given service.
  • A list with the recently shortened links/aliases.
  • Caching and sorting implementation can also be found in their respective branches.

Dependencies

Architecture & Processes

  • Layered architecture with a good separation of concerns between the presentation layer, business logic, repositories & the network layer.
  • Tried to follow TDD. Fully tested code. (Widget, Unit & some Integration Tests)
  • In par with the Test Pyramid

Improvements

  • Add a feature to fetch a url by it's alias.
  • Add more integration and E2E tests.
  • More fined grained exception handling.
  • Discuss other implementations for showing the recently shortened urls.
  • Fix redundant documentations
  • Make the url shortener state more explicit (eg. by adding a maybe function)
  • Refactor the tests to follow the robot testing pattern for better readability and maintenance
  • Take screenshot when the integration test fails.
  • Migrate flutter_driver to the integration_test package.

Running the project πŸš€

Prerequisite: Flutter installed on your device. Feel free to consult the official docs.

This project contains 3 flavors:

  • development
  • staging
  • production

To run the desired flavor either use the launch configuration in VSCode/Android Studio or use the following commands:

# Development
$ flutter run --flavor development --target lib/main_development.dart

# Staging
$ flutter run --flavor staging --target lib/main_staging.dart

# Production
$ flutter run --flavor production --target lib/main_production.dart

*Link shortener works on iOS, Android, and Web.


Running Tests πŸ§ͺ

To run all unit and widget tests use the following command:

$ flutter test --coverage --test-randomize-ordering-seed random

To view the generated coverage report you can use lcov.

# Generate Coverage Report
$ genhtml coverage/lcov.info -o coverage/

# Open Coverage Report
$ open coverage/index.html

To run the integration tests, connect to a device and run:

$ flutter drive --flavor development -t test_driver/link_shortener_app.dart

App Screenshots

Home/Recents Shortened Urls


Generated by the Very Good CLI πŸ€–

About

A production ready Link Shortener App. Features a highly scalable architecture desgined using TDD.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages