Add broadcast server project

feat/projects-list
Kamran Ahmed 4 months ago
parent f811a746ea
commit 637396db17
  1. 2
      src/components/Projects/ProjectsList.tsx
  2. 54
      src/data/projects/broadcast-server.md

@ -106,7 +106,7 @@ export function ProjectsList(props: ProjectsListProps) {
Submit a Project Idea
</a>
</div>
<div className="mb-24 grid grid-cols-3 gap-1.5">
<div className="mb-24 grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-1.5">
{matchingProjects.length === 0 && (
<div className="col-span-3 rounded-md border bg-white p-4 text-left text-sm text-gray-500">
<p>No matching projects found.</p>

@ -0,0 +1,54 @@
---
title: 'Broadcast Server'
description: 'Build a server that can broadcast messages to connected clients.'
isNew: false
sort: 12
difficulty: 'intermediate'
nature: 'CLI'
skills:
- 'Programming Language'
- 'Networking'
- 'Websockets'
- 'HTTP'
seo:
title: 'Broadcast Server Project Idea'
description: 'Build a server that can broadcast messages to connected clients.'
keywords:
- 'broadcast server'
- 'backend project idea'
roadmapIds:
- 'backend'
---
You are required to create a simple broadcast server that will allow clients to connect to it, send messages that will be broadcasted to all connected clients.
## Goal
The goal of this project is to help you understand how to work with websockets and implement real-time communication between clients and servers. This will help you understand how the real-time features of applications like chat applications, live scoreboards, etc., work.
## Requirements
You are required to build a CLI based application that can be used to either start the server or connect to the server as a client. Here are the sample commands that you can use:
- `broadcast-server start` - This command will start the server.
- `broadcast-server connect` - This command will connect the client to the server.
When the server is started using the `broadcast-server start` command, it should listen for client connections on a specified port (you can configure that using command options or hardcode for simplicity). When a client connects and sends a message, the server should broadcast this message to all connected clients.
The server should be able to handle multiple clients connecting and disconnecting gracefully.
## Implementation
You can use any programming language to implement this project. Here are some of the steps that you can follow to implement this project:
1. Create a server that listens for incoming connections.
2. When a client connects, store the connection in a list of connected clients.
3. When a client sends a message, broadcast this message to all connected clients.
4. Handle client disconnections and remove the client from the list of connected clients.
5. Implement a client that can connect to the server and send messages.
6. Test the server by connecting multiple clients and sending messages.
7. Implement error handling and graceful shutdown of the server.
<hr />
This project will help you understand how to work with websockets and implement real-time communication between clients and servers. You can extend this project by adding features like authentication, message history, etc.
Loading…
Cancel
Save