Skip to content

befriend-app/befriend-backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Befriend Logo

Befriend App (Backend)

A real-time experience for meeting new and existing friends in person.

Setup Video (15 minutes)

Befriend Backend & Frontend Setup Video

Prerequisites

Ensure you have the following installed on your machine:

Installation Steps

Note: Initial setup takes 8-12 minutes to complete and requires approximately 2.2GB of memory.

a. git clone https://github.com/befriend-app/befriend-backend.git

b. cd befriend-backend

c. npm install

d. cp .env.example .env

e. Open environment file

f. Database configuration

DB_CLIENT=
DB_HOST=
DB_NAME=
DB_USER=
DB_PASSWORD=
DB_PORT=

g. Run the setup

node setup

These keys are used for identifying your network. A unique network token is automatically generated when your server runs for the first time.

ADMIN_NAME=""
ADMIN_EMAIL=
NETWORK_NAME="<YOUR_NETWORK_NAME>"
NETWORK_API_DOMAIN=<YOUR_API_DOMAIN>
NETWORK_LOGO=<YOUR_LOGO_URL>
NETWORK_APP_ICON=<YOUR_APP_ICON_URL>

Befriend uses Foursquare for displaying places and maps activity types to Foursquare categories to power our activity creation user experience.

a. Go to developer.foursquare.com

b. Click get started for free (no credit card required)

c. Create account

d. Verify email

e. Enter profile information

f. Click create a new project

g. Click Generate API Key

h. Set environment variable:

FSQ_KEY=

Mapbox is used for rendering maps and calculating travel estimates in Befriend to ensure users can arrive on time to selected places.

a. Go to mapbox.com

b. Click get started for free (no credit card required)

c. Create account

d. Verify email

e. Enter billing

f. Click tokens (under Admin in left pane)

g. Click Create a token

h. Enable all scopes

i. Set environment variables:

MAPBOX_USER=

  • Use your Mapbox account username

MAPBOX_SECRET_KEY=

SendGrid is used for sending email verification codes during the signup and login process.

a. Go to sendgrid.com

b. Click Start for free (no credit card required)

c. Sign up

d. Verify email

e. Verify phone

f. Enter company information

g. Authenticate domain

  • Enter your domain
  • Re-brand links for this domain
    • Click Yes
  • Add DNS records

h. Create new sender

  • Click Create sender identity
    • Enter information

i. Create API key

  • Click API Keys
  • Click Create API Key

j. Set environment variables:

SENDGRID_KEY=

Set this key to the address used to create your sender identity.

EMAIL_FROM='Your App Name <[email protected]>'

Note: Apple Developer account required.

Used for sending notifications to users on iOS devices.

a. Enable Push Notifications Capability

  1. Login at developer.apple.com

  2. Navigate to Identifiers

  3. Create a new identifier (or select existing)

  4. Open your app identifier

  5. Enable Push Notifications capability

b. Create Private Key

  1. Click the + button next to Keys

  2. Create a key name

  3. Check Apple Push Notifications service

  4. Click Configure

  5. Select Sandbox & Production

  6. Click Save

  7. Click Continue

  8. Click Register

  9. Click Download to save the private key file

c. Configure Environment Variables

Set the following environment variables in your .env file:

APPLE_APP_ID=
APPLE_KEY_ID=
APPLE_TEAM_ID=
APPLE_PRIVATE_KEY=""

Variable Descriptions

  • APPLE_APP_ID: Your app's Bundle Identifier (e.g., com.yourcompany.yourapp)
  • APPLE_KEY_ID: The Key ID from your Push Notifications certificate
  • APPLE_TEAM_ID: Your 10-character Apple Team ID
  • APPLE_PRIVATE_KEY: The complete content of your downloaded private key file (paste between quotes)

a. Clone repository

git clone https://github.com/befriend-app/befriend-app

b. Navigate to directory

cd befriend-app

c. Install packages

npm install -g cordova
npm install cordova-icon -g
npm install

d. Add platforms

cordova platform add ios@7
cordova platform add android@12

e. Install OS requirements

node scripts/install/ios.js
node scripts/install/android.js

f. Run development server

When the app is built with the --dev flag, app.js and styles.css is loaded from a local server as opposed to from the device. This allows for much quicker development without having to rebuild the app each time.

node scripts/dev/serve.js

g. Build app

Production

node scripts/build/device.js

Development

node scripts/build/device.js --dev http://localhost:3010 --api http://localhost:3000 --ws ws://localhost:8080

Option Description
--dev Frontend development server host
--api Backend server host
--ws Websocket server host
--ios Build for iOS only
--android Build for Android only

h. Open Platform Project

  • iOS
    • Open Xcode
    • Open project folder
      • befriend-app/platforms/ios
  • Android
    • Coming soon

Backend

a. Start Backend Servers

cd befriend-backend
node servers

App

b. Run Device 1

Launch the first device/simulator for testing.

c. Run Device 2

Launch the second device/simulator for testing multi-user functionality.

Create Test Users

d. Signup User 1

Create the first test user account on device 1.

e. Signup User 2

Create the second test user account on device 2.

Sender

  • Select activity type
  • Choose place
  • Send

Receiver

  • Set availability (optional)
  • Receive invitation
  • Accept

OAuth Setup

Enable users to sign up and log in using their Apple ID.

Enable users to sign up and log in using their Google account.

Support us

Users

  1. Sign up - Go to befriend.app
  2. Spread the word - Ask friends, family, and social media followers to sign up

Developers

  1. Run own network - Join the Befriend network and bring real-time in-person friends to your area or community with your own brand name and logo
  2. Contribute code - Clone our repositories, submit pull requests, implement new features, and fix bugs
  3. Report issues - Help us improve by reporting bugs and suggesting features

Organizations

  1. Become a sponsor - Email us at [email protected]

Our sponsors

Gen AI Wear

Create unique custom apparel at genaiwear.com

About

Befriend Backend: real-time in person network of apps for new and existing friends.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •