Social connector SPA for developers based on full MERN stack.
🏠 Homepage
Full MERN stack using:
- MongoDB Atlas for back-end database
- Express for interacting with back-end server
- React for front-end
- Node for back-end web server
- Redux for store and state management
- Heroku for production hosting (if you want)
MONGO_URI="<your_mongoDB_Atlas_uri_with_credentials>"
JWT_SECRET="<your_secret_key_for_JSON_web_tokens">"
GITHUB_TOKEN="<your_secret_github_personal_access_token>"
yarn install
cd client
yarn install
yarn run dev
cd client
yarn run build
After running a build in the client 👆, cd into the root of the project. And run...
Linux/Unix
NODE_ENV=production node server.js
Windows Cmd Prompt or Powershell
$env:NODE_ENV="production"
node server.js
Check in browser on http://localhost:5000/
The package.json
file a script included for automatic post-deploy builds in Heroku.
Assuming included .env
in your .gitignore
file (you really should do this), then pushing to Heroku will omit your .env
config file from the push.
However, Heroku needs configuration variables for a successful build.
So how to get them to Heroku without commiting them to GitHub?
Easy. First have your code deploy to Heroku either by pushing it directly, or automatically pulling through a specified GitHub branch. Then just go into Heroku to your App, go into Settings
and then Config Vars
. Just like you did with the .env
file in your root folder you will need to create these same config variables. If you have different versions of your database and GitHub PATs for Production (you should), make sure to point them there.
MONGO_URI="<your_mongoDB_Atlas_uri_with_credentials>"
JWT_SECRET="<your_secret_key_for_JSON_web_tokens">"
GITHUB_TOKEN="<your_secret_github_personal_access_token>"
Now Heroku will have the config it needs to build the project.
Don't forget to make sure your production database is not whitelisted in MongoDB Atlas, otherwise the database connection will fail and your app will crash.
Contributions, issues and feature requests are welcome!
Feel free to check issues page.
Give a ⭐️ if this project helped you!
Chris Peca
1.0.0
This project is licensed under the MIT License