This is the backend repository for the WTM Bamenda website, designed to support the community's online presence by managing users, blog posts, events, and comments. It utilizes Node.js, Express, and MongoDB to provide a robust and scalable backend solution.
- User Authentication and Authorization
- CRUD operations for blog posts and events
- Interactive comment system for blog posts
- MVC architecture for clean and maintainable code
- Node.js
- MongoDB (Local installation or MongoDB Atlas)
- npm (Node Package Manager)
Clone the repository and install dependencies:
git clone https://github.com/yourusername/WTM-Bamenda-Backend.git
cd WTM-Bamenda-Backend
npm install
Create a .env
file in the root directory with the following contents:
MONGODB_URI
: MongoDB connection string.
PORT
: Port number for the server (default: 3000).
Start the server with:
npm start
The server runs on http://localhost:3000
by default. Below are the available routes:
POST /users/register
: Register a new userPOST /users/login
: Authenticate a userPATCH /users/update/:id
: Update user detailsDELETE /users/delete/:id
: Delete a user
GET /events
: Retrieve all eventsGET /events/:id
: Retrieve a single event by IDPOST /events
: Create a new eventPATCH /events/:id
: Update an event by IDDELETE /events/:id
: Delete an event by ID
GET /blogposts
: Retrieve all blog postsGET /blogposts/:id
: Retrieve a single blog post by IDPOST /blogposts
: Create a new blog postPATCH /blogposts/:id
: Update a blog post by IDDELETE /blogposts/:id
: Delete a blog post by ID
POST /blogposts/:blogPostId/comments
: Add a comment to a blog postPATCH /blogposts/:blogPostId/comments/:commentId
: Update a comment in a blog postDELETE /blogposts/:blogPostId/comments/:commentId
: Delete a comment from a blog post
- Project Maintainers: WTM Bamenda
- Project Link: WTM Bamenda Backend