https://nbh-blog-api.herokuapp.com
- The Blog App has the functionality of Blogging and User Management.
- The User is expected to Register with the system and subsequently login to the system for creating/editing Blogs.
- A valid login or registration is mandatory to access the Blogs.
- Any authenticated user can Create blogs, While only the owner of Blog can Modify or Delete it.
- The Blogs can be Created, Read , Updated or Deleted.
- Users can be Registered , Viewed, Updated ,Deleted.
- A Registered user can login to the system at any point of time.
- created_by: string, required
- created_at: date, required Default to current date
- blog_title: string, required
- blog_content: string, required
- private: boolean, required
- user : ObjectId, refrences User Schema, {id, email}
- username: string, required
- email: string, required
- birthday: date, required
- age: number
- password: string, required
- UserName : Needs to be Alphanumeric
- Email : Should be a valid email type
- Password : Should be a minimum of 8 Characters
- Age : Should be greater than 13
- MONGO_DB_URI
- MY_SECRET_KEY
- This Project has been developed using NodeJS, Express and data is stored in MongoDB.
- We have used Postman to test the routes and the application is hosted on Heroku.
- User password is hashed using bcrypt
- User authentication is performed using jsonwebtoken
- nodemon
- bcrypt
- dotenv
- express
- express-validator
- helmet
- jsonwebtoken
- mongoose
- morgan
- router.get('/') - An authorized user can view all public and private Blogs
- router.get('/public') - An authorized user can view all Non private Blogs
- router.post('/') - An authorized user can create a new Blog
- router.get('/:id') - An authorized user can view a specific Blog
- router.put('/:id') - Only the user who created the Blog can Modify it
- router.delete('/:id') - Only the user who created the Blog can Delete it
- router.post('/registration') - Create a new user after checking the Validation rules, Hash the password and Provide a validation session token
- router.post('/login') - Login an existing User and Provide a validation session token
- router.get('/') - Get All users
- router.put('/:id') - Modify an User's Details
- router.delete('/:id') - Delete an User