Aim of the project is to let developer start writing actual business logic right away as opposed to spend 2-3 days on wiring up different technologies and packages.
Root directory contains back and front folders which respectively contain Express.js and React.js apps. These two apps are independent and could be used separately as well.
More details about structure on the link
-
backexpressjssequelizejsonwebtoken// jwt
-
frontreactjsreact-reduxreact-router-domaxios
- Clone or download the repository
cd backnpm installcp .env.example .env// copy.env.exampleto.envand edit.envnpx sequelize-cli db:migrate// will create Users tablenpm run nodemon// starts express js server
cd frontnpm installcp .env.example .env// copy.env.exampleto.envand edit.envnpm start// starts react app
That's just it. Rest is already configured for you! Now you are good to leverage full power of awesome technologies included in the project.
- Add route in
back/routes/index.jse.x.app.get("/getUser", authorizeUser, (req, res) => { res.send("Authorized User " + req.User ) }); - Call the route from react app using axios1 e.x.
axios1.get("/getUser");- You don't have to worry about authorization, jwt token will be automatically injected in axios request and checked in routes using
authorizeUsermiddleware. - If user is authorized response will be
Authorized User { Username: "John", Email: "[email protected]", ... } - If user is not authorized response will be
Authorisation error: User isn't authorized
- You don't have to worry about authorization, jwt token will be automatically injected in axios request and checked in routes using
All kind of contributions are highly appreciated.
For a list of features that needs to be added check out the issues section.
For detailed instructions about contribution follow the link.