A work in progress.
- react-router-dom:
- auth0-
The example endpoint for the API is localhost:4242/things. You can hit this with curl for testing or do it with React. It is recommended to use Axios and therefore is installed, but you could equally use any package or the FetchAPI. When getting data to hold in the state, the request goes into the componentDidMount() method of a stateful React component. See ./src/pages/Home.js for the example using Axios.
Using react router, see ./src/pages/Home.js for the example stateful component.
Your credentials need to go into a .env file in for the backend: ./express-api/.env
# Settings for the api
PORT=4242
# Mongo Atlas Settings
ATLAS_CREDENTIALS=<user>:<password>
ATLAS_URL=<your subdomain>.mongodb.net/
# Redis Enterprise Cloud Settings
REDIS_HOST=<subdomain>.redislabs.com
REDIS_PORT=<port>
REDIS_PASSWORD=<pass>
# JWT & other Auth Settings
JWT_KEY=vulnerableKey
Run this command in both express-api and react-client directories
> npm i && npm start
GET Request to get all the things in the mongodb
curl localhost:PORT/things
POST Request to make a new thing in the mongodb
curl -X POST localhost:PORT/things -H 'Content-Type: application/json' -d '{"thingName": "somenewthingy"}'
DELETE Request to delete one thing in the mongodb:
curl -X DELETE localhost:PORT/things
npm i --save --save-exact react-scripts@latest
* Check changelog for create-react-app
npm i fsevents@latest -f --save-optional
2 Servers: React Frontend and Node/Express API Primary datastore: Mongo Backend for managing users and content Frontend for delivering content to users and trainee administration TMS example of commercial product https://www.arlo.co/training-management-system Mongo, Express, React, Node
- Babel in the backend as well so you can use proper ES6 features such as import and export default class key words.
- Mongo Atlas connection script
- Create React App prebuilt
- custom script to do create-react-app and hook it up to backend - so it keeps the install of React fresh
- other scripts for cooking custom stacks attributes