Babies are free

This commit is contained in:
Nate Anderson 2025-01-29 17:50:44 -07:00
commit b99560e34b
35 changed files with 2533 additions and 0 deletions

1
.envrc Normal file
View File

@ -0,0 +1 @@
use flake

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
**/.direnv/**

View File

@ -0,0 +1,405 @@
{
"configVersion": 2,
"packages": [
{
"name": "_fe_analyzer_shared",
"rootUri": "file:///home/nate/.pub-cache/hosted/pub.dev/_fe_analyzer_shared-79.0.0",
"packageUri": "lib/",
"languageVersion": "3.3"
},
{
"name": "_macros",
"rootUri": "file:///nix/store/54q00lm2yc79rnj09l9kcy3d52111h9h-dart-3.6.0/pkg/_macros",
"packageUri": "lib/",
"languageVersion": "3.4"
},
{
"name": "adaptive_number",
"rootUri": "file:///home/nate/.pub-cache/hosted/pub.dev/adaptive_number-1.0.0",
"packageUri": "lib/",
"languageVersion": "2.12"
},
{
"name": "analyzer",
"rootUri": "file:///home/nate/.pub-cache/hosted/pub.dev/analyzer-7.2.0",
"packageUri": "lib/",
"languageVersion": "3.3"
},
{
"name": "args",
"rootUri": "file:///home/nate/.pub-cache/hosted/pub.dev/args-2.6.0",
"packageUri": "lib/",
"languageVersion": "3.3"
},
{
"name": "async",
"rootUri": "file:///home/nate/.pub-cache/hosted/pub.dev/async-2.12.0",
"packageUri": "lib/",
"languageVersion": "3.4"
},
{
"name": "boolean_selector",
"rootUri": "file:///home/nate/.pub-cache/hosted/pub.dev/boolean_selector-2.1.2",
"packageUri": "lib/",
"languageVersion": "3.1"
},
{
"name": "clock",
"rootUri": "file:///home/nate/.pub-cache/hosted/pub.dev/clock-1.1.2",
"packageUri": "lib/",
"languageVersion": "3.4"
},
{
"name": "collection",
"rootUri": "file:///home/nate/.pub-cache/hosted/pub.dev/collection-1.19.1",
"packageUri": "lib/",
"languageVersion": "3.4"
},
{
"name": "convert",
"rootUri": "file:///home/nate/.pub-cache/hosted/pub.dev/convert-3.1.2",
"packageUri": "lib/",
"languageVersion": "3.4"
},
{
"name": "coverage",
"rootUri": "file:///home/nate/.pub-cache/hosted/pub.dev/coverage-1.11.1",
"packageUri": "lib/",
"languageVersion": "3.4"
},
{
"name": "crypto",
"rootUri": "file:///home/nate/.pub-cache/hosted/pub.dev/crypto-3.0.6",
"packageUri": "lib/",
"languageVersion": "3.4"
},
{
"name": "dart_frog",
"rootUri": "file:///home/nate/.pub-cache/hosted/pub.dev/dart_frog-1.2.0",
"packageUri": "lib/",
"languageVersion": "3.0"
},
{
"name": "dart_jsonwebtoken",
"rootUri": "file:///home/nate/.pub-cache/hosted/pub.dev/dart_jsonwebtoken-2.16.0",
"packageUri": "lib/",
"languageVersion": "2.12"
},
{
"name": "ed25519_edwards",
"rootUri": "file:///home/nate/.pub-cache/hosted/pub.dev/ed25519_edwards-0.3.1",
"packageUri": "lib/",
"languageVersion": "2.12"
},
{
"name": "file",
"rootUri": "file:///home/nate/.pub-cache/hosted/pub.dev/file-6.1.4",
"packageUri": "lib/",
"languageVersion": "2.12"
},
{
"name": "fixnum",
"rootUri": "file:///home/nate/.pub-cache/hosted/pub.dev/fixnum-1.1.1",
"packageUri": "lib/",
"languageVersion": "3.1"
},
{
"name": "frontend_server_client",
"rootUri": "file:///home/nate/.pub-cache/hosted/pub.dev/frontend_server_client-4.0.0",
"packageUri": "lib/",
"languageVersion": "3.0"
},
{
"name": "glob",
"rootUri": "file:///home/nate/.pub-cache/hosted/pub.dev/glob-2.1.3",
"packageUri": "lib/",
"languageVersion": "3.3"
},
{
"name": "hotreloader",
"rootUri": "file:///home/nate/.pub-cache/hosted/pub.dev/hotreloader-4.3.0",
"packageUri": "lib/",
"languageVersion": "3.0"
},
{
"name": "http_methods",
"rootUri": "file:///home/nate/.pub-cache/hosted/pub.dev/http_methods-1.1.1",
"packageUri": "lib/",
"languageVersion": "2.12"
},
{
"name": "http_multi_server",
"rootUri": "file:///home/nate/.pub-cache/hosted/pub.dev/http_multi_server-3.2.2",
"packageUri": "lib/",
"languageVersion": "3.2"
},
{
"name": "http_parser",
"rootUri": "file:///home/nate/.pub-cache/hosted/pub.dev/http_parser-4.1.2",
"packageUri": "lib/",
"languageVersion": "3.4"
},
{
"name": "io",
"rootUri": "file:///home/nate/.pub-cache/hosted/pub.dev/io-1.0.5",
"packageUri": "lib/",
"languageVersion": "3.4"
},
{
"name": "js",
"rootUri": "file:///home/nate/.pub-cache/hosted/pub.dev/js-0.7.1",
"packageUri": "lib/",
"languageVersion": "3.1"
},
{
"name": "json_annotation",
"rootUri": "file:///home/nate/.pub-cache/hosted/pub.dev/json_annotation-4.9.0",
"packageUri": "lib/",
"languageVersion": "3.0"
},
{
"name": "logging",
"rootUri": "file:///home/nate/.pub-cache/hosted/pub.dev/logging-1.3.0",
"packageUri": "lib/",
"languageVersion": "3.4"
},
{
"name": "macros",
"rootUri": "file:///home/nate/.pub-cache/hosted/pub.dev/macros-0.1.3-main.0",
"packageUri": "lib/",
"languageVersion": "3.4"
},
{
"name": "matcher",
"rootUri": "file:///home/nate/.pub-cache/hosted/pub.dev/matcher-0.12.17",
"packageUri": "lib/",
"languageVersion": "3.4"
},
{
"name": "meta",
"rootUri": "file:///home/nate/.pub-cache/hosted/pub.dev/meta-1.16.0",
"packageUri": "lib/",
"languageVersion": "2.12"
},
{
"name": "mime",
"rootUri": "file:///home/nate/.pub-cache/hosted/pub.dev/mime-2.0.0",
"packageUri": "lib/",
"languageVersion": "3.2"
},
{
"name": "mocktail",
"rootUri": "file:///home/nate/.pub-cache/hosted/pub.dev/mocktail-1.0.4",
"packageUri": "lib/",
"languageVersion": "2.12"
},
{
"name": "node_preamble",
"rootUri": "file:///home/nate/.pub-cache/hosted/pub.dev/node_preamble-2.0.2",
"packageUri": "lib/",
"languageVersion": "2.12"
},
{
"name": "package_config",
"rootUri": "file:///home/nate/.pub-cache/hosted/pub.dev/package_config-2.1.1",
"packageUri": "lib/",
"languageVersion": "3.4"
},
{
"name": "path",
"rootUri": "file:///home/nate/.pub-cache/hosted/pub.dev/path-1.9.1",
"packageUri": "lib/",
"languageVersion": "3.4"
},
{
"name": "pointycastle",
"rootUri": "file:///home/nate/.pub-cache/hosted/pub.dev/pointycastle-3.9.1",
"packageUri": "lib/",
"languageVersion": "3.2"
},
{
"name": "pool",
"rootUri": "file:///home/nate/.pub-cache/hosted/pub.dev/pool-1.5.1",
"packageUri": "lib/",
"languageVersion": "2.12"
},
{
"name": "pub_semver",
"rootUri": "file:///home/nate/.pub-cache/hosted/pub.dev/pub_semver-2.1.5",
"packageUri": "lib/",
"languageVersion": "3.4"
},
{
"name": "shared_models",
"rootUri": "../../shared_models",
"packageUri": "lib/",
"languageVersion": "3.0"
},
{
"name": "shelf",
"rootUri": "file:///home/nate/.pub-cache/hosted/pub.dev/shelf-1.4.2",
"packageUri": "lib/",
"languageVersion": "3.4"
},
{
"name": "shelf_hotreload",
"rootUri": "file:///home/nate/.pub-cache/hosted/pub.dev/shelf_hotreload-1.5.0",
"packageUri": "lib/",
"languageVersion": "2.17"
},
{
"name": "shelf_packages_handler",
"rootUri": "file:///home/nate/.pub-cache/hosted/pub.dev/shelf_packages_handler-3.0.2",
"packageUri": "lib/",
"languageVersion": "2.17"
},
{
"name": "shelf_static",
"rootUri": "file:///home/nate/.pub-cache/hosted/pub.dev/shelf_static-1.1.3",
"packageUri": "lib/",
"languageVersion": "3.3"
},
{
"name": "shelf_web_socket",
"rootUri": "file:///home/nate/.pub-cache/hosted/pub.dev/shelf_web_socket-2.0.1",
"packageUri": "lib/",
"languageVersion": "3.3"
},
{
"name": "source_map_stack_trace",
"rootUri": "file:///home/nate/.pub-cache/hosted/pub.dev/source_map_stack_trace-2.1.2",
"packageUri": "lib/",
"languageVersion": "3.3"
},
{
"name": "source_maps",
"rootUri": "file:///home/nate/.pub-cache/hosted/pub.dev/source_maps-0.10.13",
"packageUri": "lib/",
"languageVersion": "3.3"
},
{
"name": "source_span",
"rootUri": "file:///home/nate/.pub-cache/hosted/pub.dev/source_span-1.10.1",
"packageUri": "lib/",
"languageVersion": "3.1"
},
{
"name": "stack_trace",
"rootUri": "file:///home/nate/.pub-cache/hosted/pub.dev/stack_trace-1.12.1",
"packageUri": "lib/",
"languageVersion": "3.4"
},
{
"name": "stream_channel",
"rootUri": "file:///home/nate/.pub-cache/hosted/pub.dev/stream_channel-2.1.4",
"packageUri": "lib/",
"languageVersion": "3.3"
},
{
"name": "stream_transform",
"rootUri": "file:///home/nate/.pub-cache/hosted/pub.dev/stream_transform-2.1.1",
"packageUri": "lib/",
"languageVersion": "3.1"
},
{
"name": "string_scanner",
"rootUri": "file:///home/nate/.pub-cache/hosted/pub.dev/string_scanner-1.4.1",
"packageUri": "lib/",
"languageVersion": "3.1"
},
{
"name": "term_glyph",
"rootUri": "file:///home/nate/.pub-cache/hosted/pub.dev/term_glyph-1.2.2",
"packageUri": "lib/",
"languageVersion": "3.1"
},
{
"name": "test",
"rootUri": "file:///home/nate/.pub-cache/hosted/pub.dev/test-1.25.14",
"packageUri": "lib/",
"languageVersion": "3.5"
},
{
"name": "test_api",
"rootUri": "file:///home/nate/.pub-cache/hosted/pub.dev/test_api-0.7.4",
"packageUri": "lib/",
"languageVersion": "3.5"
},
{
"name": "test_core",
"rootUri": "file:///home/nate/.pub-cache/hosted/pub.dev/test_core-0.6.8",
"packageUri": "lib/",
"languageVersion": "3.5"
},
{
"name": "typed_data",
"rootUri": "file:///home/nate/.pub-cache/hosted/pub.dev/typed_data-1.4.0",
"packageUri": "lib/",
"languageVersion": "3.5"
},
{
"name": "uuid",
"rootUri": "file:///home/nate/.pub-cache/hosted/pub.dev/uuid-3.0.7",
"packageUri": "lib/",
"languageVersion": "2.12"
},
{
"name": "very_good_analysis",
"rootUri": "file:///home/nate/.pub-cache/hosted/pub.dev/very_good_analysis-5.1.0",
"packageUri": "lib/",
"languageVersion": "3.0"
},
{
"name": "vm_service",
"rootUri": "file:///home/nate/.pub-cache/hosted/pub.dev/vm_service-15.0.0",
"packageUri": "lib/",
"languageVersion": "3.3"
},
{
"name": "watcher",
"rootUri": "file:///home/nate/.pub-cache/hosted/pub.dev/watcher-1.1.1",
"packageUri": "lib/",
"languageVersion": "3.1"
},
{
"name": "web",
"rootUri": "file:///home/nate/.pub-cache/hosted/pub.dev/web-1.1.0",
"packageUri": "lib/",
"languageVersion": "3.4"
},
{
"name": "web_socket",
"rootUri": "file:///home/nate/.pub-cache/hosted/pub.dev/web_socket-0.1.6",
"packageUri": "lib/",
"languageVersion": "3.3"
},
{
"name": "web_socket_channel",
"rootUri": "file:///home/nate/.pub-cache/hosted/pub.dev/web_socket_channel-3.0.2",
"packageUri": "lib/",
"languageVersion": "3.3"
},
{
"name": "webkit_inspection_protocol",
"rootUri": "file:///home/nate/.pub-cache/hosted/pub.dev/webkit_inspection_protocol-1.2.1",
"packageUri": "lib/",
"languageVersion": "3.0"
},
{
"name": "yaml",
"rootUri": "file:///home/nate/.pub-cache/hosted/pub.dev/yaml-3.1.3",
"packageUri": "lib/",
"languageVersion": "3.4"
},
{
"name": "backend",
"rootUri": "../",
"packageUri": "lib/",
"languageVersion": "3.0"
}
],
"generated": "2025-01-29T23:51:57.833090Z",
"generator": "pub",
"generatorVersion": "3.6.0",
"pubCache": "file:///home/nate/.pub-cache"
}

16
backend/.gitignore vendored Normal file
View File

@ -0,0 +1,16 @@
# See https://www.dartlang.org/guides/libraries/private-files
# Files and directories created by the Operating System
.DS_Store
# Files and directories created by pub
.dart_tool/
.packages
pubspec.lock
# Files and directories created by dart_frog
build/
.dart_frog
# Test related files
coverage/

3
backend/.vscode/extensions.json vendored Normal file
View File

@ -0,0 +1,3 @@
{
"recommendations": ["VeryGoodVentures.dart-frog"]
}

12
backend/README.md Normal file
View File

@ -0,0 +1,12 @@
# backend
[![style: very good analysis][very_good_analysis_badge]][very_good_analysis_link]
[![License: MIT][license_badge]][license_link]
[![Powered by Dart Frog](https://img.shields.io/endpoint?url=https://tinyurl.com/dartfrog-badge)](https://dartfrog.vgv.dev)
An example application built with dart_frog
[license_badge]: https://img.shields.io/badge/license-MIT-blue.svg
[license_link]: https://opensource.org/licenses/MIT
[very_good_analysis_badge]: https://img.shields.io/badge/style-very_good_analysis-B22C89.svg
[very_good_analysis_link]: https://pub.dev/packages/very_good_analysis

View File

@ -0,0 +1,7 @@
include: package:very_good_analysis/analysis_options.5.1.0.yaml
analyzer:
exclude:
- build/**
linter:
rules:
file_names: false

View File

@ -0,0 +1,15 @@
import 'dart:io';
import 'package:dart_frog/dart_frog.dart';
import 'package:dart_jsonwebtoken/dart_jsonwebtoken.dart';
final String jwtSecret = Platform.environment['JWT_SECRET'] ?? 'googoogaga-key';
extension RequestContextX on RequestContext {
String get userId {
final authHeader = request.headers['authorization'] ?? '';
final token = authHeader.replaceAll('Bearer ', '');
final jwt = JWT.verify(token, SecretKey(jwtSecret));
return jwt.payload['userId'] as String;
}
}

View File

@ -0,0 +1,33 @@
import 'dart:io';
import 'package:backend/extensions/request_context.dart';
import 'package:dart_frog/dart_frog.dart';
import 'package:dart_jsonwebtoken/dart_jsonwebtoken.dart';
Middleware authMiddleware() {
return (handler) {
return (context) async {
// Get the authorization header
final authHeader = context.request.headers['authorization'];
if (authHeader == null || !authHeader.startsWith('Bearer ')) {
return Response(statusCode: HttpStatus.unauthorized);
}
final token = authHeader.substring(7);
try {
// Verify the JWT token
JWT.verify(
token,
SecretKey(jwtSecret),
);
// If verification successful, continue to the route handler
return handler(context);
} catch (e) {
return Response.json(
statusCode: HttpStatus.unauthorized,
body: {'error': e.toString()},
);
}
};
};
}

60
backend/lib/store.dart Normal file
View File

@ -0,0 +1,60 @@
import 'package:shared_models/models/translation_request.dart';
import 'package:shared_models/models/user.dart';
class MemoryStore {
static final Map<String, TranslationRequest> _googooTranslations = {};
static final Map<String, TranslationRequest> _humanTranslations = {};
static final Map<String, User> _users = {};
// User methods
static User? getUser(String userId) => _users[userId];
static void addUser(User user) => _users[user.id] = user;
// Googoo translation methods
static TranslationRequest? getGoogooTranslation(String id, String userId) {
final translation = _googooTranslations[id];
if (translation?.userId != userId) return null;
return translation;
}
static void addGoogooTranslation(TranslationRequest translation) {
_googooTranslations[translation.id] = translation;
}
static List<TranslationRequest> getUserGoogooTranslations(String userId) {
return _googooTranslations.values.where((t) => t.userId == userId).toList();
}
// Human translation methods
static TranslationRequest? getHumanTranslation(String id, String userId) {
final translation = _humanTranslations[id];
if (translation?.userId != userId) return null;
return translation;
}
static void addHumanTranslation(TranslationRequest translation) {
_humanTranslations[translation.id] = translation;
}
static List<TranslationRequest> getUserHumanTranslations(String userId) {
return _humanTranslations.values.where((t) => t.userId == userId).toList();
}
// Cleanup methods
static void removeOldTranslations(Duration maxAge) {
final cutoffTime = DateTime.now().subtract(maxAge);
_googooTranslations.removeWhere(
(_, translation) => translation.timestamp.isBefore(cutoffTime),
);
_humanTranslations.removeWhere(
(_, translation) => translation.timestamp.isBefore(cutoffTime),
);
}
// For testing/development
static void clearAll() {
_googooTranslations.clear();
_humanTranslations.clear();
_users.clear();
}
}

521
backend/pubspec.lock Normal file
View File

@ -0,0 +1,521 @@
# Generated by pub
# See https://dart.dev/tools/pub/glossary#lockfile
packages:
_fe_analyzer_shared:
dependency: transitive
description:
name: _fe_analyzer_shared
sha256: "03f6da266a27a4538a69295ec142cb5717d7d4e5727b84658b63e1e1509bac9c"
url: "https://pub.dev"
source: hosted
version: "79.0.0"
_macros:
dependency: transitive
description: dart
source: sdk
version: "0.3.3"
adaptive_number:
dependency: transitive
description:
name: adaptive_number
sha256: "3a567544e9b5c9c803006f51140ad544aedc79604fd4f3f2c1380003f97c1d77"
url: "https://pub.dev"
source: hosted
version: "1.0.0"
analyzer:
dependency: transitive
description:
name: analyzer
sha256: c9040fc56483c22a5e04a9f6a251313118b1a3c42423770623128fa484115643
url: "https://pub.dev"
source: hosted
version: "7.2.0"
args:
dependency: transitive
description:
name: args
sha256: bf9f5caeea8d8fe6721a9c358dd8a5c1947b27f1cfaa18b39c301273594919e6
url: "https://pub.dev"
source: hosted
version: "2.6.0"
async:
dependency: transitive
description:
name: async
sha256: d2872f9c19731c2e5f10444b14686eb7cc85c76274bd6c16e1816bff9a3bab63
url: "https://pub.dev"
source: hosted
version: "2.12.0"
boolean_selector:
dependency: transitive
description:
name: boolean_selector
sha256: "8aab1771e1243a5063b8b0ff68042d67334e3feab9e95b9490f9a6ebf73b42ea"
url: "https://pub.dev"
source: hosted
version: "2.1.2"
clock:
dependency: transitive
description:
name: clock
sha256: fddb70d9b5277016c77a80201021d40a2247104d9f4aa7bab7157b7e3f05b84b
url: "https://pub.dev"
source: hosted
version: "1.1.2"
collection:
dependency: transitive
description:
name: collection
sha256: "2f5709ae4d3d59dd8f7cd309b4e023046b57d8a6c82130785d2b0e5868084e76"
url: "https://pub.dev"
source: hosted
version: "1.19.1"
convert:
dependency: transitive
description:
name: convert
sha256: b30acd5944035672bc15c6b7a8b47d773e41e2f17de064350988c5d02adb1c68
url: "https://pub.dev"
source: hosted
version: "3.1.2"
coverage:
dependency: transitive
description:
name: coverage
sha256: e3493833ea012784c740e341952298f1cc77f1f01b1bbc3eb4eecf6984fb7f43
url: "https://pub.dev"
source: hosted
version: "1.11.1"
crypto:
dependency: transitive
description:
name: crypto
sha256: "1e445881f28f22d6140f181e07737b22f1e099a5e1ff94b0af2f9e4a463f4855"
url: "https://pub.dev"
source: hosted
version: "3.0.6"
dart_frog:
dependency: "direct main"
description:
name: dart_frog
sha256: "569db68a710bcadf96d8addc8988d09a93c4a9521cb6467c2df5ee0ab939c8a4"
url: "https://pub.dev"
source: hosted
version: "1.2.0"
dart_jsonwebtoken:
dependency: "direct main"
description:
name: dart_jsonwebtoken
sha256: "06e02e18827d047f206e1051c15b493c9c29a2dba0f9b2a905d73748dec4f931"
url: "https://pub.dev"
source: hosted
version: "2.16.0"
ed25519_edwards:
dependency: transitive
description:
name: ed25519_edwards
sha256: "6ce0112d131327ec6d42beede1e5dfd526069b18ad45dcf654f15074ad9276cd"
url: "https://pub.dev"
source: hosted
version: "0.3.1"
file:
dependency: transitive
description:
name: file
sha256: "1b92bec4fc2a72f59a8e15af5f52cd441e4a7860b49499d69dfa817af20e925d"
url: "https://pub.dev"
source: hosted
version: "6.1.4"
fixnum:
dependency: transitive
description:
name: fixnum
sha256: b6dc7065e46c974bc7c5f143080a6764ec7a4be6da1285ececdc37be96de53be
url: "https://pub.dev"
source: hosted
version: "1.1.1"
frontend_server_client:
dependency: transitive
description:
name: frontend_server_client
sha256: f64a0333a82f30b0cca061bc3d143813a486dc086b574bfb233b7c1372427694
url: "https://pub.dev"
source: hosted
version: "4.0.0"
glob:
dependency: transitive
description:
name: glob
sha256: c3f1ee72c96f8f78935e18aa8cecced9ab132419e8625dc187e1c2408efc20de
url: "https://pub.dev"
source: hosted
version: "2.1.3"
hotreloader:
dependency: transitive
description:
name: hotreloader
sha256: bc167a1163807b03bada490bfe2df25b0d744df359227880220a5cbd04e5734b
url: "https://pub.dev"
source: hosted
version: "4.3.0"
http_methods:
dependency: transitive
description:
name: http_methods
sha256: "6bccce8f1ec7b5d701e7921dca35e202d425b57e317ba1a37f2638590e29e566"
url: "https://pub.dev"
source: hosted
version: "1.1.1"
http_multi_server:
dependency: transitive
description:
name: http_multi_server
sha256: aa6199f908078bb1c5efb8d8638d4ae191aac11b311132c3ef48ce352fb52ef8
url: "https://pub.dev"
source: hosted
version: "3.2.2"
http_parser:
dependency: transitive
description:
name: http_parser
sha256: "178d74305e7866013777bab2c3d8726205dc5a4dd935297175b19a23a2e66571"
url: "https://pub.dev"
source: hosted
version: "4.1.2"
io:
dependency: transitive
description:
name: io
sha256: dfd5a80599cf0165756e3181807ed3e77daf6dd4137caaad72d0b7931597650b
url: "https://pub.dev"
source: hosted
version: "1.0.5"
js:
dependency: transitive
description:
name: js
sha256: c1b2e9b5ea78c45e1a0788d29606ba27dc5f71f019f32ca5140f61ef071838cf
url: "https://pub.dev"
source: hosted
version: "0.7.1"
json_annotation:
dependency: transitive
description:
name: json_annotation
sha256: "1ce844379ca14835a50d2f019a3099f419082cfdd231cd86a142af94dd5c6bb1"
url: "https://pub.dev"
source: hosted
version: "4.9.0"
logging:
dependency: transitive
description:
name: logging
sha256: c8245ada5f1717ed44271ed1c26b8ce85ca3228fd2ffdb75468ab01979309d61
url: "https://pub.dev"
source: hosted
version: "1.3.0"
macros:
dependency: transitive
description:
name: macros
sha256: "1d9e801cd66f7ea3663c45fc708450db1fa57f988142c64289142c9b7ee80656"
url: "https://pub.dev"
source: hosted
version: "0.1.3-main.0"
matcher:
dependency: transitive
description:
name: matcher
sha256: dc58c723c3c24bf8d3e2d3ad3f2f9d7bd9cf43ec6feaa64181775e60190153f2
url: "https://pub.dev"
source: hosted
version: "0.12.17"
meta:
dependency: transitive
description:
name: meta
sha256: e3641ec5d63ebf0d9b41bd43201a66e3fc79a65db5f61fc181f04cd27aab950c
url: "https://pub.dev"
source: hosted
version: "1.16.0"
mime:
dependency: transitive
description:
name: mime
sha256: "41a20518f0cb1256669420fdba0cd90d21561e560ac240f26ef8322e45bb7ed6"
url: "https://pub.dev"
source: hosted
version: "2.0.0"
mocktail:
dependency: "direct dev"
description:
name: mocktail
sha256: "890df3f9688106f25755f26b1c60589a92b3ab91a22b8b224947ad041bf172d8"
url: "https://pub.dev"
source: hosted
version: "1.0.4"
node_preamble:
dependency: transitive
description:
name: node_preamble
sha256: "6e7eac89047ab8a8d26cf16127b5ed26de65209847630400f9aefd7cd5c730db"
url: "https://pub.dev"
source: hosted
version: "2.0.2"
package_config:
dependency: transitive
description:
name: package_config
sha256: "92d4488434b520a62570293fbd33bb556c7d49230791c1b4bbd973baf6d2dc67"
url: "https://pub.dev"
source: hosted
version: "2.1.1"
path:
dependency: transitive
description:
name: path
sha256: "75cca69d1490965be98c73ceaea117e8a04dd21217b37b292c9ddbec0d955bc5"
url: "https://pub.dev"
source: hosted
version: "1.9.1"
pointycastle:
dependency: transitive
description:
name: pointycastle
sha256: "4be0097fcf3fd3e8449e53730c631200ebc7b88016acecab2b0da2f0149222fe"
url: "https://pub.dev"
source: hosted
version: "3.9.1"
pool:
dependency: transitive
description:
name: pool
sha256: "20fe868b6314b322ea036ba325e6fc0711a22948856475e2c2b6306e8ab39c2a"
url: "https://pub.dev"
source: hosted
version: "1.5.1"
pub_semver:
dependency: transitive
description:
name: pub_semver
sha256: "7b3cfbf654f3edd0c6298ecd5be782ce997ddf0e00531b9464b55245185bbbbd"
url: "https://pub.dev"
source: hosted
version: "2.1.5"
shared_models:
dependency: "direct main"
description:
path: "../shared_models"
relative: true
source: path
version: "0.1.0"
shelf:
dependency: transitive
description:
name: shelf
sha256: e7dd780a7ffb623c57850b33f43309312fc863fb6aa3d276a754bb299839ef12
url: "https://pub.dev"
source: hosted
version: "1.4.2"
shelf_hotreload:
dependency: transitive
description:
name: shelf_hotreload
sha256: d7099618b18d3c63ba5272491c1812c306629495129ef9996115f0417902f963
url: "https://pub.dev"
source: hosted
version: "1.5.0"
shelf_packages_handler:
dependency: transitive
description:
name: shelf_packages_handler
sha256: "89f967eca29607c933ba9571d838be31d67f53f6e4ee15147d5dc2934fee1b1e"
url: "https://pub.dev"
source: hosted
version: "3.0.2"
shelf_static:
dependency: transitive
description:
name: shelf_static
sha256: c87c3875f91262785dade62d135760c2c69cb217ac759485334c5857ad89f6e3
url: "https://pub.dev"
source: hosted
version: "1.1.3"
shelf_web_socket:
dependency: transitive
description:
name: shelf_web_socket
sha256: cc36c297b52866d203dbf9332263c94becc2fe0ceaa9681d07b6ef9807023b67
url: "https://pub.dev"
source: hosted
version: "2.0.1"
source_map_stack_trace:
dependency: transitive
description:
name: source_map_stack_trace
sha256: c0713a43e323c3302c2abe2a1cc89aa057a387101ebd280371d6a6c9fa68516b
url: "https://pub.dev"
source: hosted
version: "2.1.2"
source_maps:
dependency: transitive
description:
name: source_maps
sha256: "190222579a448b03896e0ca6eca5998fa810fda630c1d65e2f78b3f638f54812"
url: "https://pub.dev"
source: hosted
version: "0.10.13"
source_span:
dependency: transitive
description:
name: source_span
sha256: "254ee5351d6cb365c859e20ee823c3bb479bf4a293c22d17a9f1bf144ce86f7c"
url: "https://pub.dev"
source: hosted
version: "1.10.1"
stack_trace:
dependency: transitive
description:
name: stack_trace
sha256: "8b27215b45d22309b5cddda1aa2b19bdfec9df0e765f2de506401c071d38d1b1"
url: "https://pub.dev"
source: hosted
version: "1.12.1"
stream_channel:
dependency: transitive
description:
name: stream_channel
sha256: "969e04c80b8bcdf826f8f16579c7b14d780458bd97f56d107d3950fdbeef059d"
url: "https://pub.dev"
source: hosted
version: "2.1.4"
stream_transform:
dependency: transitive
description:
name: stream_transform
sha256: ad47125e588cfd37a9a7f86c7d6356dde8dfe89d071d293f80ca9e9273a33871
url: "https://pub.dev"
source: hosted
version: "2.1.1"
string_scanner:
dependency: transitive
description:
name: string_scanner
sha256: "921cd31725b72fe181906c6a94d987c78e3b98c2e205b397ea399d4054872b43"
url: "https://pub.dev"
source: hosted
version: "1.4.1"
term_glyph:
dependency: transitive
description:
name: term_glyph
sha256: "7f554798625ea768a7518313e58f83891c7f5024f88e46e7182a4558850a4b8e"
url: "https://pub.dev"
source: hosted
version: "1.2.2"
test:
dependency: "direct dev"
description:
name: test
sha256: "8391fbe68d520daf2314121764d38e37f934c02fd7301ad18307bd93bd6b725d"
url: "https://pub.dev"
source: hosted
version: "1.25.14"
test_api:
dependency: transitive
description:
name: test_api
sha256: fb31f383e2ee25fbbfe06b40fe21e1e458d14080e3c67e7ba0acfde4df4e0bbd
url: "https://pub.dev"
source: hosted
version: "0.7.4"
test_core:
dependency: transitive
description:
name: test_core
sha256: "84d17c3486c8dfdbe5e12a50c8ae176d15e2a771b96909a9442b40173649ccaa"
url: "https://pub.dev"
source: hosted
version: "0.6.8"
typed_data:
dependency: transitive
description:
name: typed_data
sha256: f9049c039ebfeb4cf7a7104a675823cd72dba8297f264b6637062516699fa006
url: "https://pub.dev"
source: hosted
version: "1.4.0"
uuid:
dependency: "direct main"
description:
name: uuid
sha256: "648e103079f7c64a36dc7d39369cabb358d377078a051d6ae2ad3aa539519313"
url: "https://pub.dev"
source: hosted
version: "3.0.7"
very_good_analysis:
dependency: "direct dev"
description:
name: very_good_analysis
sha256: "9ae7f3a3bd5764fb021b335ca28a34f040cd0ab6eec00a1b213b445dae58a4b8"
url: "https://pub.dev"
source: hosted
version: "5.1.0"
vm_service:
dependency: transitive
description:
name: vm_service
sha256: ddfa8d30d89985b96407efce8acbdd124701f96741f2d981ca860662f1c0dc02
url: "https://pub.dev"
source: hosted
version: "15.0.0"
watcher:
dependency: transitive
description:
name: watcher
sha256: "69da27e49efa56a15f8afe8f4438c4ec02eff0a117df1b22ea4aad194fe1c104"
url: "https://pub.dev"
source: hosted
version: "1.1.1"
web:
dependency: transitive
description:
name: web
sha256: cd3543bd5798f6ad290ea73d210f423502e71900302dde696f8bff84bf89a1cb
url: "https://pub.dev"
source: hosted
version: "1.1.0"
web_socket:
dependency: transitive
description:
name: web_socket
sha256: "3c12d96c0c9a4eec095246debcea7b86c0324f22df69893d538fcc6f1b8cce83"
url: "https://pub.dev"
source: hosted
version: "0.1.6"
web_socket_channel:
dependency: transitive
description:
name: web_socket_channel
sha256: "0b8e2457400d8a859b7b2030786835a28a8e80836ef64402abef392ff4f1d0e5"
url: "https://pub.dev"
source: hosted
version: "3.0.2"
webkit_inspection_protocol:
dependency: transitive
description:
name: webkit_inspection_protocol
sha256: "87d3f2333bb240704cd3f1c6b5b7acd8a10e7f0bc28c28dcf14e782014f4a572"
url: "https://pub.dev"
source: hosted
version: "1.2.1"
yaml:
dependency: transitive
description:
name: yaml
sha256: b9da305ac7c39faa3f030eccd175340f968459dae4af175130b3fc47e40d76ce
url: "https://pub.dev"
source: hosted
version: "3.1.3"
sdks:
dart: ">=3.5.0 <4.0.0"

19
backend/pubspec.yaml Normal file
View File

@ -0,0 +1,19 @@
name: backend
description: A new Dart Frog application
version: 1.0.0+1
publish_to: none
environment:
sdk: ">=3.0.0 <4.0.0"
dependencies:
dart_frog: ^1.1.0
shared_models:
path: ../shared_models
dart_jsonwebtoken: ^2.8.0
uuid: ^3.0.7
dev_dependencies:
mocktail: ^1.0.3
test: ^1.25.5
very_good_analysis: ^5.1.0

View File

@ -0,0 +1,12 @@
import 'package:backend/middleware/auth_middleware.dart';
import 'package:dart_frog/dart_frog.dart';
Handler middleware(Handler handler) {
// Apply auth middleware to all routes except /auth
return (context) async {
if (context.request.uri.path.startsWith('/auth')) {
return handler(context);
}
return authMiddleware()(handler)(context);
};
}

View File

@ -0,0 +1,56 @@
import 'dart:io';
import 'package:backend/extensions/request_context.dart';
import 'package:backend/store.dart';
import 'package:dart_frog/dart_frog.dart';
import 'package:dart_jsonwebtoken/dart_jsonwebtoken.dart';
import 'package:shared_models/models/user.dart';
import 'package:uuid/uuid.dart';
Future<Response> onRequest(RequestContext context) async {
// Only allow POST requests
if (context.request.method != HttpMethod.post) {
return Response(statusCode: HttpStatus.methodNotAllowed);
}
try {
// Generate a new user ID
final userId = const Uuid().v4();
// Create JWT token
final jwt = JWT(
{
'userId': userId,
'iat': DateTime.now().millisecondsSinceEpoch,
},
);
// Sign the JWT token (store this secret in environment variables in production)
final token = jwt.sign(
SecretKey(jwtSecret),
expiresIn: const Duration(days: 30), // Token expires in 30 days
);
// Create new user
final user = User(
id: userId,
token: token,
createdAt: DateTime.now(),
);
// Store user in memory
MemoryStore.addUser(user);
// Return the user credentials
return Response.json(
body: {
'userId': userId,
'token': token,
},
);
} catch (e) {
return Response.json(
statusCode: HttpStatus.internalServerError,
body: {'error': e.toString()},
);
}
}

View File

@ -0,0 +1,23 @@
import 'dart:io';
import 'package:backend/extensions/request_context.dart';
import 'package:backend/store.dart';
import 'package:dart_frog/dart_frog.dart';
Response onRequest(RequestContext context, String id) {
if (context.request.method != HttpMethod.get) {
return Response(statusCode: HttpStatus.methodNotAllowed);
}
final userId = context.userId;
final translation = MemoryStore.getGoogooTranslation(id, userId);
if (translation == null) {
return Response.json(
statusCode: HttpStatus.notFound,
body: {'error': 'Translation not found'},
);
}
return Response.json(body: translation.toJson());
}

View File

@ -0,0 +1,146 @@
import 'dart:io';
import 'dart:math';
import 'package:backend/extensions/request_context.dart';
import 'package:backend/store.dart';
import 'package:dart_frog/dart_frog.dart';
import 'package:shared_models/models/translation_request.dart';
import 'package:shared_models/models/translation_response.dart';
import 'package:uuid/uuid.dart';
Future<Response> onRequest(RequestContext context) async {
if (context.request.method != HttpMethod.post) {
return Response(statusCode: HttpStatus.methodNotAllowed);
}
try {
final userId = context.userId;
final body = await context.request.json() as Map<String, dynamic>;
final inputText = body['text'] as String?;
if (inputText == null) {
return Response.json(
statusCode: HttpStatus.badRequest,
body: {'error': 'text field is required'},
);
}
if (!RegExp(r'(go+|ga+)(\s+(go+|ga+))').hasMatch(inputText)) {
return Response.json(
statusCode: HttpStatus.badRequest,
body: {'error': 'text must be baby talk for proper translation, e.g. "googoo"', "input": inputText},
);
}
final String selectedTranslation = selectSimilarLengthTranslation(inputText);
final id = const Uuid().v4();
final translation = TranslationRequest(
id: id,
inputText: inputText,
timestamp: DateTime.now(),
result: selectedTranslation,
userId: userId,
);
MemoryStore.addGoogooTranslation(translation);
return Response.json(
body: TranslationResponse(
id: id,
translatedText: translation.result!,
).toJson(),
);
} catch (e) {
return Response.json(
statusCode: HttpStatus.internalServerError,
body: {'error': e.toString()},
);
}
}
final List<String> translations = [
'I really need my Enfamil formula right now!',
'The Pampers diapers you put on me are so comfy and dry.',
"Could you warm up my Gerber sweet potato puree? I'm getting hungry.",
'This Graco stroller ride is making me sleepy.',
"Mom, the Johnson's Baby Shampoo doesn't hurt my eyes at all - thank you!",
'I love when you feed me Similac Pro-Advance, it makes my tummy feel good.',
'This UPPAbaby Vista stroller gives me the best view of everything!',
'The Huggies wipes are so gentle on my sensitive skin.',
'Can we try the new Beech-Nut organic apple and pear puree today?',
"My Carter's onesie is so soft and cozy, I could sleep all day in it.",
'The Chicco car seat makes me feel safe and secure during our drives.',
"Mom, I'm loving these Earth's Best organic teething biscuits!",
"Could you get more Plum Organics squeeze pouches? They're my favorite!",
'This Baby Bjorn carrier lets me snuggle close to you while we walk.',
'The Honest Company diapers have such cute patterns, and they feel nice too!',
"I'm ready for my Nestlé Cerelac breakfast, please!",
'My Fisher-Price mobile helps me fall asleep so peacefully.',
"The Philips Avent bottle doesn't give me any gas bubbles.",
"Mom, these Ella's Kitchen fruit purees are better than candy!",
'My Britax stroller rides are always so smooth and comfortable.',
"Could you warm up some Kabrita goat milk formula? I'm getting hungry.",
'The Baby Dove soap makes bathtime so much fun!',
"I love my Dr. Brown's bottles, they help me drink without getting too much air.",
'These Happy Baby puffs are perfect for my little fingers to practice grabbing!',
'My Nuna PIPA car seat is the coziest place to nap during errands.',
'Mom, the Gerber rice cereal with banana is my absolute favorite breakfast!',
'This Doona stroller-car seat combo makes transitions so easy for both of us!',
'The Seventh Generation diapers are so eco-friendly and comfortable!',
"Could we try the new Parent's Choice organic vegetable blend?",
'My Cybex stroller rides are always an adventure!',
'The Babyganics bubble bath makes me feel so clean and happy!',
'Mom, I really love when you feed me Fresh Bellies veggie purees!',
'These Mam pacifiers are perfect for soothing me to sleep.',
'The Bugaboo Fox stroller gives me the smoothest ride in the neighborhood!',
'Could you get more Little Spoon organic baby food? It tastes just like your cooking!',
'My Skip Hop play mat is the best place for tummy time!',
'The Evenflo bottle makes feeding time so comfortable!',
'Mom, these Sprout organic quinoa puffs are so tasty!',
'My Silver Cross stroller makes me feel like royalty!',
'The Bobbie organic formula is just what I need right now!',
'Milk, please!',
"I'm sleepy.",
'Change me now!',
'My Enfamil, mommy!',
'This Graco swing rocks!',
'Snuggle time with my Boppy pillow!',
'I love my new UPPAbaby stroller adventures!',
'The Gerber banana puree is calling my name, mom!',
'Mom, these Honest Company diapers are getting full!',
"I really need my Similac Pro-Advance formula right this minute, I'm starving!",
'This Bugaboo stroller ride through the park is making me so happy I could giggle all day!',
"Mommy, I know the Plum Organics sweet potato and apple puree is in the cabinet - that's what I want!",
"Mom, I've been trying to tell you all day that my Carter's onesie is a bit itchy, could we try the bamboo one instead?",
'I absolutely adore when we go on our morning walks in the Nuna MIXX stroller - the fresh air and gentle bounce always make me feel so peaceful and content!',
"Dear mommy, I know it's 3 AM, but I've been dreaming about that delicious Beech-Nut organic apple and pear puree, and my tummy is telling me it's time for a midnight snack!",
"Mom, I really appreciate how you always make sure to stock up on Enfamil Gentlease formula, Pampers Swaddlers diapers, and Huggies Natural Care wipes - you're the best mom ever and I love you to the moon and back!",
"I've been trying to explain all morning that the combination of my new Cybex e-Priam stroller, my cozy Honest Company diapers, and the fresh Ella's Kitchen fruit puree make this the absolute perfect day for a long walk in the park, followed by a picnic and maybe even some tummy time on that new Skip Hop playmat you bought last week!",
"Mommy, I know you're tired, but I just wanted to let you know that the way you take care of me - from the gentle Baby Dove soap you use at bathtime, to the perfectly warmed Dr. Brown's bottles of Similac Pro-Total Comfort formula, to the soft Burt's Bees baby clothes you dress me in - makes me feel like the luckiest baby in the whole wide world, and even though I can't say it clearly yet, I love you more than anything!",
'Hungry!',
'Wet!',
'Sleepy now.',
'Want cuddles!',
'My tummy hurts.',
];
String selectSimilarLengthTranslation(String input, {double tolerance = 0.3}) {
// Calculate the target length
final targetLength = input.length;
// Filter translations that are within the tolerance range
final similarLengthTranslations = translations.where((t) {
final lengthDiff = (t.length - targetLength).abs();
final maxDiff = targetLength * tolerance;
return lengthDiff <= maxDiff;
}).toList();
// If no translations match the criteria, fall back to the full list
if (similarLengthTranslations.isEmpty) {
similarLengthTranslations.addAll(translations);
}
// Select a random translation from the filtered list
final random = Random();
return similarLengthTranslations[random.nextInt(similarLengthTranslations.length)];
}

View File

@ -0,0 +1,5 @@
import 'package:dart_frog/dart_frog.dart';
Response onRequest(RequestContext context) {
return Response(body: 'Welcome to Dart Frog!');
}

View File

@ -0,0 +1,22 @@
import 'dart:io';
import 'package:backend/extensions/request_context.dart';
import 'package:backend/store.dart';
import 'package:dart_frog/dart_frog.dart';
Response onRequest(RequestContext context, String id) {
if (context.request.method != HttpMethod.get) {
return Response(statusCode: HttpStatus.methodNotAllowed);
}
final userId = context.userId;
final translation = MemoryStore.getHumanTranslation(id, userId);
if (translation == null) {
return Response.json(
statusCode: HttpStatus.notFound,
body: {'error': 'Translation not found'},
);
}
return Response.json(body: translation.toJson());
}

View File

@ -0,0 +1,95 @@
import 'dart:io';
import 'dart:math';
import 'package:backend/extensions/request_context.dart';
import 'package:backend/store.dart';
import 'package:dart_frog/dart_frog.dart';
import 'package:shared_models/models/translation_request.dart';
import 'package:shared_models/models/translation_response.dart';
import 'package:uuid/uuid.dart';
Future<Response> onRequest(RequestContext context) async {
if (context.request.method != HttpMethod.post) {
return Response(statusCode: HttpStatus.methodNotAllowed);
}
try {
final userId = context.userId;
final body = await context.request.json() as Map<String, dynamic>;
final inputText = body['text'] as String?;
if (inputText == null) {
return Response.json(
statusCode: HttpStatus.badRequest,
body: {'error': 'text field is required'},
);
}
final id = const Uuid().v4();
final translation = TranslationRequest(
id: id,
inputText: inputText,
timestamp: DateTime.now(),
result: generateBabyTalk(inputText),
userId: userId, // Replace with actual translation logic
);
MemoryStore.addHumanTranslation(translation);
return Response.json(
body: TranslationResponse(
id: id,
translatedText: translation.result!,
).toJson(),
);
} catch (e) {
return Response.json(
statusCode: HttpStatus.internalServerError,
body: {'error': e.toString()},
);
}
}
String generateBabyTalk(String input) {
final random = Random(input.hashCode);
final syllables = ['goo', 'ga', 'bah', 'ma', 'da', 'ba'];
final sounds = ['ah', 'oh', 'eh'];
// Roughly calculate how many syllables we want based on input length
final targetLength = (input.length / 2).round();
// Add some randomness to the target length (±30%)
final variance = (targetLength * 0.3).round();
final finalLength = targetLength + random.nextInt(variance * 2) - variance;
final List<String> result = [];
// Sometimes start with a sound
if (random.nextBool()) {
result.add(sounds[random.nextInt(sounds.length)]);
}
while (result.join(' ').length < input.length) {
// Randomly decide to repeat the last syllable
if (result.isNotEmpty && random.nextDouble() < 0.3) {
result.add(result.last);
continue;
}
// Randomly combine syllables
if (random.nextDouble() < 0.4) {
final syl1 = syllables[random.nextInt(syllables.length)];
final syl2 = syllables[random.nextInt(syllables.length)];
result.add('$syl1 $syl2');
} else {
result.add(syllables[random.nextInt(syllables.length)]);
}
// Sometimes add a sound between syllables
if (random.nextDouble() < 0.2) {
result.add(sounds[random.nextInt(sounds.length)]);
}
}
return result.join(' ');
}

View File

@ -0,0 +1,23 @@
import 'dart:io';
import 'package:dart_frog/dart_frog.dart';
import 'package:mocktail/mocktail.dart';
import 'package:test/test.dart';
import '../../routes/index.dart' as route;
class _MockRequestContext extends Mock implements RequestContext {}
void main() {
group('GET /', () {
test('responds with a 200 and "Welcome to Dart Frog!".', () {
final context = _MockRequestContext();
final response = route.onRequest(context);
expect(response.statusCode, equals(HttpStatus.ok));
expect(
response.body(),
completion(equals('Welcome to Dart Frog!')),
);
});
});
}

61
flake.lock generated Normal file
View File

@ -0,0 +1,61 @@
{
"nodes": {
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1731533236,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1738021509,
"narHash": "sha256-JNUiceGsr7cVBUQxLBF1ILCe99E0qLxsVuet6GsZUuw=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "9db269672dbdbb519e0bd3ea24f01506c135e46f",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

29
flake.nix Normal file
View File

@ -0,0 +1,29 @@
{
description = "Simple flutter and dart flake";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
inputs.flake-utils.url = "github:numtide/flake-utils";
outputs = {
flake-utils,
nixpkgs,
...
}:
flake-utils.lib.eachDefaultSystem (system: let
pkgs = import nixpkgs {
inherit system;
};
in {
devShell = pkgs.mkShell {
buildInputs = with pkgs; [
flutter
dart
];
enterShell = ''
echo "Welcome to Bab.ai development environment"
'';
shellHook = ''
export PATH="$PATH":"$HOME/.pub-cache/bin"
'';
};
});
}

View File

@ -0,0 +1,2 @@
file:///home/nate/.pub-cache/hosted/pub.dev/build_daemon-4.0.3/lib/fake.dart
file:///home/nate/.pub-cache/hosted/pub.dev/build_runner-2.4.14/lib/fake.dart

View File

@ -0,0 +1,54 @@
// @dart=3.6
// ignore_for_file: directives_ordering
// ignore_for_file: no_leading_underscores_for_library_prefixes
import 'package:build_runner_core/build_runner_core.dart' as _i1;
import 'package:json_serializable/builder.dart' as _i2;
import 'package:source_gen/builder.dart' as _i3;
import 'package:build_resolvers/builder.dart' as _i4;
import 'dart:isolate' as _i5;
import 'package:build_runner/build_runner.dart' as _i6;
import 'dart:io' as _i7;
final _builders = <_i1.BuilderApplication>[
_i1.apply(
r'json_serializable:json_serializable',
[_i2.jsonSerializable],
_i1.toDependentsOf(r'json_serializable'),
hideOutput: true,
appliesBuilders: const [r'source_gen:combining_builder'],
),
_i1.apply(
r'source_gen:combining_builder',
[_i3.combiningBuilder],
_i1.toNoneByDefault(),
hideOutput: false,
appliesBuilders: const [r'source_gen:part_cleanup'],
),
_i1.apply(
r'build_resolvers:transitive_digests',
[_i4.transitiveDigestsBuilder],
_i1.toAllPackages(),
isOptional: true,
hideOutput: true,
appliesBuilders: const [r'build_resolvers:transitive_digest_cleanup'],
),
_i1.applyPostProcess(
r'build_resolvers:transitive_digest_cleanup',
_i4.transitiveDigestCleanup,
),
_i1.applyPostProcess(
r'source_gen:part_cleanup',
_i3.partCleanup,
),
];
void main(
List<String> args, [
_i5.SendPort? sendPort,
]) async {
var result = await _i6.run(
args,
_builders,
);
sendPort?.send(result);
_i7.exitCode = result;
}

File diff suppressed because one or more lines are too long

Binary file not shown.

View File

@ -0,0 +1 @@
{"sdk":"3.6.0 (stable) (Thu Dec 5 07:46:24 2024 -0800) on \"linux_x64\"","analyzer":"/home/nate/.pub-cache/hosted/pub.dev/analyzer-7.2.0","build_resolvers":"/home/nate/.pub-cache/hosted/pub.dev/build_resolvers-2.4.3"}

View File

@ -0,0 +1,369 @@
{
"configVersion": 2,
"packages": [
{
"name": "_fe_analyzer_shared",
"rootUri": "file:///home/nate/.pub-cache/hosted/pub.dev/_fe_analyzer_shared-79.0.0",
"packageUri": "lib/",
"languageVersion": "3.3"
},
{
"name": "_macros",
"rootUri": "file:///nix/store/54q00lm2yc79rnj09l9kcy3d52111h9h-dart-3.6.0/pkg/_macros",
"packageUri": "lib/",
"languageVersion": "3.4"
},
{
"name": "analyzer",
"rootUri": "file:///home/nate/.pub-cache/hosted/pub.dev/analyzer-7.2.0",
"packageUri": "lib/",
"languageVersion": "3.3"
},
{
"name": "args",
"rootUri": "file:///home/nate/.pub-cache/hosted/pub.dev/args-2.6.0",
"packageUri": "lib/",
"languageVersion": "3.3"
},
{
"name": "async",
"rootUri": "file:///home/nate/.pub-cache/hosted/pub.dev/async-2.12.0",
"packageUri": "lib/",
"languageVersion": "3.4"
},
{
"name": "boolean_selector",
"rootUri": "file:///home/nate/.pub-cache/hosted/pub.dev/boolean_selector-2.1.2",
"packageUri": "lib/",
"languageVersion": "3.1"
},
{
"name": "build",
"rootUri": "file:///home/nate/.pub-cache/hosted/pub.dev/build-2.4.2",
"packageUri": "lib/",
"languageVersion": "3.6"
},
{
"name": "build_config",
"rootUri": "file:///home/nate/.pub-cache/hosted/pub.dev/build_config-1.1.2",
"packageUri": "lib/",
"languageVersion": "3.6"
},
{
"name": "build_daemon",
"rootUri": "file:///home/nate/.pub-cache/hosted/pub.dev/build_daemon-4.0.3",
"packageUri": "lib/",
"languageVersion": "3.6"
},
{
"name": "build_resolvers",
"rootUri": "file:///home/nate/.pub-cache/hosted/pub.dev/build_resolvers-2.4.3",
"packageUri": "lib/",
"languageVersion": "3.6"
},
{
"name": "build_runner",
"rootUri": "file:///home/nate/.pub-cache/hosted/pub.dev/build_runner-2.4.14",
"packageUri": "lib/",
"languageVersion": "3.6"
},
{
"name": "build_runner_core",
"rootUri": "file:///home/nate/.pub-cache/hosted/pub.dev/build_runner_core-8.0.0",
"packageUri": "lib/",
"languageVersion": "3.6"
},
{
"name": "built_collection",
"rootUri": "file:///home/nate/.pub-cache/hosted/pub.dev/built_collection-5.1.1",
"packageUri": "lib/",
"languageVersion": "2.12"
},
{
"name": "built_value",
"rootUri": "file:///home/nate/.pub-cache/hosted/pub.dev/built_value-8.9.3",
"packageUri": "lib/",
"languageVersion": "3.0"
},
{
"name": "checked_yaml",
"rootUri": "file:///home/nate/.pub-cache/hosted/pub.dev/checked_yaml-2.0.3",
"packageUri": "lib/",
"languageVersion": "2.19"
},
{
"name": "code_builder",
"rootUri": "file:///home/nate/.pub-cache/hosted/pub.dev/code_builder-4.10.1",
"packageUri": "lib/",
"languageVersion": "3.5"
},
{
"name": "collection",
"rootUri": "file:///home/nate/.pub-cache/hosted/pub.dev/collection-1.19.1",
"packageUri": "lib/",
"languageVersion": "3.4"
},
{
"name": "convert",
"rootUri": "file:///home/nate/.pub-cache/hosted/pub.dev/convert-3.1.2",
"packageUri": "lib/",
"languageVersion": "3.4"
},
{
"name": "crypto",
"rootUri": "file:///home/nate/.pub-cache/hosted/pub.dev/crypto-3.0.6",
"packageUri": "lib/",
"languageVersion": "3.4"
},
{
"name": "dart_style",
"rootUri": "file:///home/nate/.pub-cache/hosted/pub.dev/dart_style-3.0.1",
"packageUri": "lib/",
"languageVersion": "3.4"
},
{
"name": "file",
"rootUri": "file:///home/nate/.pub-cache/hosted/pub.dev/file-7.0.1",
"packageUri": "lib/",
"languageVersion": "3.0"
},
{
"name": "fixnum",
"rootUri": "file:///home/nate/.pub-cache/hosted/pub.dev/fixnum-1.1.1",
"packageUri": "lib/",
"languageVersion": "3.1"
},
{
"name": "frontend_server_client",
"rootUri": "file:///home/nate/.pub-cache/hosted/pub.dev/frontend_server_client-4.0.0",
"packageUri": "lib/",
"languageVersion": "3.0"
},
{
"name": "glob",
"rootUri": "file:///home/nate/.pub-cache/hosted/pub.dev/glob-2.1.3",
"packageUri": "lib/",
"languageVersion": "3.3"
},
{
"name": "graphs",
"rootUri": "file:///home/nate/.pub-cache/hosted/pub.dev/graphs-2.3.2",
"packageUri": "lib/",
"languageVersion": "3.4"
},
{
"name": "http_multi_server",
"rootUri": "file:///home/nate/.pub-cache/hosted/pub.dev/http_multi_server-3.2.2",
"packageUri": "lib/",
"languageVersion": "3.2"
},
{
"name": "http_parser",
"rootUri": "file:///home/nate/.pub-cache/hosted/pub.dev/http_parser-4.1.2",
"packageUri": "lib/",
"languageVersion": "3.4"
},
{
"name": "io",
"rootUri": "file:///home/nate/.pub-cache/hosted/pub.dev/io-1.0.5",
"packageUri": "lib/",
"languageVersion": "3.4"
},
{
"name": "js",
"rootUri": "file:///home/nate/.pub-cache/hosted/pub.dev/js-0.7.1",
"packageUri": "lib/",
"languageVersion": "3.1"
},
{
"name": "json_annotation",
"rootUri": "file:///home/nate/.pub-cache/hosted/pub.dev/json_annotation-4.9.0",
"packageUri": "lib/",
"languageVersion": "3.0"
},
{
"name": "json_serializable",
"rootUri": "file:///home/nate/.pub-cache/hosted/pub.dev/json_serializable-6.9.3",
"packageUri": "lib/",
"languageVersion": "3.6"
},
{
"name": "logging",
"rootUri": "file:///home/nate/.pub-cache/hosted/pub.dev/logging-1.3.0",
"packageUri": "lib/",
"languageVersion": "3.4"
},
{
"name": "macros",
"rootUri": "file:///home/nate/.pub-cache/hosted/pub.dev/macros-0.1.3-main.0",
"packageUri": "lib/",
"languageVersion": "3.4"
},
{
"name": "matcher",
"rootUri": "file:///home/nate/.pub-cache/hosted/pub.dev/matcher-0.12.17",
"packageUri": "lib/",
"languageVersion": "3.4"
},
{
"name": "meta",
"rootUri": "file:///home/nate/.pub-cache/hosted/pub.dev/meta-1.16.0",
"packageUri": "lib/",
"languageVersion": "2.12"
},
{
"name": "mime",
"rootUri": "file:///home/nate/.pub-cache/hosted/pub.dev/mime-2.0.0",
"packageUri": "lib/",
"languageVersion": "3.2"
},
{
"name": "package_config",
"rootUri": "file:///home/nate/.pub-cache/hosted/pub.dev/package_config-2.1.1",
"packageUri": "lib/",
"languageVersion": "3.4"
},
{
"name": "path",
"rootUri": "file:///home/nate/.pub-cache/hosted/pub.dev/path-1.9.1",
"packageUri": "lib/",
"languageVersion": "3.4"
},
{
"name": "pool",
"rootUri": "file:///home/nate/.pub-cache/hosted/pub.dev/pool-1.5.1",
"packageUri": "lib/",
"languageVersion": "2.12"
},
{
"name": "pub_semver",
"rootUri": "file:///home/nate/.pub-cache/hosted/pub.dev/pub_semver-2.1.5",
"packageUri": "lib/",
"languageVersion": "3.4"
},
{
"name": "pubspec_parse",
"rootUri": "file:///home/nate/.pub-cache/hosted/pub.dev/pubspec_parse-1.5.0",
"packageUri": "lib/",
"languageVersion": "3.6"
},
{
"name": "shelf",
"rootUri": "file:///home/nate/.pub-cache/hosted/pub.dev/shelf-1.4.2",
"packageUri": "lib/",
"languageVersion": "3.4"
},
{
"name": "shelf_web_socket",
"rootUri": "file:///home/nate/.pub-cache/hosted/pub.dev/shelf_web_socket-2.0.1",
"packageUri": "lib/",
"languageVersion": "3.3"
},
{
"name": "source_gen",
"rootUri": "file:///home/nate/.pub-cache/hosted/pub.dev/source_gen-2.0.0",
"packageUri": "lib/",
"languageVersion": "3.6"
},
{
"name": "source_helper",
"rootUri": "file:///home/nate/.pub-cache/hosted/pub.dev/source_helper-1.3.5",
"packageUri": "lib/",
"languageVersion": "3.4"
},
{
"name": "source_span",
"rootUri": "file:///home/nate/.pub-cache/hosted/pub.dev/source_span-1.10.1",
"packageUri": "lib/",
"languageVersion": "3.1"
},
{
"name": "stack_trace",
"rootUri": "file:///home/nate/.pub-cache/hosted/pub.dev/stack_trace-1.12.1",
"packageUri": "lib/",
"languageVersion": "3.4"
},
{
"name": "stream_channel",
"rootUri": "file:///home/nate/.pub-cache/hosted/pub.dev/stream_channel-2.1.4",
"packageUri": "lib/",
"languageVersion": "3.3"
},
{
"name": "stream_transform",
"rootUri": "file:///home/nate/.pub-cache/hosted/pub.dev/stream_transform-2.1.1",
"packageUri": "lib/",
"languageVersion": "3.1"
},
{
"name": "string_scanner",
"rootUri": "file:///home/nate/.pub-cache/hosted/pub.dev/string_scanner-1.4.1",
"packageUri": "lib/",
"languageVersion": "3.1"
},
{
"name": "term_glyph",
"rootUri": "file:///home/nate/.pub-cache/hosted/pub.dev/term_glyph-1.2.2",
"packageUri": "lib/",
"languageVersion": "3.1"
},
{
"name": "test_api",
"rootUri": "file:///home/nate/.pub-cache/hosted/pub.dev/test_api-0.7.4",
"packageUri": "lib/",
"languageVersion": "3.5"
},
{
"name": "timing",
"rootUri": "file:///home/nate/.pub-cache/hosted/pub.dev/timing-1.0.2",
"packageUri": "lib/",
"languageVersion": "3.4"
},
{
"name": "typed_data",
"rootUri": "file:///home/nate/.pub-cache/hosted/pub.dev/typed_data-1.4.0",
"packageUri": "lib/",
"languageVersion": "3.5"
},
{
"name": "watcher",
"rootUri": "file:///home/nate/.pub-cache/hosted/pub.dev/watcher-1.1.1",
"packageUri": "lib/",
"languageVersion": "3.1"
},
{
"name": "web",
"rootUri": "file:///home/nate/.pub-cache/hosted/pub.dev/web-1.1.0",
"packageUri": "lib/",
"languageVersion": "3.4"
},
{
"name": "web_socket",
"rootUri": "file:///home/nate/.pub-cache/hosted/pub.dev/web_socket-0.1.6",
"packageUri": "lib/",
"languageVersion": "3.3"
},
{
"name": "web_socket_channel",
"rootUri": "file:///home/nate/.pub-cache/hosted/pub.dev/web_socket_channel-3.0.2",
"packageUri": "lib/",
"languageVersion": "3.3"
},
{
"name": "yaml",
"rootUri": "file:///home/nate/.pub-cache/hosted/pub.dev/yaml-3.1.3",
"packageUri": "lib/",
"languageVersion": "3.4"
},
{
"name": "shared_models",
"rootUri": "../",
"packageUri": "lib/",
"languageVersion": "3.0"
}
],
"generated": "2025-01-29T23:34:57.323472Z",
"generator": "pub",
"generatorVersion": "3.6.0",
"pubCache": "file:///home/nate/.pub-cache"
}

View File

@ -0,0 +1,23 @@
class TranslationRequest {
final String id;
final String userId;
final String inputText;
final DateTime timestamp;
String? result;
TranslationRequest({
required this.id,
required this.userId,
required this.inputText,
required this.timestamp,
this.result,
});
Map<String, dynamic> toJson() => {
'id': id,
'userId': userId,
'inputText': inputText,
'timestamp': timestamp.toIso8601String(),
'result': result,
};
}

View File

@ -0,0 +1,14 @@
class TranslationResponse {
final String id;
final String translatedText;
TranslationResponse({
required this.id,
required this.translatedText,
});
Map<String, dynamic> toJson() => {
'id': id,
'translatedText': translatedText,
};
}

View File

@ -0,0 +1,17 @@
class User {
final String id;
final String token;
final DateTime createdAt;
User({
required this.id,
required this.token,
required this.createdAt,
});
Map<String, dynamic> toJson() => {
'id': id,
'token': token,
'createdAt': createdAt.toIso8601String(),
};
}

474
shared_models/pubspec.lock Normal file
View File

@ -0,0 +1,474 @@
# Generated by pub
# See https://dart.dev/tools/pub/glossary#lockfile
packages:
_fe_analyzer_shared:
dependency: transitive
description:
name: _fe_analyzer_shared
sha256: "03f6da266a27a4538a69295ec142cb5717d7d4e5727b84658b63e1e1509bac9c"
url: "https://pub.dev"
source: hosted
version: "79.0.0"
_macros:
dependency: transitive
description: dart
source: sdk
version: "0.3.3"
analyzer:
dependency: transitive
description:
name: analyzer
sha256: c9040fc56483c22a5e04a9f6a251313118b1a3c42423770623128fa484115643
url: "https://pub.dev"
source: hosted
version: "7.2.0"
args:
dependency: transitive
description:
name: args
sha256: bf9f5caeea8d8fe6721a9c358dd8a5c1947b27f1cfaa18b39c301273594919e6
url: "https://pub.dev"
source: hosted
version: "2.6.0"
async:
dependency: transitive
description:
name: async
sha256: d2872f9c19731c2e5f10444b14686eb7cc85c76274bd6c16e1816bff9a3bab63
url: "https://pub.dev"
source: hosted
version: "2.12.0"
boolean_selector:
dependency: transitive
description:
name: boolean_selector
sha256: "8aab1771e1243a5063b8b0ff68042d67334e3feab9e95b9490f9a6ebf73b42ea"
url: "https://pub.dev"
source: hosted
version: "2.1.2"
build:
dependency: transitive
description:
name: build
sha256: cef23f1eda9b57566c81e2133d196f8e3df48f244b317368d65c5943d91148f0
url: "https://pub.dev"
source: hosted
version: "2.4.2"
build_config:
dependency: transitive
description:
name: build_config
sha256: "4ae2de3e1e67ea270081eaee972e1bd8f027d459f249e0f1186730784c2e7e33"
url: "https://pub.dev"
source: hosted
version: "1.1.2"
build_daemon:
dependency: transitive
description:
name: build_daemon
sha256: "294a2edaf4814a378725bfe6358210196f5ea37af89ecd81bfa32960113d4948"
url: "https://pub.dev"
source: hosted
version: "4.0.3"
build_resolvers:
dependency: transitive
description:
name: build_resolvers
sha256: "99d3980049739a985cf9b21f30881f46db3ebc62c5b8d5e60e27440876b1ba1e"
url: "https://pub.dev"
source: hosted
version: "2.4.3"
build_runner:
dependency: "direct dev"
description:
name: build_runner
sha256: "74691599a5bc750dc96a6b4bfd48f7d9d66453eab04c7f4063134800d6a5c573"
url: "https://pub.dev"
source: hosted
version: "2.4.14"
build_runner_core:
dependency: transitive
description:
name: build_runner_core
sha256: "22e3aa1c80e0ada3722fe5b63fd43d9c8990759d0a2cf489c8c5d7b2bdebc021"
url: "https://pub.dev"
source: hosted
version: "8.0.0"
built_collection:
dependency: transitive
description:
name: built_collection
sha256: "376e3dd27b51ea877c28d525560790aee2e6fbb5f20e2f85d5081027d94e2100"
url: "https://pub.dev"
source: hosted
version: "5.1.1"
built_value:
dependency: transitive
description:
name: built_value
sha256: "28a712df2576b63c6c005c465989a348604960c0958d28be5303ba9baa841ac2"
url: "https://pub.dev"
source: hosted
version: "8.9.3"
checked_yaml:
dependency: transitive
description:
name: checked_yaml
sha256: feb6bed21949061731a7a75fc5d2aa727cf160b91af9a3e464c5e3a32e28b5ff
url: "https://pub.dev"
source: hosted
version: "2.0.3"
code_builder:
dependency: transitive
description:
name: code_builder
sha256: "0ec10bf4a89e4c613960bf1e8b42c64127021740fb21640c29c909826a5eea3e"
url: "https://pub.dev"
source: hosted
version: "4.10.1"
collection:
dependency: transitive
description:
name: collection
sha256: "2f5709ae4d3d59dd8f7cd309b4e023046b57d8a6c82130785d2b0e5868084e76"
url: "https://pub.dev"
source: hosted
version: "1.19.1"
convert:
dependency: transitive
description:
name: convert
sha256: b30acd5944035672bc15c6b7a8b47d773e41e2f17de064350988c5d02adb1c68
url: "https://pub.dev"
source: hosted
version: "3.1.2"
crypto:
dependency: transitive
description:
name: crypto
sha256: "1e445881f28f22d6140f181e07737b22f1e099a5e1ff94b0af2f9e4a463f4855"
url: "https://pub.dev"
source: hosted
version: "3.0.6"
dart_style:
dependency: transitive
description:
name: dart_style
sha256: "27eb0ae77836989a3bc541ce55595e8ceee0992807f14511552a898ddd0d88ac"
url: "https://pub.dev"
source: hosted
version: "3.0.1"
file:
dependency: transitive
description:
name: file
sha256: a3b4f84adafef897088c160faf7dfffb7696046cb13ae90b508c2cbc95d3b8d4
url: "https://pub.dev"
source: hosted
version: "7.0.1"
fixnum:
dependency: transitive
description:
name: fixnum
sha256: b6dc7065e46c974bc7c5f143080a6764ec7a4be6da1285ececdc37be96de53be
url: "https://pub.dev"
source: hosted
version: "1.1.1"
frontend_server_client:
dependency: transitive
description:
name: frontend_server_client
sha256: f64a0333a82f30b0cca061bc3d143813a486dc086b574bfb233b7c1372427694
url: "https://pub.dev"
source: hosted
version: "4.0.0"
glob:
dependency: transitive
description:
name: glob
sha256: c3f1ee72c96f8f78935e18aa8cecced9ab132419e8625dc187e1c2408efc20de
url: "https://pub.dev"
source: hosted
version: "2.1.3"
graphs:
dependency: transitive
description:
name: graphs
sha256: "741bbf84165310a68ff28fe9e727332eef1407342fca52759cb21ad8177bb8d0"
url: "https://pub.dev"
source: hosted
version: "2.3.2"
http_multi_server:
dependency: transitive
description:
name: http_multi_server
sha256: aa6199f908078bb1c5efb8d8638d4ae191aac11b311132c3ef48ce352fb52ef8
url: "https://pub.dev"
source: hosted
version: "3.2.2"
http_parser:
dependency: transitive
description:
name: http_parser
sha256: "178d74305e7866013777bab2c3d8726205dc5a4dd935297175b19a23a2e66571"
url: "https://pub.dev"
source: hosted
version: "4.1.2"
io:
dependency: transitive
description:
name: io
sha256: dfd5a80599cf0165756e3181807ed3e77daf6dd4137caaad72d0b7931597650b
url: "https://pub.dev"
source: hosted
version: "1.0.5"
js:
dependency: transitive
description:
name: js
sha256: c1b2e9b5ea78c45e1a0788d29606ba27dc5f71f019f32ca5140f61ef071838cf
url: "https://pub.dev"
source: hosted
version: "0.7.1"
json_annotation:
dependency: "direct main"
description:
name: json_annotation
sha256: "1ce844379ca14835a50d2f019a3099f419082cfdd231cd86a142af94dd5c6bb1"
url: "https://pub.dev"
source: hosted
version: "4.9.0"
json_serializable:
dependency: "direct dev"
description:
name: json_serializable
sha256: b0a98230538fe5d0b60a22fb6bf1b6cb03471b53e3324ff6069c591679dd59c9
url: "https://pub.dev"
source: hosted
version: "6.9.3"
logging:
dependency: transitive
description:
name: logging
sha256: c8245ada5f1717ed44271ed1c26b8ce85ca3228fd2ffdb75468ab01979309d61
url: "https://pub.dev"
source: hosted
version: "1.3.0"
macros:
dependency: transitive
description:
name: macros
sha256: "1d9e801cd66f7ea3663c45fc708450db1fa57f988142c64289142c9b7ee80656"
url: "https://pub.dev"
source: hosted
version: "0.1.3-main.0"
matcher:
dependency: transitive
description:
name: matcher
sha256: dc58c723c3c24bf8d3e2d3ad3f2f9d7bd9cf43ec6feaa64181775e60190153f2
url: "https://pub.dev"
source: hosted
version: "0.12.17"
meta:
dependency: transitive
description:
name: meta
sha256: e3641ec5d63ebf0d9b41bd43201a66e3fc79a65db5f61fc181f04cd27aab950c
url: "https://pub.dev"
source: hosted
version: "1.16.0"
mime:
dependency: transitive
description:
name: mime
sha256: "41a20518f0cb1256669420fdba0cd90d21561e560ac240f26ef8322e45bb7ed6"
url: "https://pub.dev"
source: hosted
version: "2.0.0"
package_config:
dependency: transitive
description:
name: package_config
sha256: "92d4488434b520a62570293fbd33bb556c7d49230791c1b4bbd973baf6d2dc67"
url: "https://pub.dev"
source: hosted
version: "2.1.1"
path:
dependency: transitive
description:
name: path
sha256: "75cca69d1490965be98c73ceaea117e8a04dd21217b37b292c9ddbec0d955bc5"
url: "https://pub.dev"
source: hosted
version: "1.9.1"
pool:
dependency: transitive
description:
name: pool
sha256: "20fe868b6314b322ea036ba325e6fc0711a22948856475e2c2b6306e8ab39c2a"
url: "https://pub.dev"
source: hosted
version: "1.5.1"
pub_semver:
dependency: transitive
description:
name: pub_semver
sha256: "7b3cfbf654f3edd0c6298ecd5be782ce997ddf0e00531b9464b55245185bbbbd"
url: "https://pub.dev"
source: hosted
version: "2.1.5"
pubspec_parse:
dependency: transitive
description:
name: pubspec_parse
sha256: "0560ba233314abbed0a48a2956f7f022cce7c3e1e73df540277da7544cad4082"
url: "https://pub.dev"
source: hosted
version: "1.5.0"
shelf:
dependency: transitive
description:
name: shelf
sha256: e7dd780a7ffb623c57850b33f43309312fc863fb6aa3d276a754bb299839ef12
url: "https://pub.dev"
source: hosted
version: "1.4.2"
shelf_web_socket:
dependency: transitive
description:
name: shelf_web_socket
sha256: cc36c297b52866d203dbf9332263c94becc2fe0ceaa9681d07b6ef9807023b67
url: "https://pub.dev"
source: hosted
version: "2.0.1"
source_gen:
dependency: transitive
description:
name: source_gen
sha256: "35c8150ece9e8c8d263337a265153c3329667640850b9304861faea59fc98f6b"
url: "https://pub.dev"
source: hosted
version: "2.0.0"
source_helper:
dependency: transitive
description:
name: source_helper
sha256: "86d247119aedce8e63f4751bd9626fc9613255935558447569ad42f9f5b48b3c"
url: "https://pub.dev"
source: hosted
version: "1.3.5"
source_span:
dependency: transitive
description:
name: source_span
sha256: "254ee5351d6cb365c859e20ee823c3bb479bf4a293c22d17a9f1bf144ce86f7c"
url: "https://pub.dev"
source: hosted
version: "1.10.1"
stack_trace:
dependency: transitive
description:
name: stack_trace
sha256: "8b27215b45d22309b5cddda1aa2b19bdfec9df0e765f2de506401c071d38d1b1"
url: "https://pub.dev"
source: hosted
version: "1.12.1"
stream_channel:
dependency: transitive
description:
name: stream_channel
sha256: "969e04c80b8bcdf826f8f16579c7b14d780458bd97f56d107d3950fdbeef059d"
url: "https://pub.dev"
source: hosted
version: "2.1.4"
stream_transform:
dependency: transitive
description:
name: stream_transform
sha256: ad47125e588cfd37a9a7f86c7d6356dde8dfe89d071d293f80ca9e9273a33871
url: "https://pub.dev"
source: hosted
version: "2.1.1"
string_scanner:
dependency: transitive
description:
name: string_scanner
sha256: "921cd31725b72fe181906c6a94d987c78e3b98c2e205b397ea399d4054872b43"
url: "https://pub.dev"
source: hosted
version: "1.4.1"
term_glyph:
dependency: transitive
description:
name: term_glyph
sha256: "7f554798625ea768a7518313e58f83891c7f5024f88e46e7182a4558850a4b8e"
url: "https://pub.dev"
source: hosted
version: "1.2.2"
test_api:
dependency: transitive
description:
name: test_api
sha256: fb31f383e2ee25fbbfe06b40fe21e1e458d14080e3c67e7ba0acfde4df4e0bbd
url: "https://pub.dev"
source: hosted
version: "0.7.4"
timing:
dependency: transitive
description:
name: timing
sha256: "62ee18aca144e4a9f29d212f5a4c6a053be252b895ab14b5821996cff4ed90fe"
url: "https://pub.dev"
source: hosted
version: "1.0.2"
typed_data:
dependency: transitive
description:
name: typed_data
sha256: f9049c039ebfeb4cf7a7104a675823cd72dba8297f264b6637062516699fa006
url: "https://pub.dev"
source: hosted
version: "1.4.0"
watcher:
dependency: transitive
description:
name: watcher
sha256: "69da27e49efa56a15f8afe8f4438c4ec02eff0a117df1b22ea4aad194fe1c104"
url: "https://pub.dev"
source: hosted
version: "1.1.1"
web:
dependency: transitive
description:
name: web
sha256: cd3543bd5798f6ad290ea73d210f423502e71900302dde696f8bff84bf89a1cb
url: "https://pub.dev"
source: hosted
version: "1.1.0"
web_socket:
dependency: transitive
description:
name: web_socket
sha256: "3c12d96c0c9a4eec095246debcea7b86c0324f22df69893d538fcc6f1b8cce83"
url: "https://pub.dev"
source: hosted
version: "0.1.6"
web_socket_channel:
dependency: transitive
description:
name: web_socket_channel
sha256: "0b8e2457400d8a859b7b2030786835a28a8e80836ef64402abef392ff4f1d0e5"
url: "https://pub.dev"
source: hosted
version: "3.0.2"
yaml:
dependency: transitive
description:
name: yaml
sha256: b9da305ac7c39faa3f030eccd175340f968459dae4af175130b3fc47e40d76ce
url: "https://pub.dev"
source: hosted
version: "3.1.3"
sdks:
dart: ">=3.6.0 <4.0.0"

View File

@ -0,0 +1,13 @@
name: shared_models
description: Shared models for Bab.ai
version: 0.1.0
environment:
sdk: '>=3.0.0 <4.0.0'
dependencies:
json_annotation: ^4.8.1
dev_dependencies:
build_runner: ^2.4.6
json_serializable: ^6.7.1