Skip to content

shalkauskas/life-tips-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Life Pro Tips (server)

Life Pro Tips is a full-stack app inspired by a famous subreddit /r/LifeProTips featuring usefull life hacks and tips.

Features

  • Create or like posts anonymously
  • Register or login with Google
  • Create, Read, Update or Delete posts
  • Comment, like and share you favorites
  • Change your name or profile picture in profile settings
  • Search & sort to find what you like easier

LPT is a full-stack app, with this repository containing a back-end side built with Node/Express. The front end repo can be found here.

Tech

Back-end/Server

  • node.js - evented I/O for the backend
  • Express - fast node.js network app framework
  • MongoDB - MongoDB Atlas - no-SQL Database for storing userdata and content
  • Mongoose - elegant mongodb object modeling for node.js
  • Passport - local and Google Auth

Hosted on Heroku

Front-end

  • React - state management with Context API and useReducer
  • Axios - API calls
  • Material-UI - styling and UI.
  • Cloudinary - user profile picture upload storage

Hosted on Vercel

Installation

Installation guidelines for back-end only. Front-end can be found in corresponding repo.

  1. Clone the repo
  2. npm install
  3. In root folder create a .env file and add your API keys
GOOGLE_CLIENT_ID = "google auth: found in you Google Cloud Console account"
GOOGLE_CLIENT_SECRET= "google auth: found in you Google Cloud Console account"
GOOGLE_CALLBACK_URL= "google auth: found in you Google Cloud Console account"
CORS_ORIGIN = "Front end adress for cors, default is http://localhost:8081 or wahtever port you specify in frontend .env file"
JWT_SECRET= "your secret (any string)"
SESSION_SECRET = "your secret  (any string)"
DB_URL="mongodb adress, Atlas example: mongodb+srv://DB_USERNAME:DB_PASSWORD@cluster0.ddb93.mongodb.net/YOUR_DB_NAME?retryWrites=true&w=majority"

ADMIN_ID = "database user id of user with admin priveleges: edit and delete any user post from dashboard (optional)"
  1. Then node server.js

Contribute

If you like this project and would like to contribute feel free to send a PR or simply add an issue with feature or bug fix request

License

MIT