Skip to content

joshuamoreno1/nock

Repository files navigation

Nock

⚠️ Unmaintained — open-sourced experiment. Nock was a real-time proximity social app I built as a startup experiment. The venture is no longer active, and the code is published here under GPL-3.0 for reference, learning, and as a starting point for forks. No active development, support, or security updates are provided. Feel free to fork it.

Mobile app (iOS + Android) that connects people in real time based on physical proximity. Built with Flutter on top of an AWS Amplify backend (Cognito, AppSync/GraphQL, Lambda, DynamoDB, S3, Pinpoint).

"A mobile app designed to connect you in real time."


What it does

Nock detects nearby profiles via geolocation and P2P connectivity, lets users "nock" (tap) each other, manages relationships, exchanges 1‑to‑1 and group messages, and keeps a profile with social media links, stats and a score.

Main modules (lib/ui/modules/)

Module Purpose
splash Initial load, Amplify session hydration, permission checks.
onboarding Intro tutorial + permission requests (location, notifications, ATT).
account Sign-up, login, password recovery and change (Cognito via flutter_login).
home Main user view and navigation hub.
nearby Discover nearby profiles via radar (geolocator + flutter_nearby_connections).
connected Relationship management (nock/unnock, blocks, follows).
message 1‑to‑1 P2P chat and group messaging with delivery states.
profile Own profile, edit, social media, stats and score.

Backend (amplify/backend/)

  • Auth: Cognito User Pool nockusers (password policy, no client secret).
  • GraphQL API (api/nock): AppSync with TTL transformer.
  • Storage (storage/nockstorage): S3 bucket for avatars and media.
  • Analytics + Push (analytics/nock): Pinpoint (nock-dev / nock-prod).
  • Lambda functions:
    • getprofilebyid, manageprofile, asyncmanageprofile
    • managerelationship, asyncmanagerelationship (nock, unnock, block, unblock)
    • managelocation — updates location and radar
    • asyncprocessradarsettings — uses Secrets Manager
    • getbydeviceid, getscorebyid, notifications

Stack

  • Flutter >=3.3.0 / Dart SDK >=3.0.6 <4.0.0
  • State: flutter_bloc (Cubit) + flutter_hooks
  • Local persistence: hive, shared_preferences, localstorage
  • AWS Amplify Flutter v1.6 (auth, datastore, api, storage, analytics_pinpoint, push_notifications_pinpoint)
  • Firebase Analytics (GA4 events)
  • Sentry for crash reporting (sentry_flutter)
  • Google Mobile Ads (google_mobile_ads)
  • Proximity connectivity: flutter_nearby_connections, geolocator, permission_handler

Flavors

The project defines two flavors:

  • alpha → Amplify env dev, bundle com.nock.person.alpha, Firebase project nock-alpha, Sentry project nock-alpha.
  • prod → Amplify env prod, production bundle, Firebase and Sentry production projects.

Repository layout

lib/
├── main.dart                 # Bootstrap: Sentry → MobileAds → Firebase → Amplify → runApp
├── domain/                   # Models, repository contracts, use cases, exceptions
├── infraestructure/          # Implementations: amplify/, hive/, local/, nearby/, utils/
├── models/                   # Amplify DataStore generated models (Profile, NockNocks, ...)
└── ui/
    ├── core/                 # Constants, routes, themes, localization, MainCubit
    ├── tools/                # Mixins, utils, custom icons
    ├── widgets/              # Reusable components (forms, tabs, ads, ...)
    └── modules/              # Screens (see table above)

amplify/                      # Amplify backend (categories + Lambdas)
android/ ios/ macos/ linux/ windows/ web/   # Flutter platforms
assets/                       # Images, sounds, fonts (Montserrat, Poppins, NockIcons)
Makefile                      # Build/run shortcuts for alpha/prod

Getting started

Requirements

  • Flutter SDK >=3.3.0
  • AWS account + Amplify CLI configured for an environment you own. The original dev/prod environments in amplify/team-provider-info.json belong to the original deployment and are not accessible. To run the backend you must initialize your own (amplify init) and re-create the categories defined under amplify/backend/.
  • Xcode (iOS) / Android SDK + a keystore configured via android/key.properties (gitignored).
  • Your own Firebase project — replace android/app/.../google-services.json and ios/config/<flavor>/GoogleService-Info.plist with files generated for your project (the bundle IDs and nock-alpha/nock-* Firebase projects in this repo belong to the original deployment).

Commands (Makefile)

make            # clean + pub get + analyze
make run        # amplify env checkout dev  + flutter run --flavor alpha
make run-prod   # amplify env checkout prod + flutter run --flavor prod
make alpha      # build IPA + AppBundle alpha (obfuscated) + upload symbols to Sentry
make prod       # build IPA + AppBundle prod   (obfuscated) + upload symbols to Sentry
make clean      # flutter clean + remove .symbols
make analyze    # flutter analyze

Builds use --obfuscate --split-debug-info=... and finish with dart run sentry_dart_plugin to upload symbols.

Raw commands

flutter pub get
flutter run --flavor alpha            # or --flavor prod
flutter build ipa --flavor prod --obfuscate --split-debug-info=<path>
flutter build appbundle --flavor prod --obfuscate --split-debug-info=<path>

Sensitive configuration (NOT versioned)

.gitignore excludes the sensitive artifacts Amplify generates locally:

aws-exports.js
awsconfiguration.json
amplifyconfiguration.json
amplifyconfiguration.dart
amplify-build-config.json
amplify-gradle-config.json
amplifytools.xcconfig
.secret-*
amplify/#current-cloud-backend
amplify/.config/local-*

These files are generated when you run amplify pull with valid credentials and must not be committed.

What is versioned (and expected)

  • GoogleService-Info.plist (iOS) and google-services.json (Android), per flavor. Their API_KEYs are Firebase keys restricted by bundle id / SHA-1 and are designed to ship with the binary. Replace them with your own when forking.
  • amplify/team-provider-info.json: contains the AmplifyAppId, role ARNs and the AWS Account ID of the original workspace. Required by Amplify CLI; replace with your own when forking (run amplify init).

Sentry DSN

DSNs are read from environment variables via --dart-define:

export SENTRY_DSN_DEV='https://<key>@<org>.ingest.sentry.io/<project_dev>'
export SENTRY_DSN_PROD='https://<key>@<org>.ingest.sentry.io/<project_prod>'
make run         # or make alpha / make prod

If no DSN is set for the active flavor, SentryFlutter.init initializes with an empty string and event reporting is effectively disabled (the app keeps running).

Lambda example payloads

Files under amplify/backend/function/*/event*.json are local invocation payloads. The authorization header is redacted as <REDACTED_JWT>; before using them with amplify mock function, replace it with a valid User Pool access token.


Conventions

  • Lints: flutter_lints (analysis_options.yaml).
  • Fonts: Montserrat, Poppins, plus custom NockIcons and NockSocialMedias icon fonts.
  • Splash and launcher icon generated by flutter_native_splash and flutter_launcher_icons.

Background

Nock was an experiment born out of a startup idea: a social app where the unit of interaction was physical proximity rather than a follow graph. Users could discover, "nock" and message people physically near them in real time, with a radar-style UI and P2P connectivity as a fallback to the backend. After the alpha and a private prod release, the venture was wound down.

The code is published here so anyone curious about Flutter + AWS Amplify architecture, proximity-based UX, or anyone looking to fork the idea, can use it as a starting point.


Contributing

The project is archived / unmaintained — issues and pull requests will most likely not be reviewed. If you want to build on top of it, fork the repo; that's the intended path forward.


License

Licensed under the GNU General Public License v3.0 (GPL-3.0). See LICENSE for the full text.

publish_to: 'none' in pubspec.yaml only prevents accidental publishing of this Flutter application to pub.dev (which is for Dart/Flutter packages, not apps); it has no relation to source-code visibility.

About

Real-time proximity social app built with Flutter and AWS Amplify (Cognito, AppSync, Lambda, S3, Pinpoint). Archived startup experiment, open-sourced under GPL-3.0.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors