Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restructure code #38

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.ignore.*
# Miscellaneous
*.class
*.log
Expand All @@ -23,7 +24,8 @@ migrate_working_dir/
# The .vscode folder contains launch configuration and tasks you configure in
# VS Code which you may wish to be included in version control, so this line
# is commented out by default.
#.vscode/
.vscode/
/*.code-workspace

# Flutter/Dart/Pub related
**/doc/api/
Expand All @@ -45,3 +47,6 @@ app.*.map.json
/android/app/debug
/android/app/profile
/android/app/release

# Expected
server/
3 changes: 0 additions & 3 deletions .vscode/settings.json

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file added flutter_app/assets/images/inventory_logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:sabitou_dart/models.dart';
import 'package:sabitou_rpc/models.dart';

import '../../routes/app_routes.dart';
import '../../routes/pages_routes.dart';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:sabitou_dart/proto/user/v1/user.pbgrpc.dart';
import 'package:sabitou_rpc/proto/user/v1/user.pbgrpc.dart';

import '../../routes/app_routes.dart';
import '../../routes/pages_routes.dart';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:sabitou_dart/models.dart';
import 'package:sabitou_rpc/models.dart';

import '../../providers/dashboard/dasboard.dart';
import '../../routes/pages_routes.dart';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:sabitou_dart/proto/user/v1/user.pb.dart';

import '../../routes/pages_routes.dart';
import '../../services/internationalization/internationalization.dart';
import '../../themes/app_colors.dart';
import '../../utils/app_layout.dart';
import '../../utils/user_preference.dart';
import '../../widgets/base_page.dart';
import '../../widgets/components/sb_container.dart';
import 'package:sabitou_rpc/identity/v1/user.pb.dart';

import '../../../routes/pages_routes.dart';
import '../../../services/internationalization/internationalization.dart';
import '../../../themes/app_colors.dart';
import '../../../utils/app_layout.dart';
import '../../../utils/user_preference.dart';
import '../../../widgets/base_page.dart';
import '../../../widgets/components/sb_container.dart';

/// User profile screen.
class ProfileView extends StatelessWidget {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:get/get.dart';
import 'package:grpc/grpc_or_grpcweb.dart';
import 'package:sabitou_dart/models.dart';
import 'package:sabitou_rpc/models.dart';

import '../utils/logger.dart';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:get/get.dart';
import 'package:grpc/grpc_or_grpcweb.dart';
import 'package:sabitou_dart/proto/user/v1/user.pbgrpc.dart';
import 'package:sabitou_rpc/proto/user/v1/user.pbgrpc.dart';

import '../utils/logger.dart';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'package:get/get.dart';
import 'package:sabitou_dart/models.dart';
import 'package:sabitou_rpc/models.dart';

import '../services/storage/app_storate.dart';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,6 @@ class _UserAvatar extends StatelessWidget {

const _UserAvatar({
required this.name,
this.userType,
required this.isOnline,
});

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
34 changes: 17 additions & 17 deletions sabitou_clients/pubspec.lock → flutter_app/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,10 @@ packages:
dependency: transitive
description:
name: collection
sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a
sha256: a1ace0a119f20aabc852d165077c036cd864315bd99b7eaa10a60100341941bf
url: "https://pub.dev"
source: hosted
version: "1.18.0"
version: "1.19.0"
convert:
dependency: transitive
description:
Expand Down Expand Up @@ -433,18 +433,18 @@ packages:
dependency: transitive
description:
name: leak_tracker
sha256: "3f87a60e8c63aecc975dda1ceedbc8f24de75f09e4856ea27daf8958f2f0ce05"
sha256: "7bb2830ebd849694d1ec25bf1f44582d6ac531a57a365a803a6034ff751d2d06"
url: "https://pub.dev"
source: hosted
version: "10.0.5"
version: "10.0.7"
leak_tracker_flutter_testing:
dependency: transitive
description:
name: leak_tracker_flutter_testing
sha256: "932549fb305594d82d7183ecd9fa93463e9914e1b67cacc34bc40906594a1806"
sha256: "9491a714cca3667b60b5c420da8217e6de0d1ba7a5ec322fab01758f6998f379"
url: "https://pub.dev"
source: hosted
version: "3.0.5"
version: "3.0.8"
leak_tracker_testing:
dependency: transitive
description:
Expand Down Expand Up @@ -653,7 +653,7 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.3.0"
sabitou_dart:
sabitou_rpc:
dependency: "direct main"
description:
path: "../protos/gen/dart"
Expand All @@ -680,7 +680,7 @@ packages:
dependency: transitive
description: flutter
source: sdk
version: "0.0.99"
version: "0.0.0"
source_gen:
dependency: transitive
description:
Expand Down Expand Up @@ -709,10 +709,10 @@ packages:
dependency: transitive
description:
name: stack_trace
sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b"
sha256: "9f47fd3630d76be3ab26f0ee06d213679aa425996925ff3feffdec504931c377"
url: "https://pub.dev"
source: hosted
version: "1.11.1"
version: "1.12.0"
stream_channel:
dependency: transitive
description:
Expand All @@ -733,10 +733,10 @@ packages:
dependency: transitive
description:
name: string_scanner
sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde"
sha256: "688af5ed3402a4bde5b3a6c15fd768dbf2621a614950b17f04626c431ab3c4c3"
url: "https://pub.dev"
source: hosted
version: "1.2.0"
version: "1.3.0"
term_glyph:
dependency: transitive
description:
Expand All @@ -749,10 +749,10 @@ packages:
dependency: transitive
description:
name: test_api
sha256: "5b8a98dafc4d5c4c9c72d8b31ab2b23fc13422348d2997120294d3bac86b4ddb"
sha256: "664d3a9a64782fcdeb83ce9c6b39e78fd2971d4e37827b9b06c3aa1edc5e760c"
url: "https://pub.dev"
source: hosted
version: "0.7.2"
version: "0.7.3"
timing:
dependency: transitive
description:
Expand Down Expand Up @@ -789,10 +789,10 @@ packages:
dependency: transitive
description:
name: vm_service
sha256: "5c5f338a667b4c644744b661f309fb8080bb94b18a7e91ef1dbd343bed00ed6d"
sha256: f6be3ed8bd01289b34d679c2b62226f63c0e69f9fd2e50a6b3c1c729a961041b
url: "https://pub.dev"
source: hosted
version: "14.2.5"
version: "14.3.0"
watcher:
dependency: transitive
description:
Expand Down Expand Up @@ -850,5 +850,5 @@ packages:
source: hosted
version: "3.1.2"
sdks:
dart: "3.5.3"
dart: ">=3.5.3 <4.0.0"
flutter: ">=3.24.3"
6 changes: 3 additions & 3 deletions sabitou_clients/pubspec.yaml → flutter_app/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ publish_to: "none" # Remove this line if you wish to publish to pub.dev
version: 1.0.0+1

environment:
sdk: "3.5.3"
flutter: "3.24.3"
sdk: ">=3.5.3"
flutter: ">=3.24.3"

# Dependencies specify other packages that your package needs in order to work.
# To automatically upgrade your package dependencies to the latest versions
Expand Down Expand Up @@ -55,7 +55,7 @@ dependencies:
# The grpc package.
grpc: ^4.0.1

sabitou_dart:
sabitou_rpc:
path: ../protos/gen/dart

dev_dependencies:
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import 'package:sabitou_clients/screens/profile/profile_view.dart';
import 'package:sabitou_clients/services/storage/app_storate.dart';
import 'package:sabitou_clients/utils/user_preference.dart';

import '../../goldens.dart';
import '../../../test/goldens.dart';

void main() {
group('Goldens', () {
Expand Down
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
15 changes: 3 additions & 12 deletions protos/.gitignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,4 @@
# Compiled JavaScript files
lib/**/*.js
lib/**/*.js.map
**/dist/
.vscode/

**/pubspec.lock


# TypeScript v1 declaration files
typings/

# Node.js dependency directory
node_modules/
# Ignore unecessary generated files

Check failure on line 3 in protos/.gitignore

View workflow job for this annotation

GitHub Actions / misspell

[misspell] protos/.gitignore#L3

"unecessary" is a misspelling of "unnecessary"
Raw output
./protos/.gitignore:3:9: "unecessary" is a misspelling of "unnecessary"
*.pbserver.dart
13 changes: 13 additions & 0 deletions protos/README → protos/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,18 @@ Buf is highly extensible and customizable, allowing developers to create custom
scoop install buf
```

- Linux

```bash
curl -sSL https://github.com/bufbuild/buf/releases/latest/download/buf-Linux-x86_64 -o ~/.local/bin/buf
chmod +x ~/.local/bin/buf
```

- GO
```bash
go install github.com/bufbuild/buf/cmd/buf@latest
```

## Before you begin

Let's check the version of buf you'll be using is up-to-date.
Expand All @@ -88,3 +100,4 @@ Output
cd protos
buf generate src/sabitou
```

46 changes: 33 additions & 13 deletions protos/buf.gen.yaml
Original file line number Diff line number Diff line change
@@ -1,22 +1,42 @@
# A File controls how the **buf generate** command executes protoc plugins on a given module.
version: v2
clean: true
managed:
enabled: true
disable:
# Disable prefixing GO package import for protovalidate package.
- file_option: go_package_prefix
module: buf.build/bufbuild/protovalidate
override:
# Prefix all GO packages imported from the proto files with the specified value.
- file_option: go_package_prefix
value: github.com/karibu-cap/sabitou/protos/gen/go

plugins:
# Generated a DART specific code and place the output to gen/dart/models/lib/src directory.
- remote: buf.build/protocolbuffers/dart:v21.1.2
out: gen/dart/lib/proto
opt:
- grpc
- remote: buf.build/grpc/go:v1.5.1
out: gen/go/proto
# Generate Go code for Protobufs
- remote: buf.build/protocolbuffers/go
out: gen/go
opt: paths=source_relative
# Generates Go code to validate Protobuf messages using protoc-gen-validate constraints.
- remote: buf.build/bufbuild/validate-go:v1.2.1
out: gen/go
opt:
- paths=source_relative
# dependencies
- remote: buf.build/protocolbuffers/go:v1.35.1
out: gen/go/proto
# Generate Go client and server stubs for Connect framework.
- remote: buf.build/connectrpc/go
out: gen/go
opt:
- paths=source_relative

# Generate OpenAPI spec for Connect endpoints
- local: ["go", "run", "github.com/sudorandom/protoc-gen-connect-openapi@main"]
out: gen/openapi/specs

# Generate Dart client stubs for Connect framework.
- remote: buf.build/connectrpc/dart
out: gen/dart/lib
# Generate Dart code for Protobufs
- remote: buf.build/protocolbuffers/dart
out: gen/dart/lib
include_wkt: true
include_imports: true
inputs:
- directory: src/sabitou
- directory: src
6 changes: 6 additions & 0 deletions protos/buf.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Generated by buf. DO NOT EDIT.
version: v2
deps:
- name: buf.build/bufbuild/protovalidate
commit: d39267d9df8f4053bbac6b956a23169f
digest: b5:c2542c2e9935dd9a7f12ef79f76aa5b53cf1c8312d720da54e03953f27ad952e2b439cbced06e3b4069e466bd9b64019cf9f687243ad51aa5dc2b5f364fac71e
12 changes: 12 additions & 0 deletions protos/buf.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# For details on buf.yaml configuration, visit https://buf.build/docs/configuration/v2/buf-yaml
version: v2
modules:
- path: src
lint:
use:
- STANDARD
breaking:
use:
- FILE
deps:
- buf.build/bufbuild/protovalidate
Loading
Loading