🍳 This is a boilerplate to quickly setup a webapp using MongoDB, Express, React and Node.
🤖 Currently, it holds a basic CRUD configuration where a user can add, update, view or delete a book.
🔑 Signup and Login have been provided.
👮 Frontend protected routes and authorisation on backend routes have been provided too.
⚙️ Conditional rendering based on user authentication.
Checklist
✅ Ready to go!
Instructions
-
Before cloning and launching, please create a MongoDB account as well as a Cloudinary account to obtain your api keys.
-
Clone repo
-
Create .env files and populate them like so
.env in root of server folder
DATABASE_ACCESS=put-your-mongodb-access-url-here
CLOUDINARY_URL=put-your-cloudinary-access-url-here
CLOUD_NAME=put-your-cloudinary-name-here
CLOUD_API_KEY=put-your-cloudinary-api-key-here
CLOUD_API_SECRET=put-your-cloudinary-api-secret-here
.env in root of client folder
REACT_APP_CLOUDINARY_USERNAME=your-cloudinary-user-name-here
REACT_APP_CLOUDINARY_PRESET="your-preset-name-in-betwen-these-quotes"
-
cd server,
npm install
and thennpm start
-
cd client,
npm install
and thennpm start
Working with MongoDB
Make sure to include your IP address of your workplaces in the MongoDB dashboard.
For development purposes, you can also set MongoDB to accept requests from any IP address to avoid confusion when working from different places.