This is an example web application written in React to demonstrate basic account feature with MongoDB. You can create an account and sign in with email or tokens.
Original git repo: https://github.com/kouohhashi/react_mongo_accounts.git (Note that i have change some parts so please use this version as example)
brew tap mongodb/brew
brew install mongodb-community
mkdir mongodb_data (Not a must)
mongod --dbpath mongodb_data/ (Not a must)
mongo
use admin
db.createUser(
{
user: "user1",
pwd: "!S3434fdP?2?9EKWsd",
roles: [ { role: "userAdminAnyDatabase", db: "admin" } ]
}
)
exit
(I have used this a lot. Saved me a lot of time) https://www.mongodb.com/try/download/compass
git clone https://github.com/nativecoders-se/UserLogin-React-MongoDB.git
cd react_mongo_accounts
npm install
API server is going to start on port 4002 You can change parameters around mongodb at ./server/routes/settings.js
npm run start_server
React is going to start on port 3000
npm run start_react
You can check at http://localhost:3000