Coder Social home page Coder Social logo

hotncold-server's Introduction

Hot&Cold (Server)

The backend for the social app Hot&Cold.

Setup

Configure the following services:

You will need to add PostGIS extension to PostgresSQL to enable geo spatial indexing and querying. On Heroku, the extension is already installed out of the box and you only need to enable it with CREATE EXTENSION postgis; (See reference).

Define environment variables in .env file (NEVER COMMIT):

# Cloudinary API URL
CLOUDINARY_URL
# Database URL, template:
# postgres://user:password@host:port/dbname
DATABASE_URL
# Access token given by MapBox's API
MAPBOX_ACCESS_TOKEN
# Auth secret for JWT
AUTH_SECRET
# Twilio account SID
TWILIO_ACCOUNT_SID
# Twilio auth token
TWILIO_AUTH_TOKEN
# Skip SMS messaging
TWILIO_SKIP
# One time passcode timeout in milliseconds
OTP_TIMEOUT
# Firebase-admin related credentials. See https://firebase.google.com/docs/reference/admin/node/admin.credential
FIREBASE_PROJECT_ID
FIREBASE_CLIENT_EMAIL
FIREBASE_PRIVATE_KEY
FIREBASE_DB_URL
# How long a status chat is gonna live once created
STATUS_TTL
# How long will authentication token last (in seconds)
AUTH_TTL
# An extra margin to subtract from queries which run against the status expiration date (ms). Higher value will result in more statuses.
STATUS_EXPR_MARGIN
# *Optional: Server port. Defaults to 8000
PORT
# *Optional: Server host. Defaults to 0.0.0.0
HOST

Alternatively, you can define these variables in Heroku's dashboard.

Install dependencies:

$ yarn

In a new environment, migrate DB schema changes:

$ yarn migrate

Be sure to define a polygon of your city of choice if you want it to be supported in the app.

Dev

Start the API:

$ yarn start

Test

To create test-data you can use the run seeder files in src/seeders:

$ yarn sequelize db:seed --seed <filename>

Prod

Push to Heroku and pray:

$ git push heroku master

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.