👻 A Snapchat clone built with React and Redux. Written in Typescript. Styled with SASS. Tested with Cypress, Jest and Enzyme. Linted with Eslint and formatted with Prettier!
React
components
directory houses all shared componentsStorybook
Redux
Redux Toolkit
- the official recommended
approach to using Redux which drastically cuts the need to write
boilerplate code
store.ts
file for each feature contains all actions and
reducers (the creators are auto generated by RTK)
ImmerJS
which allows state to
be safely mutated removing the need for messy object copying via spread
operators
useDispatch
and useSelector
hooks
provided by react-redux
for accessing state values and
dispatching actions over the more verbose connect
method
thunk
for async operationsRedux Devtools Extension
for ease of development
SASS
Typescript
Jest
and Enzyme
Cypress
data
attributes instead of classes or ids as
these can change often causing tests to break
Eslint
Prettier
(ran as a pre-commit git
hook) before it gets pushed to the repo
Run these commands in the terminal:
$ git clone [email protected]:TowhidKashem/snapchat-clone.git
$ cd snapchat-clone
$ npm install
gulp
to concatenate, minify and transpile the files
located in public/filters/source/*.js
into a single
file called filters.min.js
.env
file enter your new API key, for example:
REACT_APP_MAP_BOX_API_KEY=REPLACE_WITH_API_KEY
REACT_APP_MAP_BOX_API_KEY=xy.abc123
$ npm start
https://localhost:3000/
https
certificate. The
getUserMedia
API used by the camera requires
the https
protocol so we run the dev server in
https mode.
Step 1 | Step 2 | Step 3 |
---|---|---|
🦮 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
|
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 |
Unit Tests | |
---|---|
|
public/filters/src/*.js
, run the command
npm run gulp watchJS
so that your changes get picked up
baseUrl
is set to the src
directory
in tsconfig so you can use clean import paths like
import Foo from 'components/Foo';
instead of messy ones like
import Foo from '../../components/Foo';
. You can also use these in
the SASS files, e.g. @import '~styles/foo';
/public/api/*.json
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!
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.