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
-
back
expressjs
sequelize
jsonwebtoken
// jwt
-
front
reactjs
react-redux
react-router-dom
axios
- Clone or download the repository
cd back
npm install
cp .env.example .env
// copy.env.example
to.env
and edit.env
npx sequelize-cli db:migrate
// will create Users tablenpm run nodemon
// starts express js server
cd front
npm install
cp .env.example .env
// copy.env.example
to.env
and edit.env
npm 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.js
e.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
authorizeUser
middleware. - 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.