ScripTag is a comprehensive medication management platform that leverages NFC technology to help users track and manage their medications. The platform consists of a React Native mobile application, a Go-based GraphQL API, notification services, and cloud infrastructure.
IMPORTANT: This repository contains sensitive credentials that must be properly secured before contributing or deploying.
Never commit:
.envfilesservice-account-key.jsonorfirebase-service-account-key.jsonGoogleService-Info.plist- Any files containing API keys, secrets, or credentials
All sensitive files have .example templates in this repository. Copy them and fill in your actual credentials locally.
This is a monorepo containing the following components:
- React Native App (
apps/react-native-app/) - Cross-platform mobile application for iOS and Android- NFC tag scanning and writing
- Medication tracking and scheduling
- Push notifications via Firebase Cloud Messaging
- User authentication (Google Sign-In, Apple Sign-In)
- Apollo GraphQL client integration
-
Go GraphQL API (
services/go-api/) - Main backend API service- GraphQL API built with gqlgen
- PostgreSQL database with GORM ORM
- JWT-based authentication
- Firebase Admin SDK integration
- Atlas for database migrations
- River for background job processing
-
Notification Dispatcher (
jobs/notification-dispatcher/) - Cloud Run service for medication reminders- Scheduled medication reminder notifications
- Firebase Cloud Messaging integration
- Batch processing (100 notifications at a time)
- Automatic invalid token cleanup
- Shared Models (
shared/) - Common Go models and types shared across services- Medication models
- User models
- Notification models
- User medication schedules
- GCP Infrastructure (
infra/gcp/) - Google Cloud Platform infrastructure as code- Pulumi-based infrastructure definitions
- Cloud Run deployments
- Storage configuration
- Bootstrap API (
tools/bootstrap-api/) - API initialization tools - ChatGPT Extractor (
tools/chatgpt-extractor/) - Medication data extraction utilities - Style Dictionary (
tools/style-dictionary/) - Design token management
- Node.js >= 18
- Go 1.24+
- PostgreSQL database
- Firebase project with Cloud Messaging enabled
- React Native development environment (Xcode for iOS, Android Studio for Android)
CRITICAL: Complete this section before running the application.
- Go to Firebase Console
- Create or select your project
- Download configuration files:
- For iOS: Download
GoogleService-Info.plist- Go to Project Settings β iOS App
- Place in
apps/react-native-app/ios/
- For Android: Download
google-services.json- Go to Project Settings β Android App
- Place in
apps/react-native-app/android/app/
- For Backend: Download Service Account Key
- Go to Project Settings β Service Accounts
- Click "Generate New Private Key"
- Save as
services/go-api/firebase-service-account-key.json - Save as
jobs/notification-dispatcher/service-account-key.json
- For iOS: Download
Create .env files from the provided examples:
# Go API
cp services/go-api/.env.example services/go-api/.env
# Edit services/go-api/.env with your credentials
# React Native App
cp apps/react-native-app/.env.example apps/react-native-app/.env
# Edit apps/react-native-app/.env with your API URL
# Notification Dispatcher
cp jobs/notification-dispatcher/.env.example jobs/notification-dispatcher/.env
# Edit jobs/notification-dispatcher/.env with your database URLRequired Configuration:
services/go-api/.env:
DB_CONN_STR="host=localhost user=postgres password=YOUR_PASSWORD dbname=scriptag port=5432 sslmode=disable TimeZone=UTC"
SECRET_KEY=$(openssl rand -hex 32) # Generate a secure random key
ENVIRONMENT=development
PORT=8080apps/react-native-app/.env:
# For iOS Simulator
API_URL=http://localhost:8080/query
# For Android Emulator
# API_URL=http://10.0.2.2:8080/query
# For physical device (replace with your computer's IP)
# API_URL=http://192.168.1.XXX:8080/queryCreate the PostgreSQL database:
createdb scriptag
# Or using psql
psql -U postgres -c "CREATE DATABASE scriptag;"- Clone the repository:
git clone https://github.com/joshnissenbaum/scriptag-platform.git
cd scriptag-platform- Install dependencies for the React Native app:
cd apps/react-native-app
npm install
cd ios && pod install && cd ..- Set up environment variables for the Go API:
cd services/go-api
cp .env.example .env
# Edit .env with your database credentials and Firebase config- Initialize the Go workspace:
# From project root
go work synccd services/go-api
ENVIRONMENT=development go run server.goOr use the VS Code task: Go API - Start Server
First, start Metro bundler:
cd apps/react-native-app
npm run start --reset-cacheOr use the VS Code task: React Native App - Start Metro
Then run the app:
# iOS
npm run ios
# Android
npm run androidThe project uses code generation for GraphQL schemas and types:
cd services/go-api
go run github.com/99designs/gqlgen generateOr use the VS Code task: Go GraphQL - Codegen
cd apps/react-native-app
npm run generateOr use the VS Code task: React Native App - Codegen
- NFC Tag Management - Write medication information to NFC tags and scan them to log consumption
- Medication Tracking - Add, manage, and track multiple medications
- Smart Scheduling - Configure medication schedules (daily, intervals, specific days, as needed)
- Push Notifications - Receive timely medication reminders via Firebase Cloud Messaging
- Consumption History - View and track medication intake history
- User Authentication - Secure authentication with Google and Apple Sign-In
- React Native 0.79.2
- Apollo Client for GraphQL
- React Navigation for routing
- Zustand for state management
- React Native NFC Manager for NFC functionality
- Firebase Cloud Messaging for notifications
- React Native Reanimated for animations
- MMKV for efficient local storage
- Go 1.24
- GraphQL (gqlgen)
- GORM for database operations
- PostgreSQL database
- JWT authentication
- Firebase Admin SDK
- River for background jobs
- Atlas for migrations
scriptag/
βββ apps/
β βββ react-native-app/ # Mobile application
β βββ src/
β β βββ components/ # Reusable UI components
β β βββ features/ # Feature-based modules
β β βββ graphql/ # GraphQL queries and mutations
β β βββ hooks/ # Custom React hooks
β β βββ navigators/ # Navigation configuration
β β βββ utils/ # Utility functions
β βββ android/ # Android native code
β βββ ios/ # iOS native code
β
βββ services/
β βββ go-api/ # Main backend API
β βββ adapters/ # Data adapters and repositories
β βββ auth/ # Authentication logic
β βββ config/ # Configuration (DB, Firebase)
β βββ core/ # Business logic ports/interfaces
β βββ db/ # Database models and queries
β βββ graph/ # GraphQL resolvers and schema
β βββ migrations/ # Database migrations
β βββ service/ # Business logic implementations
β βββ workers/ # Background job workers
β
βββ jobs/
β βββ notification-dispatcher/ # Cloud Run notification service
β
βββ shared/ # Shared Go models
β βββ models/ # Common data models
β
βββ infra/
β βββ gcp/ # Google Cloud Platform infrastructure
β
βββ tools/ # Development and utility tools
The project uses Atlas for database migrations:
cd services/go-api
# Generate a new migration
atlas migrate diff --env local
# Apply migrations
atlas migrate apply --env localcd services/go-api
gcloud run deploy go-api \
--source . \
--region us-central1 \
--set-env-vars "DATABASE_URL=[YOUR_DATABASE_URL]"cd jobs/notification-dispatcher
gcloud run deploy notification-dispatcher \
--source . \
--region us-central1 \
--set-env-vars "DATABASE_URL=[YOUR_DATABASE_URL]"cd apps/react-native-app
npm run ios --configuration Releasecd apps/react-native-app
npm run android --variant=releasecd apps/react-native-app
npm testThe GraphQL API includes an interactive playground available at:
http://localhost:8080/
medications- Query available medications with paginationmyMedications- Get user's medication listaddMyMedication- Add a medication to user's listcreateMedicationSchedule- Set up medication schedulelogConsumption- Record medication intake
The platform uses Firebase Authentication with support for:
- Google Sign-In
- Apple Sign-In
- JWT tokens for API authentication
The app uses NFC tags to:
- Link physical medication containers to digital records
- Quick-log medication consumption by tapping the tag
- Provide a seamless user experience for medication tracking
NFC tags are written with medication-specific data and can be attached to medication bottles or packaging.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is proprietary software. All rights reserved.
Developed by Josh Nissenbaum
- NFC functionality requires physical NFC tags from ScripTag
- iOS requires specific entitlements for NFC tag reading/writing
- Android requires NFC permissions in the manifest
For issues, questions, or feature requests, please contact the development team or open an issue in the repository.
Note: This is a monorepo managed with Go workspaces. Make sure to run go work sync after pulling changes that affect Go modules.