Skip to content

A Sudoku puzzle application made with Flutter, Genkit (Powered by Gemini), and Firebase.

License

Notifications You must be signed in to change notification settings

thecodexhub/sudoku

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

84 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sudoku

Sudoku Banner

coverage style: very good analysis License: MIT

A Sudoku puzzle application made with Flutter, Genkit (Powered by Gemini), and Firebase for the Gemini API Competition.

Generated by the Very Good CLI 🤖

You can also checkout the backend application built with Firebase Genkit in its dedicated GitHub Repository.

** Try out the application online here or download the android apk.

Sudoku App

Sudoku Icon created by vectorsmarket15 - Flaticon

Getting Started 🚀

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

*Sudoku works on iOS, Android, and Web.

The project is designed to be integrated with 3 different Firebase projects (depending upon flavor).

The default app instance can be initialized here simply by passing no "name" as an argument in both Dart & manual initialization flows. If you have a google-services.json file in your android project or a GoogleService-Info.plist file in your iOS+ project, it will automatically create a default (named "[DEFAULT]") app instance on the native platform. However, you will still need to call this method before using any FlutterFire plugins.

Hence, every time you try to run the app in android or ios, you have to configure the google-services.json and/or GoogleService-Info.plist. To do that, choose the correct firebase project while running the below command(s):

# Development flavor
flutterfire config --out=lib/firebase_options_development.dart --ios-bundle-id=dev.thecodexhub.sudoku.dev --android-app-id=dev.thecodexhub.sudoku.dev

# Staging flavor
flutterfire config --out=lib/firebase_options_staging.dart --ios-bundle-id=dev.thecodexhub.sudoku.stg --android-app-id=dev.thecodexhub.sudoku.stg

# Production flavor
flutterfire config --out=lib/firebase_options_production.dart --ios-bundle-id=dev.thecodexhub.sudoku --android-app-id=dev.thecodexhub.sudoku

Environment Variables 🚧

The API_BASE_URL and API_KEY environment variables are used in this project. Checkout the .env.example file and copy the content to a .env file.

  • The API_BASE_URL represents the Base URL of the Backend Project which is responsible for creating sudoku and generating hints. Read more about it in the dedicated repository.
  • The API_KEY represents a key used for authorization on the backend server. The frontend or the client is expected to send this key via x-api-key header.

Also, don't forget to run the build_runner command:

dart run build_runner build --delete-conflicting-outputs

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

Working with Translations 🌐

This project relies on flutter_localizations and follows the official internationalization guide for Flutter.

For more details on how to add strings, supported locales, and translations into the app, read the VGV Documentation.

Important Links 🔗