An API to manage all workings of the main Chit Chats app.
-
First of all create a folder and open a terminal on it.
-
Now run this following command to clone the repo:
git clone https://github.com/Ankan002/chit-chats-backend.git
. -
You should now go into the cloned directory.
-
Open up the directory in to a code editor now.
-
Finally create a
.env
file. -
Now create the following environment variables:
-
PORT
: This variable defines on which PORT number the app will run. Not required for production if deployed onHEROKU
-
SECRET
: This variable defines secret key for Jsonwebtoken (JWT
). -
DB_URI
: This will define theMongoDB
database to which the app will get connected. -
CLOUDINARY_NAME
: This variable definescloudinary
cloud name. -
CLOUDINARY_API_KEY
: This variable definescloudinary
API key. -
CLOUDINARY_API_SECRET
: This variable definescloudinary
API secret.
-
-
Failure in putting up of any of these environment variables might lead to crashing of the app.
-
Now go back to the terminal and run first
npm i -g typescript
. -
Then run
yarn
to install all the dependencies. -
Finally run
yarn dev
to start the development server. -
Note
: If there is ats-node
error then again runnpm i -g ts-node
That's it you are ready to test the app locally. Once app starts successfully you will be able to see the following in your terminal:
App is running at port ${PORT}
Connected to DB