Skip to content

Latest commit

 

History

History
107 lines (77 loc) · 2.74 KB

README.md

File metadata and controls

107 lines (77 loc) · 2.74 KB

Circle Community Social App - MERNG Stack

MERNG stands for MongoDB, Express, React, Node.js & GraphQL. This is a simple social app which user may comment or like on other users post. Demo Site

Disclaimer:

Full source codes(server/client) from a youtube tutorial, which you may visit his youtube channel at

Server | Client

If you found his tutorial useful, please consider to support him by becoming patreon at https://www.patreon.com/classsed

I have made some modifications in order to deploy to heroku

  • Turn config.js into using dotenv file
  • Use apollo-server-express instead of apollo-server to serve static files from client
  • Change the graphql path from / to /graphql
  • Modify some variable and file names which don't affect any functionalities

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

Make sure you have all the requirements installed

- A MLab, Mongo Atlas or local Mongo instance is required
- Node.js installed

Installing

Clone this git repo

# Open a terminal
git clone [email protected]:oldwolf/merng.git
yarn install

cd client
yarn install

# Note: graphql playground path is changed to http://localhost:5000/graphql

Create a new '.env' file under your root folder, paste the following code into it and change the MONGO_URI to whatever your mongo instance will be, and SECRET_KEY to whatever the key you want

MONGO_URI='mongodb://db_username:db_password@db_url:db_port/db_name'
SECRET_KEY='TopSecretDontLetOtherPeopleKnow'
PORT=5000
SMTP_SERVICE='qq'
SMTP_HOST='smtp.qq.com'
SMTP_PORT=587
SMTP_SECURE=false
SMTP_USER='[email protected]'
SMTP_PASS='zhzksz*****ubeac'

For example:

MONGO_URI='mongodb://localhost/group'
SECRET_KEY='TopSecretDontLetOtherPeopleKnow'
PORT=5000
SMTP_SERVICE='qq'
SMTP_HOST='smtp.qq.com'
SMTP_PORT=587
SMTP_SECURE=false
SMTP_USER='[email protected]'
SMTP_PASS='zhzksz*****ubeac'

Up and Running

# Open a terminal, at the root folder
yarn start:dev

# Open another terminal
cd client
yarn start

Deploy to heroku

You must have heroku toolbelt installed before continue

# Open a terminal, at the root folder
heroku login
heroku create

git add .
git commit -am "Whatever message"
git push heroku master

heroku config:set MONGO_URI=mongodb://db_username:db_password@db_url:db_port/db_name
heroku config:set SECRET_KEY=TopSecretDontLetOtherPeopleKnow

heroku open