A RESTful API for managing retrospective boards, built with Node.js, Express, and MongoDB.
- Node.js: JavaScript runtime
- Express: Web framework for handling routes and middleware
- MongoDB: NoSQL database with Mongoose ODM
- JWT: JSON Web Tokens for authentication
- WebSockets: Real-time communication for collaborative features
- bcrypt.js: Password hashing
All authenticated endpoints require a JWT token in the Authorization header:
Authorization: Bearer <token>
POST /api/users/register
Request Body:
{
"username": "user123",
"name": "John Doe",
"email": "john@example.com",
"password": "securepassword"
}Response: User object (password and tokens omitted)
POST /api/users/login
Request Body:
{
"email": "john@example.com",
"password": "securepassword"
}Response: User object with authentication token
POST /api/users/logout
Authentication required
Response: Success message
PATCH /api/users/update/:id
Authentication required
Request Body: Fields to update Response: Updated user object
POST /api/boards
Authentication required
Request Body:
{
"name": "Sprint Retrospective",
"columns": [
{ "name": "What went well" },
{ "name": "What could be improved" },
{ "name": "Action items" }
]
}Response: Created board object
GET /api/boards
Authentication required
Response: Array of board objects
GET /api/boards/:id
Authentication required
Response: Board object
GET /api/boards/shared/:link
Response: Board object
PATCH /api/boards/:id
Authentication required
Request Body: Fields to update Response: Updated board object
POST /api/boards/:boardId/columns/:columnId/cards
Authentication required
Request Body:
{
"content": "Team collaboration improved",
"author": "John"
}Response: Updated board object
DELETE /api/boards/:id
Authentication required
Response: Success message
- Clone the repository
- Install dependencies:
npm install - Create a
.envfile with the following variables:PORT=3000 MONGODB_URI=mongodb://localhost:27017/retro-board JWT_SECRET=your_secret_key - Start the development server:
npm run dev
The API includes WebSocket support for real-time collaboration on boards. Clients can connect to:
ws://localhost:3000
Events:
board-update: Sent when a board is modifiednew-card: Sent when a new card is added
GET /health
Response: { "status": "ok" }