A full-stack mobile application boilerplate for rapidly building cross-platform apps with React Native (Expo) and Node.js/Express backend. Features authentication, subscriptions, blockchain integration, and cloud services out of the box.
This starter template provides a production-ready foundation for building subscription-based mobile applications with:
- Client: React Native mobile app built with Expo SDK 49
- Server: Express.js REST API with MongoDB database
- Authentication: Email/password, Google OAuth, and Solana wallet sign-in
- Payments: Stripe integration with subscription management
- Blockchain: Solana Mobile Wallet Adapter integration
- Cloud Services: AWS S3 (file storage) and SES (email)
- Framework: React Native 0.72.10 with Expo SDK 49
- Language: TypeScript
- Blockchain: Solana Web3.js, Solana Mobile Wallet Adapter
- Build Tool: EAS (Expo Application Services)
- Runtime: Node.js 18+
- Framework: Express.js
- Database: MongoDB with Mongoose ODM
- Authentication: JWT, Google OAuth, bcrypt
- Payments: Stripe API
- Cloud Storage: AWS S3 (via multer-s3)
- Email: AWS SES
- Scheduling: node-cron
Before you begin, ensure you have:
- Node.js 18 or higher
- npm or yarn
- MongoDB (local or MongoDB Atlas account)
- Expo CLI:
npm install -g expo-cli - EAS CLI (optional, for builds):
npm install -g eas-cli
To use all features, you'll need accounts for:
- MongoDB Atlas - Database hosting (free tier available)
- Stripe - Payment processing
- Google Cloud Console - OAuth authentication
- AWS - S3 storage and SES email services
- Expo - Mobile app builds and deployment
bootstrap-react-native/
├── client/ # React Native mobile app
│ ├── components/ # React components
│ ├── config/ # Environment configuration
│ ├── constants/ # App constants
│ ├── hooks/ # Custom React hooks
│ ├── types/ # TypeScript definitions
│ ├── utils/ # Utility functions
│ ├── android/ # Android native project
│ ├── App.tsx # Main app component
│ ├── EntryApp.tsx # Entry point
│ ├── app.json # Expo configuration
│ └── package.json # Dependencies
│
└── server/ # Express.js backend
├── controllers/ # Request handlers
├── db/ # Database connection
├── models/ # Mongoose models
├── routes/ # API routes
├── services/ # Business logic
├── utils/ # Utilities
├── server.js # Entry point
└── package.json # Dependencies
# Clone the repository
git clone <your-repo-url>
cd bootstrap-react-native
# Install server dependencies
cd server
npm install
# Install client dependencies
cd ../client
npm installcd server
# Copy environment template
cp .env.example .env
# Edit .env with your credentials
nano .env # or use your preferred editorRequired environment variables:
# Server basics
PORT=5001
NODE_ENV=development
SECRET_KEY=<generate-strong-random-key>
# Database
ATLAS_URI=mongodb+srv://username:password@cluster.mongodb.net/
DB_NAME=bootstrap_app
# Stripe (get from https://dashboard.stripe.com/apikeys)
STRIPE_SECRET_KEY=sk_test_...
STRIPE_WEBHOOK_SECRET=whsec_...
# Google OAuth (get from https://console.cloud.google.com/)
GOOGLE_CLIENT_ID=...apps.googleusercontent.com
GOOGLE_CLIENT_SECRET=...
# AWS (for S3 and SES)
AWS_ACCESS_KEY_ID=...
AWS_SECRET_ACCESS_KEY=...
S3_ACCESS_KEY=...
S3_ACCESS_SECRET=...
AWS_REGION=us-east-1
AWS_SES_FROM_EMAIL=noreply@yourdomain.comcd client
# Update server URL in config/environment.ts
# Edit the SERVER_URL for both development and productionUpdate client/config/environment.ts:
- Production: Replace
https://your-app.onrender.comwith your deployed server URL - Development: Replace
http://localhost:5001with your local IP for mobile testing (e.g.,http://192.168.1.100:5001)
Terminal 1 - Server:
cd server
npm run dev # Starts on port 5001 with nodemonTerminal 2 - Client:
cd client
npx expo startScan the QR code with:
- iOS: Camera app or Expo Go
- Android: Expo Go app
- Create account at https://cloud.mongodb.com/
- Create a new cluster (free tier available)
- Create database user with password
- Whitelist your IP address (or use 0.0.0.0/0 for development)
- Get connection string and add to
ATLAS_URIin.env
# Install MongoDB locally
# macOS:
brew tap mongodb/brew
brew install mongodb-community
# Start MongoDB
brew services start mongodb-community
# Update .env
ATLAS_URI=mongodb://localhost:27017/- Sign up at https://stripe.com/
- Get API keys from Dashboard → Developers → API keys
- Add
STRIPE_SECRET_KEYto.env - Set up webhook endpoint:
- URL:
https://your-server.com/api/stripe/webhook - Events:
customer.subscription.created,customer.subscription.updated,customer.subscription.deleted,invoice.payment_succeeded
- URL:
- Add webhook secret to
STRIPE_WEBHOOK_SECRET
- Go to https://console.cloud.google.com/
- Create new project
- Enable Google+ API
- Create OAuth 2.0 credentials
- Add authorized redirect URIs
- Add credentials to
.env
S3 (File Storage):
- Create S3 bucket
- Create IAM user with S3 permissions
- Add access keys to
.env
SES (Email):
- Verify email address or domain in SES
- Request production access (starts in sandbox)
- Use same IAM credentials
Edit client/app.json:
{
"expo": {
"name": "Your App Name",
"slug": "your-app-slug",
"owner": "your-expo-username",
"ios": {
"bundleIdentifier": "com.yourcompany.yourapp"
},
"android": {
"package": "com.yourcompany.yourapp"
}
}
}# Login to Expo
npx eas login
# Configure EAS
npx eas build:configure
# Build for development
npx eas build --profile development --platform androidFor detailed Android build instructions, see client/BUILD.md.
POST /api/auth/register- User registrationPOST /api/auth/login- Email/password loginPOST /api/auth/google- Google OAuth loginPOST /api/auth/solana- Solana wallet authenticationPOST /api/auth/verify-email- Verify email addressPOST /api/auth/forgot-password- Request password resetPOST /api/auth/reset-password- Reset password with token
GET /api/subscriptions- List subscription plansPOST /api/subscriptions- Create subscriptionGET /api/subscriptions/user/:userId- Get user subscriptionPUT /api/subscriptions/:id- Update subscriptionDELETE /api/subscriptions/:id- Cancel subscription
GET /api/user/:id- Get user profilePUT /api/user/:id- Update user profileGET /api/user/:id/transactions- Get token transactions
POST /api/stripe/webhook- Stripe webhook handler
# Server tests (add your test framework)
cd server
npm test
# Client tests
cd client
npm test# Client linting
cd client
npm run lintNever commit .env files or secrets to git. Use:
server/.env.exampleas templateclient/config/environment.example.tsas template
- Set all environment variables in hosting dashboard
- Ensure
NODE_ENV=production - Set up MongoDB Atlas connection
- Configure Stripe webhook with production URL
- Deploy from GitHub repository
cd client
# Build for production
npx eas build --platform android --profile production
npx eas build --platform ios --profile production
# Submit to stores
npx eas submit --platform android
npx eas submit --platform ios- Never commit secrets - Use
.envfiles and.gitignore - Use strong JWT secrets - Generate with
openssl rand -base64 32 - Enable HTTPS - Always use SSL in production
- Validate input - Sanitize all user inputs
- Rate limiting - Implement API rate limits
- Keep dependencies updated - Run
npm auditregularly - Environment separation - Use different keys for dev/prod
- Use your computer's local IP address, not
localhost - Ensure both devices are on same network
- Check firewall settings
- Verify webhook URL is publicly accessible
- Check webhook secret matches
.env - Review Stripe dashboard logs
- Whitelist IP address in MongoDB Atlas
- Check connection string format
- Verify network connectivity
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Open a Pull Request
MIT License - see LICENSE file for details
For issues and questions:
- Open an issue on GitHub
- Check existing documentation
- Review the CLAUDE.md file for development guidance
Built with React Native, Express, and modern cloud services. Start building your app today!