Repository
https://github.com/utopian-io/review.utopian.io
New Projects
- What is the project about?
This project was made to make Utopian reviews easy by providing a questionnaire and to maintain the transparency of the review it generates a result of the questionnaire for the contributors to check out.
One of the interesting parts was to not use a database for storing the answers to the questionnaire and allow users to know the answers to it without it.
For it, I made a route which can generate a reviews answer page based on the URL.
router.get('/result/:cat/:num', function (req, res, next) {
let category = req.params.cat;
let ans = req.params.num;
if(category < 0 || category > 11)
res.render('error')
cat = questionnaire[category];
let object= [];
for (var i = 0; i < cat.length; i++) {
obj = {};
obj.question = cat[i].question;
obj.answer = cat[i].answers[ans.charAt(i)]
object.push(obj)
}
console.log(object);
res.render('result', {object: object})
})
This route handles the URL and makes a result object and passes to template.
That result object is server side rendered and sent to browser.
Some screenshots of the webapp are attached below -
Home Page
Auto Generated Comment
Reviews Result Page
Technology Stack
If any app can be made in JS it will always be made in JS :P
- NodeJS
- ExpressJS
- EJS
How to contribute?
I am not sure about the future plans of this project but I just turn to add features to it as mods and CMs may ask me to do so ;)