Giter Site home page Giter Site logo

guilospanck / discord-clone Goto Github PK

View Code? Open in Web Editor NEW
4.0 4.0 4.0 1.85 MB

Frontend Discord Clone made with TypeScript and React

Home Page: https://guilospanck.github.io/discord-clone/

JavaScript 5.06% HTML 1.30% TypeScript 93.25% Shell 0.14% CSS 0.24%
discord react typescript

discord-clone's Introduction

Discord Clone

This is the frontend part of the attempt of cloning Discord just looking at the source code for information about the dimensions, colors and fonts.

image image image image image Testing-Library Dependabot GitHub Actions

โžก๏ธ ๐Ÿ‘ท๐Ÿšง Under Construction...

You can find it @ Discord Clone

Technologies

  • React v18 with TypeScript from scratch
  • Webpack, Babel, ESLint
  • Jest and React Testing Library for tests
  • Husky as Git Hooks
  • Styled Components

Concepts

  • Clean Code Architecture
  • React Best Practices
  • SOLID principles
  • Design Patterns

Tree Architecture

.
โ”œโ”€โ”€ assets
โ”‚   โ””โ”€โ”€ images
โ”œโ”€โ”€ components
โ”‚   โ””โ”€โ”€ Link
โ”œโ”€โ”€ pages
โ”‚   โ””โ”€โ”€ Home
โ”‚       โ”œโ”€โ”€ context
โ”‚       โ”œโ”€โ”€ types
โ”‚       โ”œโ”€โ”€ useCases
โ”‚       โ”œโ”€โ”€ viewModels
โ”‚       โ”‚   โ”œโ”€โ”€ channels
โ”‚       โ”‚   โ”œโ”€โ”€ chat
โ”‚       โ”‚   โ””โ”€โ”€ sidebar
โ”‚       โ””โ”€โ”€ views
โ”‚           โ”œโ”€โ”€ channels
โ”‚           โ”‚   โ”œโ”€โ”€ channels_section
โ”‚           โ”‚   โ”œโ”€โ”€ channels_server_title
โ”‚           โ”‚   โ””โ”€โ”€ channels_sidebar
โ”‚           โ”œโ”€โ”€ chat
โ”‚           โ”‚   โ”œโ”€โ”€ chat_form
โ”‚           โ”‚   โ”œโ”€โ”€ chat_main
โ”‚           โ”‚   โ””โ”€โ”€ chat_section
โ”‚           โ””โ”€โ”€ sidebar
โ””โ”€โ”€ shared

I'm using Clean Code Architecture. Basically it tells us to divide our code into layers, in order to be more testable and to decouple our logic.

The names may vary from one person to another, but the basic concept is the separation of concerns.

Below it's an overview about the layers I'm using.

  • assets: layer used to comport our images, videos, audios and so on.
  • components: React components that we can use in different parts of the project. This parte could have been inside the shared layer as well.
  • shared: any type of file that can be shared amongst pages and components, like JSON files, configurations, and so on.
  • pages: here resides every single page that our application may have. I define page as something that will change routes. Inside each page we have the separation of concerns of the components of these pages.
    • context: here is where we can use the React.Context API in order to manage the state of your page through different components.
    • types: here are the basic types we're using in the page.
    • useCases: basically every connection with the outside world, like fetch()ing a API or something like that.
    • viewModels: this layer is responsible to manage what the views layer will present. So here resides everything related to data manipulation, like React Hooks and Events.
    • views: finally we have the views layer. It's responsible for showing the elements to the user. Here we retrieve data from the viewModels layer and then show it to the user. Also, here's where we will send events to that layer, like an onClick event, for example.

Checklist Features

  • Frontend

    • It shall have a MVP presenting some key concepts of Discord design.
    • It shall be able to send messages and show those message in the main chat.
    • It shall be able to change between servers and channels.
    • It shall be covered with at least 80% of tests.
    • It shall have options to create new servers.
    • It shall have options to create new categories.
    • It shall have options to create new channels.
    • It shall be able to receive messages in real-time.
    • It shall have a form of creating users and loging them.
  • Backend

    • It shall be able to handle user creations.
    • It shall be able to handle user login.
    • It shall be able to handle messages through a websocket.
    • It shall be able to save info about the user.
    • It shall be able to save info about the servers.
    • It shall be able to save info about the categories.
    • It shall be able to save info about the channels.
    • It shall be able to save messages per channel.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.