This guide explains how to set up a new NGX-Ramblers environment for a Ramblers group, covering all required services, credentials, and configuration options.
The environment setup feature automates the provisioning of new NGX-Ramblers group instances. It orchestrates:
Two interfaces are available:
Before starting, ensure you have accounts and access to:
| Service | Purpose | Sign-up URL |
|---|---|---|
| MongoDB Atlas | Database hosting | https://www.mongodb.com/cloud/atlas/register |
| AWS | S3 storage for media files | https://aws.amazon.com/ |
| Fly.io | Application hosting | https://fly.io/app/sign-up |
| Brevo | Transactional email | https://www.brevo.com/free-signup/ |
| Ramblers | Walks Manager API access | Contact Ramblers IT |
| Service | Purpose | Sign-up URL |
|---|---|---|
| Google Cloud | Maps, Places, and Geocoding APIs | https://console.cloud.google.com/ |
| Ordnance Survey | UK mapping tiles | https://osdatahub.os.uk/ |
| Social events integration | https://developers.facebook.com/ | |
| Meetup | Event synchronisation | https://www.meetup.com/api/oauth/list/ |
| reCAPTCHA | Form spam protection | https://www.google.com/recaptcha/admin |
Contact Ramblers IT to obtain:
cluster0.abc123)Required values:
.mongodb.net)ngx-ramblers-mygroup)For automated bucket creation, you need AWS admin credentials. Alternatively, create the bucket manually.
For automated setup, provide:
AWS_ACCESS_KEY_ID — Admin access keyAWS_SECRET_ACCESS_KEY — Admin secret keyAWS_REGION — Region (default: eu-west-1)For manual setup, create:
ngx-ramblers-{groupname}curl -L https://fly.io/install.sh | shfly auth loginFor Facebook social events integration:
Required values:
FACEBOOK_APP_ID — Application IDFACEBOOK_APP_SECRET — Application secretFor Meetup event synchronisation:
https://yourdomain.com/api/meetup/oauth/callbackRequired values:
MEETUP_OAUTH_KEY — OAuth consumer keyMEETUP_OAUTH_SECRET — OAuth consumer secretNGX-Ramblers uses multiple Google Cloud APIs. You need a single API key with access to:
Required APIs to enable:
Setup steps:
Required value:
GOOGLE_MAPS_APIKEY — Single API key for all Google servicesBilling note: Google Cloud requires a billing account, but provides a generous free tier ($200/month credit) that covers most small group usage.
If you're managing multiple group environments, set up a master AWS account with delegated access.
Create an IAM user for environment provisioning:
User name: ngx-ramblers-provisioner
Access type: Programmatic access
Attach a custom policy allowing S3 and IAM operations:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"s3:CreateBucket",
"s3:PutBucketCors",
"s3:PutBucketPolicy",
"s3:PutPublicAccessBlock"
],
"Resource": "arn:aws:s3:::ngx-ramblers-*"
},
{
"Effect": "Allow",
"Action": [
"iam:CreateUser",
"iam:CreateAccessKey",
"iam:PutUserPolicy",
"iam:AttachUserPolicy"
],
"Resource": "arn:aws:iam::*:user/ngx-ramblers-*"
}
]
}
Store the access credentials securely (e.g., in a password manager)
The setup process creates:
ngx-ramblers-mygroup-user)This ensures each environment has isolated credentials that can be rotated independently.
The setup wizard creates:
For migrating an existing group:
Export the source database:
mongodump --uri="mongodb+srv://user:pass@cluster.mongodb.net/source-db" --out=./backup
Import to the new database:
mongorestore --uri="mongodb+srv://user:pass@cluster.mongodb.net/new-db" ./backup/source-db
Update configuration documents with new credentials (AWS, Brevo, etc.)
Use MongoDB Atlas's built-in backup/restore:
config collectioncd server
npx tsx deploy/create-environment-cli.ts
AWS Credentials (optional)
Ramblers API Key
Group Selection
01SURREY)01 for Surrey)Environment Configuration
MongoDB Configuration
AWS S3 Configuration
Email Configuration
Optional Services
Admin User
Setup Options
The wizard creates:
| File | Purpose |
|---|---|
non-vcs/secrets/secrets.{appName}.env |
Environment variables |
non-vcs/fly-io/configs.json |
Fly.io deployment config |
After running the setup wizard:
Create the Fly.io app:
fly apps create ngx-ramblers-mygroup --org personal
Import secrets:
fly secrets import < non-vcs/secrets/secrets.ngx-ramblers-mygroup.env -a ngx-ramblers-mygroup
Deploy:
fly deploy -a ngx-ramblers-mygroup
Verify:
fly status -a ngx-ramblers-mygroup
fly logs -a ngx-ramblers-mygroup
| Variable | Required | Description |
|---|---|---|
NODE_ENV |
Yes | Set to production |
MONGODB_URI |
Yes | Full MongoDB connection string |
AUTH_SECRET |
Yes | 32-byte secret for JWT signing |
AWS_ACCESS_KEY_ID |
Yes | S3 access key |
AWS_SECRET_ACCESS_KEY |
Yes | S3 secret key |
AWS_BUCKET |
Yes | S3 bucket name |
AWS_REGION |
Yes | S3 region |
GOOGLE_MAPS_APIKEY |
No | Google Maps API key |
FACEBOOK_APP_ID |
No | Facebook application ID |
FACEBOOK_APP_SECRET |
No | Facebook application secret |
MEETUP_OAUTH_KEY |
No | Meetup OAuth consumer key |
MEETUP_OAUTH_SECRET |
No | Meetup OAuth consumer secret |
DEBUG |
No | Debug logging pattern |
.mongodb.net)fly logs -a appnamefly secrets list -a appnamefly status -a appname