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
.envfile. -
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 theMongoDBdatabase to which the app will get connected. -
CLOUDINARY_NAME: This variable definescloudinarycloud name. -
CLOUDINARY_API_KEY: This variable definescloudinaryAPI key. -
CLOUDINARY_API_SECRET: This variable definescloudinaryAPI 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
yarnto install all the dependencies. -
Finally run
yarn devto start the development server. -
Note: If there is ats-nodeerror 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