Got questions? Send me an email: Send Mail
Unsplash API - used to get random pictures
Node packages used in this project:
Backend:
- jsonwebtoken - secure communication between frontend and backend
- bcryptjs - password encryption
- cors - an Express middleware that can be used to enable CORS
- mongoose - MongoDB object modeling tool designed to work in an asynchronous environment
- axios - Promise based HTTP client for the browser and node.js(alternative to fetch)
Frontend:
- react-moment - React component for the moment date library. Parse, validate, manipulate, and display dates and times in JavaScript
- react-confetti - Confetti without the cleanup
- react-image-puzzle - React component for simple swap tile puzzle out of an image
- react-toastify - React-Toastify allow you to add notification to your app with ease
- react-webcam - Webcam component for React
- semantic-ui-react - React version of Semantic UI framework
Available routes: \
! Token generated whenever user logins or registers. By default token doesn't have expiration date
- GET
/randompic
- returns JSON of random picture from Unsplash API (Access key is required to use this API)/gallery/:token
- returns JSON with pictures from MongoDB for registered user. Token is used for validation on backend
- POST
/savepicture
- saves picture in DB and returns that picture JSON/savephoto
- saves photo from Photobooth component/login
- handles login and returns JSON Web Token and stores it inlocalstorage
of the browser/register
- creates user in DB, returns JSON Web Token and stores it inlocalstorage
of the browser
- PUT
/updatestatus
- changes status of a picture in DB
- DELETE
/deletepicture/:token/:id
- deletes picture from DB
- Fork and clone both repos
- Install all dependencies (type
npm install
in respective directories) - Create
.env
file in the root of backend folder.env
file holds all values that you want to hide from the user.- Populate file with following:
JWT_SECRET = 'any string'
MONGODB_URI = 'path to your MongoDB storage'
ACCESS_KEY = 'Access key from Unsplash'
- Now start both servers by typing
npm start
in both backend and frontend