Code Monkey home page Code Monkey logo

app's Introduction

Pirate Code 3.0 - An App for the Pattonville School District

Netlify Status Dart coverage spelling style: very good analysis

A (Very Good) new Flutter project initially generated by the by the Very Good CLI 🤖

More Information

We don't believe that READMEs should be a 15 Terabyte1 file, so we broke it up.

  • For more information about this project, and how to get started, look at our wiki.
  • For more information about us, check out our organization readme. Finally,
  • For more information about our progress, you could take a peek at our meta-project board.

Footnotes

  1. Not that ours was before... but it was getting on the larger side.

app's People

Contributors

dependabot[bot] avatar lishaduck avatar parkerh27 avatar petalcat avatar

Stargazers

 avatar  avatar

Watchers

 avatar

app's Issues

GH Bots

Why

Why not?

The Plan

Tasks

Upgrade Consumers

Why

We need to follow best practices.

Related: #126.

The Plan

Tasks

Release

Where we want to deploy our code:

Locations

  1. 0 of 2
    blocked external
    ParkerH27 PetalCat
    lishaduck

Models

For Json Serialization, we should make a new class:

abstract interface class Model {
  toJson();
  fromJson();
  ...
}

And make all of the models inherit from them. Then, move the models to their own files. Will required adding a dependency on json_serializable.

Blocked by: #129

Use Melos

If we want to break stuff into multiple packages, it looks like Melos is the standard.

Originally posted by @lishaduck in #13 (reply in thread)

Having messed with our setup, I think using Melos would be a good idea, @ParkerH27.
Here's what I'm thinking:

.
├── ios/
│   └── [...]
├── lib/
│   ├── main.dart
│   ├─── main_[*].dart
├── linux/
│   └── [...]
├── macos/
│   └── [...]
├── packages/
│   ├── app/
│   │   ├── pages/
│   │   │   ├── favorites
│   │   │   │   ├── favorites.dart
│   │   │   │   ├── favorites_logic.dart
│   │   │   │   └── favorites_page.dart
│   │   │   └── [...]
│   │   ├── tests/
│   │   │   └── [...]
│   │   ├── app.dart
│   │   ├─── app_view.dart
│   │   ├─── app_router.dart
│   │   ├── bootstrap.dart
│   │   └── wrapper.dart
│   ├── server/
│   │   ├── src/server/
│   │   │   ├── __init__.py
│   │   │   ├── main.py
│   │   │   └── [...]
│   │   ├── tests/
│   │   │   └── [...]
│   │   ├── pyproject.toml
│   │   └─── poetry.lock
│   ├── shared/
│   │   ├── l10n/
│   │   │   ├── arb/
│   │   │   │   └── [...]
│   │   │   └── l10n.dart
│   │   ├── test/
│   │   │   ├── helpers.dart
│   │   │   └── pump_app.dart
│   │   ├── tests/
│   │   │   └── [...]
│   │   └── model.dart
│   └── widgets/
│       ├── big_card
│       │   ├── big_card.dart
│       │   ├─── big_card_logic.dart
│       │   └─── big_card_page.dart
│       ├── [...]
│       └── tests/
│           └── [...]
├── web/
│   └── [...]
├── windows/
│   └── [...]
├── melos.yaml
└── pubspec.yaml

The only question I would have would be how codegen would work.

Decide which blockchain to use

Discussed in #40

Originally posted by ParkerH27 May 18, 2023

Blockchains

Chat-GPT recommended:

ChatGPT

BigChainDB

Prompt

How would I set up BigChainDB as a server in Python with a Dart/Flutter client?

ChatGPT:

To set up BigchainDB as a server using Python and create a Dart/Flutter client to interact with it, you can follow these steps:

Setting up BigchainDB Server:
Install BigchainDB:

Begin by installing BigchainDB on your server. Refer to the official BigchainDB documentation for detailed instructions based on your operating system: https://docs.bigchaindb.com/en/latest/installing-server.html

Configure BigchainDB:

After installation, configure the BigchainDB server by modifying the configuration file (<bigchaindb.conf>). Adjust the settings as per your requirements, such as the database backend, API endpoints, and network parameters. Refer to the official documentation for configuration details: https://docs.bigchaindb.com/projects/server/en/latest/drivers-clients/http-client-server-api.html#configuration

Start BigchainDB Server:

Once configured, start the BigchainDB server. You can typically do this by running a command such as bigchaindb start. Verify that the server is running correctly and accessible through the configured API endpoints.

Creating a Dart/Flutter Client:
Set Up Flutter Project:

Create a new Flutter project or use an existing one. Ensure you have the necessary Dart and Flutter SDKs installed on your development machine.

Add Dependencies:

Open the pubspec.yaml file in your Flutter project and add the required dependencies to interact with the BigchainDB server. You can use the package:http for making HTTP requests and dart:convert for JSON parsing. Here's an example of adding dependencies in a pubspec.yaml:

dependencies:
  http: ^0.13.3
  dart:convert: ^3.0.1
Implement API Calls:

In your Dart/Flutter project, create the necessary code to interact with the BigchainDB server through HTTP requests. Use the package:http to make GET, POST, PUT, or DELETE requests to the appropriate endpoints provided by the BigchainDB server API.

For example, you can use the package:http to send a GET request to retrieve a transaction based on its ID:

import 'package:http/http.dart' as http;
import 'dart:convert';

Future<Map<String, dynamic>> getTransactionById(String id) async {
  final response = await http.get(Uri.parse('http://your-bigchaindb-server/api/v1/transactions/$id'));
  if (response.statusCode == 200) {
    return json.decode(response.body);
  } else {
    throw Exception('Failed to retrieve transaction');
  }
}
Integrate API Calls in the UI:

Use the API calls you implemented in your Flutter UI to display and interact with the data from the BigchainDB server. Design your UI screens to allow users to perform actions such as creating transactions, querying transactions, or updating asset information.

Test and Run:

Test your Dart/Flutter client by running the app on an emulator, simulator, or physical device. Verify that the app successfully communicates with the BigchainDB server and performs the desired operations.

Please note that the example provided is a basic illustration of interacting with the BigchainDB server using Dart/Flutter. Depending on your specific requirements, you may need to implement additional API calls and handle authentication or other security considerations. Refer to the BigchainDB API documentation for more details on available endpoints and how to interact with the server: https://docs.bigchaindb.com/projects/server/en/latest/drivers-clients/http-client-server-api.html

Remember to adapt the code and configurations to your specific server and API endpoints.

Quorum

Prompt

How would I set up Quorum as a server in Python with a Dart/Flutter client?

ChatGPT:

Setting up Quorum as a server in Python and creating a Dart/Flutter client involves several steps. Here's a high-level overview of the process:

Set Up Quorum Server:
Install Quorum:

Follow the official Quorum documentation to install and configure Quorum on your server. This typically involves setting up a network of nodes and configuring the consensus mechanism (e.g., Raft, Istanbul BFT, etc.).

Configure the network:

Define the network configuration, including the number of nodes, their IP addresses, ports, and the consensus algorithm you want to use.

Deploy contracts:

Write and deploy the necessary smart contracts to manage your fake currency. You can use Solidity to write the contracts, and the Quorum-specific toolchain (e.g., Truffle with Quorum plugin) for deployment.

Develop the Python Server:
Choose a Python web framework:

Select a suitable Python web framework like Flask or Django to develop the server-side application. These frameworks provide the necessary tools for handling HTTP requests, managing routes, and interacting with the Quorum network.

Connect to Quorum:

Use a Quorum-specific Python library like Web3.py to establish a connection between your Python server and the Quorum network. Web3.py provides APIs to interact with smart contracts, send transactions, and query the blockchain.

Implement the server-side logic:

Write the necessary Python code to handle requests from the Flutter client, such as creating transactions, querying balances, and interacting with the smart contracts deployed on Quorum.

Develop the Dart/Flutter Client:
Set up Dart/Flutter:

Install the Dart SDK and Flutter framework on your development machine.

Create a Flutter project:

Use the Flutter CLI to create a new Flutter project.

Implement the user interface:

Design and develop the UI of your app using Flutter widgets. This includes screens for creating transactions, displaying balances, and other desired functionality.

Implement the client-side logic:

Write Dart code to handle interactions with the Python server. Use HTTP libraries like Dio or the Flutter-specific package:http to send requests to the server and process the responses.

Test and Debug:

Test the server-side application and the Flutter client to ensure they function correctly. Perform unit tests and integration tests to identify and fix any issues or bugs.
Debug any issues that arise during testing and address them accordingly.

Deploy and Maintain:

Deploy the Python server to a hosting platform or your own server infrastructure. Ensure that the server is accessible and secured properly.
Package and distribute the Flutter app for deployment on Android and iOS devices.
Regularly maintain and update both the server-side application and the Flutter client to improve functionality, security, and compatibility with new versions of Quorum and Flutter.

It's important to note that the steps mentioned above provide a general guideline, and the specific implementation details may vary depending on your project requirements and the versions of Quorum, Python, and Flutter you are using. Refer to the official documentation and relevant resources for more detailed instructions and examples.

Tasks

Seal Freezed Classes

The Plan

Tasks

Login Screen

Tasks

Remove Flavors

They're a whole lot more hassle than they're worth.

Tasks

Supersedes: #103

Web Doesn't Load

Why you need to check before pushing breaking refactors... 21c46da broke the web build.
See #69 for change context.

Minor Updates

Tasks

Hosting

So...Netlify works for now, but when we start querying the Python server, we'll need something different.
Options:

  • webapp.io — I've used this tool before. I didn't like it, but it does what we need. It's a full-stack review environment and deployment service that uses a concurrent version of docker called Firecracker, which is what powers AWS Lambda.
  • Azure — Comes with the student developer plan, but it's quite limited in both free and out-of-the-box. I don't want to, say, have to learn Kubernetes just to do what I can do with the click of a button on Netlify. However, It has a tutorial on serverless FastAPI functions and a more advanced tutorial for non-FastAPI serverless functions, so it might work. However, it comes with 1 million free requests a month,1 so maybe pricing ain't an issue.
  • (GCP (Google Cloud Platform))[https://cloud.google.com/run/docs/quickstarts/build-and-deploy/deploy-python-service]
  • local hosting (I (@PetalCat) have a machine for VMs and a network) I think this is a last-ditch option and can only be used for devin'.

Footnotes

  1. In case you were wondering, that's the same as AWS Lambda's free plan.

Use Sentry Tools

Would using Codecov be more effective than our current testing setup?
Also, while I'm thinking about Sentry, we should see if Pattonville has a preferred logging framework because while Sentry supports Flutter, it doesn't let multiple users use it on the free plan.

Originally posted by @lishaduck in #28 (comment)

Having thought about it, I think using a logging framework is a good idea, so we'll need to ask if the district has a Sentry plan. We could also set up Codecov.
Having looked into it, both Sentry and Codecov have a (free!) student plan through GitHub though, so maybe we wouldn't need to get seats on the district's plan. Which we both know they probably wouldn't let us do. 😁

Course Guidebook

"It's...essentially the course guidebook in an app, and kids can click on the classes to get and description and see what prerequisites it needs and what area(s) it counts for (like Pract. Art, Fine Art). They can also keep track of what they have already taken and passed and what they still need."

This fills a need that the general student body has. Homeroom was chaos the other day because of the lack of this, and the Map Your Journey website is not particularly useful.

Decide which blockchain to use

Blockchains

Chat-GPT recommended:

ChatGPT

BigChainDB

Prompt

How would I set up BigChainDB as a server in Python with a Dart/Flutter client?

ChatGPT:

To set up BigchainDB as a server using Python and create a Dart/Flutter client to interact with it, you can follow these steps:

Setting up BigchainDB Server:
Install BigchainDB:

Begin by installing BigchainDB on your server. Refer to the official BigchainDB documentation for detailed instructions based on your operating system: https://docs.bigchaindb.com/en/latest/installing-server.html

Configure BigchainDB:

After installation, configure the BigchainDB server by modifying the configuration file (<bigchaindb.conf>). Adjust the settings as per your requirements, such as the database backend, API endpoints, and network parameters. Refer to the official documentation for configuration details: https://docs.bigchaindb.com/projects/server/en/latest/drivers-clients/http-client-server-api.html#configuration

Start BigchainDB Server:

Once configured, start the BigchainDB server. You can typically do this by running a command such as bigchaindb start. Verify that the server is running correctly and accessible through the configured API endpoints.

Creating a Dart/Flutter Client:
Set Up Flutter Project:

Create a new Flutter project or use an existing one. Ensure you have the necessary Dart and Flutter SDKs installed on your development machine.

Add Dependencies:

Open the pubspec.yaml file in your Flutter project and add the required dependencies to interact with the BigchainDB server. You can use the package:http for making HTTP requests and dart:convert for JSON parsing. Here's an example of adding dependencies in a pubspec.yaml:

dependencies:
  http: ^0.13.3
  dart:convert: ^3.0.1
Implement API Calls:

In your Dart/Flutter project, create the necessary code to interact with the BigchainDB server through HTTP requests. Use the package:http to make GET, POST, PUT, or DELETE requests to the appropriate endpoints provided by the BigchainDB server API.

For example, you can use the package:http to send a GET request to retrieve a transaction based on its ID:

import 'package:http/http.dart' as http;
import 'dart:convert';

Future<Map<String, dynamic>> getTransactionById(String id) async {
  final response = await http.get(Uri.parse('http://your-bigchaindb-server/api/v1/transactions/$id'));
  if (response.statusCode == 200) {
    return json.decode(response.body);
  } else {
    throw Exception('Failed to retrieve transaction');
  }
}
Integrate API Calls in the UI:

Use the API calls you implemented in your Flutter UI to display and interact with the data from the BigchainDB server. Design your UI screens to allow users to perform actions such as creating transactions, querying transactions, or updating asset information.

Test and Run:

Test your Dart/Flutter client by running the app on an emulator, simulator, or physical device. Verify that the app successfully communicates with the BigchainDB server and performs the desired operations.

Please note that the example provided is a basic illustration of interacting with the BigchainDB server using Dart/Flutter. Depending on your specific requirements, you may need to implement additional API calls and handle authentication or other security considerations. Refer to the BigchainDB API documentation for more details on available endpoints and how to interact with the server: https://docs.bigchaindb.com/projects/server/en/latest/drivers-clients/http-client-server-api.html

Remember to adapt the code and configurations to your specific server and API endpoints.

Quorum

Prompt

How would I set up Quorum as a server in Python with a Dart/Flutter client?

ChatGPT:

Setting up Quorum as a server in Python and creating a Dart/Flutter client involves several steps. Here's a high-level overview of the process:

Set Up Quorum Server:
Install Quorum:

Follow the official Quorum documentation to install and configure Quorum on your server. This typically involves setting up a network of nodes and configuring the consensus mechanism (e.g., Raft, Istanbul BFT, etc.).

Configure the network:

Define the network configuration, including the number of nodes, their IP addresses, ports, and the consensus algorithm you want to use.

Deploy contracts:

Write and deploy the necessary smart contracts to manage your fake currency. You can use Solidity to write the contracts, and the Quorum-specific toolchain (e.g., Truffle with Quorum plugin) for deployment.

Develop the Python Server:
Choose a Python web framework:

Select a suitable Python web framework like Flask or Django to develop the server-side application. These frameworks provide the necessary tools for handling HTTP requests, managing routes, and interacting with the Quorum network.

Connect to Quorum:

Use a Quorum-specific Python library like Web3.py to establish a connection between your Python server and the Quorum network. Web3.py provides APIs to interact with smart contracts, send transactions, and query the blockchain.

Implement the server-side logic:

Write the necessary Python code to handle requests from the Flutter client, such as creating transactions, querying balances, and interacting with the smart contracts deployed on Quorum.

Develop the Dart/Flutter Client:
Set up Dart/Flutter:

Install the Dart SDK and Flutter framework on your development machine.

Create a Flutter project:

Use the Flutter CLI to create a new Flutter project.

Implement the user interface:

Design and develop the UI of your app using Flutter widgets. This includes screens for creating transactions, displaying balances, and other desired functionality.

Implement the client-side logic:

Write Dart code to handle interactions with the Python server. Use HTTP libraries like Dio or the Flutter-specific package:http to send requests to the server and process the responses.

Test and Debug:

Test the server-side application and the Flutter client to ensure they function correctly. Perform unit tests and integration tests to identify and fix any issues or bugs.
Debug any issues that arise during testing and address them accordingly.

Deploy and Maintain:

Deploy the Python server to a hosting platform or your own server infrastructure. Ensure that the server is accessible and secured properly.
Package and distribute the Flutter app for deployment on Android and iOS devices.
Regularly maintain and update both the server-side application and the Flutter client to improve functionality, security, and compatibility with new versions of Quorum and Flutter.

It's important to note that the steps mentioned above provide a general guideline, and the specific implementation details may vary depending on your project requirements and the versions of Quorum, Python, and Flutter you are using. Refer to the official documentation and relevant resources for more detailed instructions and examples.

Fix DevSkim issues

Currently they're ignored via the security tab, but Swift does need to be added to code-scanning, and it would be nice to use actual DevSkim ignores for DS137138

Tasks

Use Flavors

We should also take advantage of flutter_launcher_icons and flutter_native_splash with their flavor support.

While I'm thinking about it, there was also a good series of articles on Medium that I stumbled upon which you might want to look at, @ParkerH27:

Investigate Existing PSD App

Premise

Both the PLTW Blog and the STL American report that in 2016-7 the capstone class made an app. What happened? How can we

  • find it,
  • reuse it, and
  • make sure we don't suffer the same fate.

After all, it was another in-house PowerSchool wrapper.
For some reason, it's no longer on the App store or the Play store, despite both articles claiming that was the crowning triumph: that it was on both platforms.
Of course, we'll also be on the web.

If you know anything, @ParkerH27, please tell.

Investigations

Notes (for posterity):

Conclusions are in #14.

App routing issues

This's just an issue for an issue.
Honestly, Idk why this is/how this became broken.

Code Time

We need to track our total code time for the ELO to prove our work.

This looked like a good solution: Code Time.

Wallet

Here's the full todo list for the Wallet:

Tasks

  1. 2 of 5
    dart enhancement
    ParkerH27 PetalCat
    lishaduck
  2. 0 of 1
    enhancement help-wanted
    PetalCat lishaduck
  3. 0 of 4
    blocked dart enhancement
    ParkerH27 PetalCat
    lishaduck

Use `very_good_anaysis` and `dcm`

  • Seeing 5af1a59...83d5ec8 found so many errors, we could use a more complete configuration.
  • So... we should use a package so we don't spend too much time messing with it, or else I will.
  • So, we should use very_good_analysis because I'm good at writing unidiomatic Dart code.
  • This is blocked on VeryGoodOpenSource/very_good_analysis/pull/73 because we use Dart 3, and they don't support it quite yet.
  • That PR is blocked on Dart 3.1.0, which is blocked on Flutter 3.11.
  • So we might be waiting a while.
  • Meanwhile, we could use dart_code_metrics, but it also doesn't support Dart 3 or analyzer 5.12.0 (dart-code-checker/dart-code-metrics#1231), which custom_lint1 uses.

Footnotes

  1. The package that powers riverpod_lint

Realtime API

Why

Users need to see the latest and greatest data. Let's use Appwrite's Realtime API to subscribe to changes.

The Plan

Tasks

Conclusions from Previous Arts

What we concluded from #1 and #16.

How to Prevent Obsoletion

Netlify

While we won't need to stop using Netlify now that we're using Appwrite, it is slow.
Let's speed up deployments by reusing the already created web artifacts and deploying via actions.

Vite

Vite is framework agnostic, and its only want is a single HTML file. Since Flutter makes SPAs, not MPAs, we can bundle it through Vite if we want. This is important if we want offline because we'll have to use vite-plugin-pwa until flutter/flutter#60069 is resolved.

Grades via Canvas and Powerschool APIs

Automate getting the GPA for the calculator via the Canvas and PowerSchool GraphQL and RESTful APIs.

Todo list for Grades

Use `flutter_web_preloader`

Until #12 is resolved, and maybe even after, we should use flutter_web_preloader to preload the app.

Tasks

Minor, Misc

Why

I needed to write it down before I forgot.

The Plan

Tasks

  1. 2 of 4
    enhancement github_actions good-first-issue
    lishaduck

Goofy Assertion Failed Error

Useful links:

Code:

@AutoRouterConfig(replaceInRouteName: "Page,Route")
class NavigationManager extends _$NavigationManager {
  @override
  RouteType get defaultRouteType => const RouteType.material();

  @override
  List<AutoRoute> get routes => [
        AutoRoute(
          path: "/",
          page: MyHomeRoute.page,
          children: [
            AutoRoute(page: GeneratorRoute.page, path: ""),
            AutoRoute(page: FavoritesRoute.page, path: "favorites"),
          ],
        ),
        RedirectRoute(path: "*", redirectTo: "/"),
      ];
}

ChatGPT description:

The code you have provided appears to be written in Dart language and is defining the routing configuration for an application using the auto_route package.

The get routes method is overriding the base class method to return a list of AutoRoute objects. Each AutoRoute object represents a path within the application that maps to a specific page or view.

In this example, there are two routes defined:

  • The root route / points to the MyHomeRoute page, and has two child routes defined: GeneratorRoute and FavoritesRoute.
  • The RedirectRoute is a catch-all route that redirects any invalid routes to the root route.

Here's a brief explanation of each property used in the AutoRoute and RedirectRoute objects:

  • path: A string that defines the path for the route.
  • page: The page or view that will be displayed for the route.
  • children: An optional list of child routes that can be nested under the parent route.
  • redirectTo: The path to redirect to when a route does not match any of the defined routes.

Overall, this code is setting up the routing configuration for the application, allowing users to navigate between different views based on the path they visit.

Error:

Assertion failed: file:///Users/user/.pub-cache/hosted/pub.dev/auto_route7.1.0/lib/src/route/auto_route_config.dart:419:12this[key]?.children != null
"MyHomeRoute does not have children"
See also: https://flutter.dev/docs/testing/errors

ChatGPT:

This error message indicates that there is an assertion failure in the auto_route package related to the MyHomeRoute page.

The error message suggests that the MyHomeRoute page does not have any child routes defined, but the AutoRoute configuration is trying to add child routes to it. This means that there may be a mismatch between the AutoRoute configuration and the actual structure of the pages and routes in the application.

To resolve this error, you should review the AutoRoute configuration and ensure that the MyHomeRoute page does not have any child routes defined. If MyHomeRoute is intended to have child routes, then you should update the AutoRoute configuration accordingly.

You may also want to check the documentation for the auto_route package to ensure that you are using it correctly, and review any relevant code samples or examples to get a better understanding of how to configure routes and pages within your application.

Split CI Pipeline in Half

We should split the CI pipeline into two workflows for more granular control.

Tasks

CI Flakes...

...Again. It works fine locally. #93 might help make it more reproducible.
If we don't get it fixed, we won't trust it anymore.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.