Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pradeep Singh : Stackoverflow | SwiggyIPP | Batch 2 #44

Open
wants to merge 37 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
a96c402
added day1 demo files
pswaldia Jan 4, 2022
738301b
ädded examples of conditionals
pswaldia Jan 4, 2022
18b0cc0
added .gitignore
pswaldia Jan 4, 2022
bb35304
Delete Day1 directory
pswaldia Jan 4, 2022
7cf0ab3
Delete .gitignore
pswaldia Jan 4, 2022
2f9ff85
updated README.md
Jan 8, 2022
9ce6340
initialised nodejs project (added .gitignore, .env)
Jan 8, 2022
2f385c2
added nodemon configuration and updated package.json
Jan 8, 2022
0ce477c
generated directory structure
Jan 8, 2022
e5c6522
added empty files and dev configuration
Jan 8, 2022
248f8ed
added complete config details
Jan 8, 2022
bccb3e3
made database connection
Jan 8, 2022
bd2b93d
added middlewares and start server script
Jan 8, 2022
9cf4280
added user model definition using mongoose
Jan 8, 2022
68cac2a
added necessary validation, sanitization to user model and added pass…
Jan 8, 2022
082fade
added logics to decode jwt token and verify it.
Jan 8, 2022
0452d67
added middleware and routes to handle signup and signin
Jan 8, 2022
2448f07
added middleware named protect to authenticate all incoming requests
Jan 8, 2022
88d4abb
added routes to getUserDetails and updateUser
Jan 8, 2022
73fc1c2
create reusable getMany and getOne method for all models
Jan 8, 2022
6671516
create reusable updateOne createOne and deleteOne method for all models
Jan 8, 2022
5644985
added question model
Jan 8, 2022
676d0f1
added question controllers and routes
Jan 8, 2022
bf0b6a6
added answers model with necessary validations
Jan 8, 2022
f54b642
added answer controllers and routes
Jan 8, 2022
f9c5656
attached routers to app.
Jan 8, 2022
40f8ead
added start server mechanism to index.js: our starting point
Jan 8, 2022
3a78a90
feat(): added custom logging support for logging to console
Jan 8, 2022
5b060cc
added timestamp with custom format to logger
Jan 8, 2022
9cfa67b
added colorization to logger
Jan 8, 2022
4d6db09
added logging in different crudControllers
Jan 8, 2022
a1d77fd
fixed a minor bug related to payload decoding of JWT
Jan 9, 2022
cd837fe
added few more conditions to ensure a user cannot answer a question m…
Jan 9, 2022
338491e
added changes to remove undesired columns in the output body
Jan 9, 2022
5402821
added logging information in remaining routes and controllers
Jan 9, 2022
0127b93
updated readme with features information
Jan 9, 2022
164bb90
refactoring and readme update
Jan 9, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 37 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,37 @@
# batch-2
# Batch 2 : Swiggy i++
### StackOverflow APIs

### Tech Stack :
1. NodeJs
2. Express
3. MongoDB
4. Robo3T (GUI for mongodb)
5. Postman (REST API client)
6. Winston (logging package)
7. MongoDB Atlas (for production DB)
8. Heroku (Deployment)
9. Swagger (API Documentation)

### Features :
1. Allows users to signup by providing needed information.
2. Allows users to sign in by providing valid credentials.
3. Authorization and Authentication using [Json Web Tokens](https://jwt.io).
4. Users can view their details as well as update it.
5. Allows users to perform CRUD operation on __Question__ model.
- Users can ask question.
- Users can update the question.
- Users can delete the question.
- Users can get all the answers they have asked.
6. Allows users to perform CRUD operation on __Answer__ model.
- Users can answer a particular question.
- Users can edit the answer for a particular question.
- Users can delete the answer.
- Users can get all the answers they have contributed.
7. Protection of routes using json web token.
8. Logging using [winston](https://www.npmjs.com/package/winston) package.

![](https://imgur.com/3HzhQdj.png)

9. API documentation using [Swagger](https://swagger.io/).
10. Support for deployment using [mongodb atlas](https://www.mongodb.com/cloud/atlas/lp/try2?utm_source=google&utm_campaign=gs_apac_india_search_core_brand_atlas_desktop&utm_term=mongo%20atlas&utm_medium=cpc_paid_search&utm_ad=e&utm_ad_campaign_id=12212624347&adgroup=115749713263&gclid=CjwKCAiArOqOBhBmEiwAsgeLmRXwKDIvJkBFoeJVfubwj1ZQPba2OXBtX5pYFGiTlwr8vw8tfRq5bhoCfZkQAvD_BwE) and [heroku](https://dashboard.heroku.com/).

2 changes: 2 additions & 0 deletions stackoverflow.com/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
.env
24 changes: 24 additions & 0 deletions stackoverflow.com/nodemon.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"restartable": "rs",
"ignore": [
".git",
"node_modules/**/node_modules",
"dist"
],
"verbose": true,
"execMap": {
"js": "node"
},

"runOnChangeOnly": false,
"watch": [
"src/**/*.js",
"src/**/*.graphql",
"src/**/*.gql"
],
"env": {
"NODE_ENV": "development"
},
"ext": "js,json,graphql"
}

Loading