Skip to content
SPJ27Public

About

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Slack Clone

test at https://slack.sakshamjain.dev

This is a slack clone, with a lot of interesting features, such as-

  • Realtime messages
  • Creating new channels: private and public
  • Joining channels, adding to channels, and leaving channels
  • Sending DMs to people
  • Developing Apps!
    • Just like actual slack, you can create your own bots that would perform actions for this slack clone
    • You can send messages on / commands, the docs are given below for making it

Future planned upgrades (I'll work on it in future)

  • Responsive design, as it only works on desktop for now
  • Adding admin features
  • Video and audio huddles
  • Modifying messages
  • Activities ...and much more

Stack (as of now)

  • Next.js
  • Typescript
  • Tailwind
  • Supabase DB + Realtime
  • Shadcn for cards and stuff
  • React Quill
  • React quill mentions
  • Remark

How apps work

  • create a new app
  • add the url to your apps api - for ex, https://api.birdie.com
  • create a new POST method in your api, which accepts json body - command => the command user has made, and args
  • whenever the shortcut to your app is referred, the app's api is clicked, and then you can program it

demo code for sending message -

await fetch("https://slack.sakshamjain.dev/api/apps/message", {
      method: "POST",
      headers: {
        Authorization: `Bearer ${process.env.API_KEY}.${process.env.API_SECRET}`,
        "Content-Type": "application/json",
      },
      body: JSON.stringify({
        to: 33,
        message: args.join(' '),
        type: 'CHANNEL'
    }),
    });

To create an API route that your app can call, your endpoint must:

  • Accept a JSON request body.

  • Include the following fields in the request body:

    • command – the command being executed.
    • args – the arguments passed to the command.

Example request

{
  "command": "hello",
  "args": ["1", "hw"]
  "channel_id": 33
}

About

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages