Run these commands in the terminal:
-
$ git clone [email protected]:TowhidKashem/snapchat-clone.git
$ cd snapchat-clone
-
$ 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 inpublic/filters/source/*.js
into a single file calledfilters.min.js
-
This will:
-
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
-
Before:
-
$ 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. ThegetUserMedia
API used by the camera requires thehttps
protocol so we run the dev server in https mode.
-
You'll get this warning because the app uses a self signed
-
Click "Advanced" > "Proceed to localhost (unsafe)"
- After this you will be prompted to give access to your webcam, click "Allow"
-
In Chrome you will receive a "Your connection is not private"
warning
Step 1 Step 2 Step 3 -
The app should open automatically in your browser usually at
- You're all set! 🎉
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. |
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 |
-
If you want to make changes to the filter files located in
public/filters/src/*.js
, run the commandnpm run gulp watchJS
so that your changes get picked up -
The project's
baseUrl
is set to thesrc
directory in tsconfig so you can use clean import paths likeimport Foo from 'common/Foo';
instead of messy ones likeimport 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
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.