neogcamp / mockbee Goto Github PK
View Code? Open in Web Editor NEWMock Backend Servers for your next Frontend Project!
Home Page: https://mockbee.netlify.app/
License: MIT License
Mock Backend Servers for your next Frontend Project!
Home Page: https://mockbee.netlify.app/
License: MIT License
Describe the bug
Currently, the user entered password is stored within the database as is. For security purposes, we would need to encrypt the password and then store it in the database.
Steps to fix this issue
We can make use of bcrypt
to salt and hash the password.
The Body objects in POST requests; there is some validation expected in order to provide better error messages, formatting and consistent structure.
Can use Joi
or Yup
Validations for the same.
This issue is regarding the getVideosFromPlaylistHandler()
which takes the playlistId
from the request params and returns the respective playlist.
However, the current logic of find()
gives back the playlist that does not match the playlistId
given in the params. Here is the screenshot.
This can be fixed by checking for strict equality between playlistId
and item._id
Kindly confirm.
Currently, at multiple places; this.db
reference is used. However, the schema
parameter is suggested by MirageJS to be used on priority. While Refactoring, this point can be considered.
The Documentation Site (/website
) doesn't have a proper home page. Since we now have multiple backend apps and documentation ready; it is a good time to refactor UI of the Documentation site.
The Documentation must contain:
Develop using Docusaurus 2.0
Password is not necessary to be inserted in the token. We can consider having _id and email/username for creating token. Consider removing it.
Notes App has following APIs routes:
Auth APIs:
User Routes
Advanced Guides contains topics such as:
Feel free to discuss more towards it and ask if you have any questions related to content and docs to be included.
For better configuration and linting, it is necessary to add ESLint and Prettier config.
Codebase needs a clean-up!
Presently, users can install the mockBee backend-powered apps by create-mock-backend
, but has few challenges:
Proposed Solution:
lerna
. Then, user should be able to install apps directly by npx create-react-app --template mockbee-social-media
or similar approach. Also, if user wants, user can install by create-mock-backend
and select their template which internally would do create-react-app --template selected-template
.create-mock-backend
to be a different thing as the aim to let users learn Frontend with simplicity.This Issue will be actively looked into and very available to listen to views and opinions for improvements or better approaches.
Currently there are a lot of unwanted log statements in the backend. Needs to be cleaned
First of all great job with mockbee and mockman it is a true lifesaver and words fall short of how much time and effort is saved for all neogrammers in their journey learning frontend.
I have a doubt/ suggestion to make in the docs and please read this with the lens that this might be a very stupid/ obvious this which I ( onkar ) might have missed
The generic post private api calls in the e-com page are like so
{
action: {
type: "increment";
}
}
while in actuality when writing axios calls, we have to write
{
"action": {
"type": "increment | decrement";
}
}
this , for a beginner in js like me was not obvious , as i am used to just copypasting api calls from docs ( i have minor experience using razorpay api with python django)
So my question / suggestion is this : do the docs need to be of the first type or could they be modified a bit so as to make sure beginners like us who are the target audience users could have a smoother time with them?
thanks again for all the work Soham and Nada and team put in , great work !
Onkar Deshpande neog22
Since we are going to use Axios to make calls to the backend from frontend; it is intuitive to write the backend and frontend examples considering Axios in mind.
For example;
JSON.parse() or .json() functions doesn't make sense as Axios handles it out of the box.
Describe the bug
So for installation, I followed the steps as it is written in the docs i.e
After doing this step it asked for the Project Name which i entered
After doing this step it asked for the template to which i selected ecommerce
After that I typed npm start and it did not run, the reason for that was i did not cd into my newly made project
So i figured this out and i cd into my directory, and i ran npm start and it gave me this error
So i figured this out reading the error that we also need to run npm install before running npm start. But i was not able to find this in the docs. So if we can add this in the docs it would become more beginner friendly.
This is the first issue raised by me ever, so please forgive the mistakes that i might have done in explaining the bug
For ease of contribution and bug reports/feature requests; issue templates are great way to express the problem. Can consider adding yml format.
Backend APIs:
Posts:
Users:
The PR #71 adds a new endpoint: /api/users/bookmark
. Corresponding documentation shall be added in the docsite.
The mockBee apps now use bcyrpt
for password encryption. (present at apps/project/backend/controllers/AuthController.js)
We can extend the documentation for it in the documentation site (website/)
Describe the bug
This is related to the Ecomm app, Auth controller
line:
To Reproduce
try to log in with the correct email but the wrong password.
Expected behavior
Error with status 401 should be there
Additional context
Original code looks somewhat like this
adding a return statement on line number 92 fixes the issue for me:
The Docsite can be hosted on Github Pages once the development of the first iteration is complete.
Refer Lerna and NPX packages to convert this repo to a MONOREPO.
After this, the students can install a project by:
npx neog-camp-mock-backend --template project-name
Project Management APIs will have the following routes:
Auth Routes:
Project Routes
Task Routes
Label Routes
Habit Tracker has the following routes:
Auth
Habit
Archive
Label
The project contains a lot of complex operations that requires multiple steps. For cleaner code, we can adapt utility methods provided by Lodash for our application.
The Documentation Site should have the following content:
Getting Started
Extending the app
API Documentation
Sandboxes
Need to push a .gitignore
file that contains .env
in it, so that it is not pushed to apps.
Similar to the scaffold provided by create-react-app
, we need a home page that sits in App.jsx; which contains:
Should be very similar to create-react-app and create-next-app
In few DELETE requests; the body is also passed.
Based on:
axios/axios#897
and
https://stackoverflow.com/questions/51069552/axios-delete-request-with-body-and-headers
Remove the body and add query params in the request URL itself.
The Forum App should have the following APIs
The Video Library API Routes are as follows:
Describe the bug
Because of updated ESLint rules config added in the codebase by PR #36 and some other pushes , the apps weren't able to start correctly. Until this issue is fixed and tested completely, remove ESLint from the codebase for now.
License file for defining the clarifying permissions.
Currently the process of using MockB
is to clone and take code; but the better way can be to use npx starter kit combined with Yarn Workspaces.
Refer:
https://bonsaiilabs.com/create-npx-starter-command/
https://dev.to/leopold/generate-your-web-app-boilerplate-like-create-react-app-does-301p
(add more resources if you come across)
Currently, we have api-powered templates for different projects. We can have empty-templates with folder-structure setup and let users develop mock-backend all by themselves. This can also serve for creating new mock-api for projects; we can start from here itself.
Currently the Documentation Site doesn't contain the latest installation guide. Should contain details upon how to install with create-mock-backend
Contributing File can be a good start point for developers to understand the codebase and more upon how they can contribute.
Currently create-mock-backend
doesn't have notes-app
to be downloaded option when run in terminal. We can add it to the FEATURED_TEMPLATES
array.
Line 9 in 86a7f49
The Guides Section in the Docsite contains following topics:
Need to add detailed guides for the above topics in the Guides section.
Feel free to ask if you have anything to discuss regarding the docs content and details.
The Documentation must contain:
Develop using Docusaurus 2.0
In the MongoDB database, the date-time tracking is relatively simpler. While in present case, adding date-time support will be a good feature as User would get more information about the actions on the app.
A comprehensive Readme file can help developers to understand the project better.
Can contain:
Currently the categories
and videos
/products
aren't having a DB relation between them.
We can use the hasMany()
, belongsTo()
etc. features of MirageJS in it.
The Video Library API Routes are as follows:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.