A simple link shortener app. A novel equatable-stack library was born out of this project.
- 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.
- Flutter Bloc : State management & built in testing support.
- Dio : Handling network calls.
- Freezed & Json Serializable: Data classes and Json serialization.
- Mocktail : For mocking dependencies.
- Very Good Cli : Quickly bootstrapping projects with standard practices.
- 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
- 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.
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.
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
Generated by the Very Good CLI 🤖