Chat Platform API
This is the backend for the Chat Platform React project.
Installation & Setup
Pre-requisites
- Node.js v16
- 8/31/2022 - I've tested this on my Ubuntu server with Node.js v18 and there was an issue with the database connection. I was able to fix this by downgrading to Node.js v16. If you have any issues with the database connection, please try Node.js v16.
- MySQL Server (or any SQL database that is supported by TypeORM).
Setting up the Backend
-
Clone the repository.
-
Run
yarn install
to install dependencies. -
Create a
.env.development
file in the root directory and paste the following:PORT= MYSQL_DB_HOST= MYSQL_DB_USERNAME= MYSQL_DB_PASSWORD= MYSQL_DB_PORT= MYSQL_DB_NAME= COOKIE_SECRET=
PORT
The port your server will run onMYSQL_DB_HOST
The hostname for your MySQL database serverMYSQL_DB_USERNAME
The username for your MySQL databaseMYSQL_DB_PASSWORD
The password for your MySQL user accountMYSQL_DB_PORT
The port your MySQL server is running on (default 3306)MYSQL_DB_NAME
The name of your database (be sure to create it first otherwise an error will be thrown).COOKIE_SECRET
Can be any string that can be used to encrypt & decrypt your cookie.
-
Run
yarn start:dev
ornpm run start:dev
depending on which package manager you use to start the project in development mode.
This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.