All Projects → TowhidKashem → Snapchat Clone

TowhidKashem / Snapchat Clone

Licence: mit
👻 A SnapChat clone built with React, Redux and Typescript. Styled with SASS. Tested with Cypress, Jest and Enzyme. Linted with Eslint and formatted with Prettier!

Programming Languages

javascript
184084 projects - #8 most used programming language
typescript
32286 projects

Projects that are alternatives of or similar to Snapchat Clone

Fast
Develop, build, deploy, redeploy, and teardown frontend projects fast.
Stars: ✭ 126 (-83.64%)
Mutual labels:  frontend, sass, front-end, front-end-development
100 Days Of Code Frontend
Curriculum for learning front-end development during #100DaysOfCode.
Stars: ✭ 2,419 (+214.16%)
Mutual labels:  jest, sass, front-end, front-end-development
Uix Kit
A free UI toolkit based on some common libraries for building beautiful responsive website, compatible with Bootstrap v4.
Stars: ✭ 318 (-58.7%)
Mutual labels:  frontend, sass, front-end, front-end-development
Livingstyleguide
Easily create front-end style guides with Markdown and Sass/SCSS.
Stars: ✭ 874 (+13.51%)
Mutual labels:  frontend, sass, front-end
Learning Roadmap
The Front-End Developer Learning Roadmap by Frontend Masters
Stars: ✭ 336 (-56.36%)
Mutual labels:  frontend, front-end, front-end-development
Dev Practice
Practice your skills with these ideas.
Stars: ✭ 1,127 (+46.36%)
Mutual labels:  frontend, front-end, front-end-development
Roadmap Web Developer 2017
Front-end (HTML5/CSS3/Javascript related) technologies to learn in 2017
Stars: ✭ 142 (-81.56%)
Mutual labels:  frontend, front-end, front-end-development
Front End Handbook 2019
[Book] 2019 edition of our front-end development handbook
Stars: ✭ 3,964 (+414.81%)
Mutual labels:  frontend, front-end, front-end-development
Jeelizfacefilter
Javascript/WebGL lightweight face tracking library designed for augmented reality webcam filters. Features : multiple faces detection, rotation, mouth opening. Various integration examples are provided (Three.js, Babylon.js, FaceSwap, Canvas2D, CSS3D...).
Stars: ✭ 2,042 (+165.19%)
Mutual labels:  snapchat, threejs, camera
Simple React App
Simple base app using react, react-router v4, hot-reload & sass.
Stars: ✭ 263 (-65.84%)
Mutual labels:  jest, enzyme, sass
Mac Setup
🛠️ Front end web development setup for macOS.
Stars: ✭ 265 (-65.58%)
Mutual labels:  frontend, front-end, front-end-development
Awesome Learning
Awesome Learning - Learn JavaScript and Front-End Fundamentals at your own pace
Stars: ✭ 216 (-71.95%)
Mutual labels:  jest, enzyme, frontend
Front End Web Development Resources
This repository contains content which will be helpful in your journey as a front-end Web Developer
Stars: ✭ 3,452 (+348.31%)
Mutual labels:  frontend, front-end, front-end-development
Mini.css
A minimal, responsive, style-agnostic CSS framework!
Stars: ✭ 2,938 (+281.56%)
Mutual labels:  frontend, sass, front-end
Enzyme
JavaScript Testing utilities for React
Stars: ✭ 19,781 (+2468.96%)
Mutual labels:  jest, enzyme
Pingy Cli
The Simple Frontend Build Tool. No Configuration, No Plugins.
Stars: ✭ 390 (-49.35%)
Mutual labels:  frontend, sass
Troika
A JavaScript framework for interactive 3D and 2D visualizations
Stars: ✭ 342 (-55.58%)
Mutual labels:  threejs, canvas
Firebase Instagram
📸 Instagram clone with Firebase Cloud Firestore, Expo, and React Native 😁😍
Stars: ✭ 389 (-49.48%)
Mutual labels:  clone, camera
Front End Design Checklist
💎 The Design Checklist for Creative Web Designers and Patient Front-End Developers
Stars: ✭ 4,136 (+437.14%)
Mutual labels:  frontend, front-end-development
Indoor3d
a js lib based on three.js to show 3D indoor map
Stars: ✭ 425 (-44.81%)
Mutual labels:  threejs, canvas

👻 SnapChat Clone

React Redux TypeScript JavaScript Sass Webpack gulp Cypress Jest Eslint Prettier Storybook

[LIVE APP]

[Live App]  •  [Video Demo]

⚡️Breakdown

  • Built with React
    • Only functional components using hooks
    • Folder structure:
      • Flat - no greater than one level deep
      • Modular - each folder contains all the relevant files needed to make up a particular feature (components, styles, tests, actions, etc). Having everything close at hand reduces cognitive load and deleting a folder removes the feature entirely from the code base without having to worry about left over code
      • Organized semantically by Feature (not by the traditional "components/containers" model), this way of reasoning is more human friendly
      • common directory houses all shared components
    • Custom component library showcased in Storybook
    • Relatively few prod dependencies
  • Global state management via Redux
    • Uses Redux Toolkit - the official recommended approach to using Redux which drastically cuts the need to write boilerplate code
    • A single store.ts file for each feature contains all actions and reducers (the creators are auto generated by RTK)
    • Flat state tree avoids deeply nested properties
    • RTK has built-in support for ImmerJS which allows state to be safely mutated removing the need for messy object copying via spread operators
    • Uses the useDispatch and useSelector hooks provided by react-redux for accessing state values and dispatching actions over the more verbose connect method
    • Uses thunk for async operations
    • Integrates the powerful Redux Devtools Extension for ease of development
  • Styled with SASS
    • Each view's set of rules are scoped to a single parent element via nesting to avoid style clashes
    • Use of variables, extendables and mixins to keep things DRY and uniform
  • Written in Typescript
    • To let the compiler catch bugs at build time instead of letting users catch them at runtime!
  • Unit tested with Jest and Enzyme
  • End-to-end tested with Cypress
    • Selectors use data attributes instead of classes or ids as these can change often causing tests to break
    • Integration suite covers all essential feature happy paths
  • Linted using Eslint
  • Code is auto formatted using Prettier (ran as a pre-commit git hook) before it gets pushed to the repo
  • Feels close to a native app if you "add to homescreen" on mobile

💿 Installation

Run these commands in the terminal:

  1. $ git clone [email protected]:TowhidKashem/snapchat-clone.git
  2. $ cd snapchat-clone
  3. $ npm install
    • This will:
      • Install the dependencies in package.json
      • Checkout jeelizFaceFilter package (used for the filters) and set it to the last version this project was tested and confirmed to work with
      • Run gulp to concatenate, minify and transpile the files located in public/filters/source/*.js into a single file called filters.min.js
  4. This part is optional but strongly recommended, without it you won't be able to view any of the snap map features:
    • Make a Mapbox account and get a free API key
    • Rename the .env.sample file at the root of the project to just .env
    • Inside enter your new API key, for example:
      • Before: REACT_APP_MAP_BOX_API_KEY=<REPLACE_WITH_API_KEY>
      • After: REACT_APP_MAP_BOX_API_KEY=xy.abc123
  5. $ npm start
    • The app should open automatically in your browser usually at https://localhost:3000/
      • In Chrome you will receive a "Your connection is not private" warning
        • Click "Advanced" > "Proceed to localhost (unsafe)"
          • You'll get this warning because the app uses a self signed https certificate. The getUserMedia API used by the camera requires the https protocol so we run the dev server in https mode.
      • After this you will be prompted to give access to your webcam, click "Allow"

    Step 1 Step 2 Step 3
  6. You're all set! 🎉

🦮 Guides

Not all the buttons are actionable, many of them are there just for show since this is a minimal demo. This video shows all the things you can currently do. Where it's not obvious which buttons actually work I added red box-shadows as guides.

🛠 Tooling

Storybook is used to showcase the app's custom component library. You can run Storybook using the command npm run storybook

Redux Devtools Extension is implemented in the app, it makes things like viewing the state tree, state flow and debugging much easier, to use it you need to install the browser extension here or here

🧪 Testing

End-to-End Tests

👆Click to see all tests run

  • All e2e tests are located in cypress/integration/*.spec.ts
    • To run these first make sure the dev server is up and running via npm start, then use the command npm run e2e
    • This will open the Cypress electron app. Click "Run all specs" at the top right, you'll then get a Chrome instance and see all the tests being run
  • Alternatively you can run the test suite in the terminal using the command npm run e2e-headless. This command still generates videos in cypress/videos/*.mp4 of the tests should you need them
Unit Tests
  • All the shared components in the common directory have unit tests inside their respective folders. They end with a *.test.tsx extension.
  • To run the unit test suite use the command npm run test
  • These tests are also automatically run on each commit, if there are any failures the commit will also fail

📝 Misc Notes

  • If you want to make changes to the filter files located in public/filters/src/*.js, run the command npm run gulp watchJS so that your changes get picked up
  • The project's baseUrl is set to the src directory in tsconfig so you can use clean import paths like import Foo from 'common/Foo'; instead of messy ones like import Foo from '../../common/Foo';. You can also use these in the SASS files, e.g. @import '~styles/foo';
  • This is a purely front end demo, the "API" is nothing but a bunch of json files with hard coded dummy data, they're located in /public/api/*.json

⚠️ Contributing

Please note I won't be accepting PR's on this project since it's part of my personal portfolio. You're more than welcome to fork and maintain your own version if you like!

⚖️ License

The Snapchat name, artwork, trademark are all property of Snap Inc. This project is provided for educational purposes only. It is not affiliated with and has not been approved by Snap Inc.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].