Askinator, a spooky twist on the classic Akinator game!
In this project, the AI has chosen a character, and your goal is to uncover it by asking questions.
But beware—the AI can only answer 'Yes' or 'No'!
You can see the promo video by clicking this link.
You can also play the game with this link in your browser (https://askinator-c6fe5.web.app)
The project is made using Flutter a Google UI framework created in 2017. It uses the Google language Dart created in 2011, Dart.
The application is based on an MVVM architecture using Stacked by FilledStacks as a state management.
The usage of Stacked is for maintainability and readability.
Stacked uses implicitly the Provider package.
The main idea is to use an MVVM pattern to remove any business logic from the UI layouts by putting this logic in a separated view model. This adds more clarity and maintainability.
We can decompose the project into 3 layers: the Models, The Views, and finally the ViewModels.
In the project, the views are for display only.
They can trigger interactions through Buttons/GestureDetector/Events that will call ViewModel methods.
The ViewModel class can extend different types of abstract ViewModels such as:
- BaseViewModel
- ReactiveViewModel
- And many more, but we mostly use those, you can refer to the stacked documentation
The ViewModel data-bind all the data from the services and models, create getters for the view, and notifies the view of any changes (using a ReactiveServiceMixin or a NotifyListeners)
The project utilizes AppWrite.io as a cloud backend to handle:
- Database Management: Stores information about the leaderboard.
- Anonymous Authentication: Allows players to start the game without requiring sign-in, making it easy and accessible for quick sessions.
- Cloud Functions: Calls a Hugging Face API to enable the AI to respond with a "Yes" or "No" to user questions.
This integration allows the app to offer a seamless, interactive experience by handling backend processing efficiently, while Hugging Face provides the natural language processing capability for AI responses.
- Install the Flutter SDK following the official documentation
Then use the
flutter doctorto verify your install - Clone the project.
- Run the
flutter pub getcommand to fetch the dependencies needed to build the project. - Use the
flutter pub run build_runner build --delete-conflicting-outputsto generate the GetIt config. - Finally, use the
flutter runcommand to launch your app on your device.