Boo Backend is a versatile application designed to facilitate the creation of user accounts, comments, and the ability to like or dislike comments with ease and efficiency. This robust platform provides a seamless user experience for managing interactions within the system.
- Creating a new User Profile
- You can do comments and likes, unlikes
- Relationships Comments with profileID.
- Error Handling.
- Node.js
- MongoDB
- Mocha (For unit testing)
git clone https://github.com/Amanmandal-M/boo_world.git
- Javascript
- NodeJS
- MongoDB
cd boo_world
npm run start
npm run start
or
npm run server
or
node app.js
├── app.js
├── configs
| └── db.js
├── models
| └── profileModel.js
| └── commentModel.js
├── routes
| └── profile.js
| └── comment.js
├──controllers
| └── profile.js
| └── comment.js
| └── HomePageController.js
├──views
| ├──partials
| | └── categories.ejs
| | └── epilogue.ejs
| | └── footer.ejs
| | └── header.ejs
| | └── metadata.ejs
| | └── profile_card.ejs
| | └── prologue.ejs
| | └── scripts.ejs
| | └── styles.ejs
| └──profile_template.ejs
├──helpers
| └── successAndError.js
├──public
| ├── static
| | └── space.png
| | └── wing.png
| ├── sample.md
Note :
- Before doing anything first create
.env
file and putPORT
,NODE_ENV, MONGO_URI
. - If you are not using
MONGO_URI
so don't worry it will run automatically using mongoDB-memory-server PORT
is for listening the server.MONGO_URL
is for running database and store your data in database so put your mongo link.NODE_ENV
is for accessing database for test and it is like a authentication but not full authentication .
Models | Method | Endpoint | Description | Status Code |
---|---|---|---|---|
Profile | POST | /profile/ | This endpoint should allow to create a new Profile and store in database. | 200 |
Profile | Get | /profile/:id | This endpoint should allow to view profile by its id. | 200 |
Comment | GET | /comment/ | This endpoint should allow to view all comments with profileId. | 200 |
Comment | GET | /comment/:profileId | This endpoint should allow to view comments by profileId. | 200 |
Comment | POST | /comment/ | This endpoint should allow to create a new comment using profileId. | 200 |
Comment | POST | /like/:commentId | This endpoint should allow to like comments by commentId. | 200 |
Comment | POST | /unlike/:commentId | This endpoint should allow to unlike comments by commentId. | 200 |
{
name: {
type: String,
required: true,
},
description: {
type: String,
required: true,
},
mbti: {
type: String,
required: true,
},
enneagram: {
type: String,
required: true,
},
variant: {
type: String,
required: true,
},
tritype: {
type: Number,
required: true,
},
socionics: {
type: String,
required: true,
},
sloan: {
type: String,
required: true,
},
psyche: {
type: String,
required: true,
},
image: {
type: String,
required: true,
},
}
{
profileId: {
type: mongoose.Schema.Types.ObjectId,
ref: 'Profile'
},
author: {
type: String,
required: true,
},
text: {
type: String,
},
likes: {
type: Number,
default: 0
}
}
If you'd like to contribute to this project, please follow these steps:
- Fork the repository
- Create a new branch (
git checkout -b feature/your-feature
) - Commit your changes (
git commit -m 'Add some feature'
) - Push to the branch (
git push origin feature/your-feature
) - Create a new Pull Request