This is an portfolio project on creating a full stack chatting web application.
Link to application: https://chatapp.yukhai666.me/
I started this project as my first endeavour without step-by-step guidance from external sources, such as YouTube videos or blog posts. It provided a fresh opportunity to create the project from scratch and gradually build it up with my knowledge. Simultaneously, it taught me ways to overcome challenges and bugs when encountering bottlenecks.
This project has given me a new experience of working on a programming project, and observing its growth and advancement, which significantly boosts my confidence and motivation to continue learning programming and solving problems along my professional path.
Client:
Server:
Hosting:
Open the CLI application (Command Prompt, Git Bash etc.) in the destination folder
Clone the project
git clone https://github.com/YKLoh666/chat-app.git
Go to the project directory
cd chat-app
Install dependencies for the frontend application, then build the static application
cd client
npm install
npm run build
Go back to the root folder, install the dependencies for the backend application
cd ..
npm install
Create a .env
file in the root folder and add the following environment variables. Syntax here
NODE_ENV
"development" or "production"
MONGO_URI
To establish connection to the local/atlas database server. A MongoDB database server is required, could be either local version or cloud version (MongoDB Atlas). If the database server is setup locally, usually the URI will be "mongodb://0.0.0.0:27017/database-name" Learn more of MongoDB server setup here: Local, Atlas
COOKIE_SECRET
A secret random string that is used to sign/unsign cookies when making API calls
JWT_PRIVATE_KEY
A secret random string that is used to sign/unsign a JWT token that can be used as the user's credential
PORT
The port where the application runs at
PUBLIC_BASE_URL
The base URL where the application runs at
Create another two environment variables files call .env.development
and .env.production
. These two files has only one environment variable in it, which is PUBLIC_BASE_URL
that used to specifies the base URL of the application when run in either node environment. As for running in local environment, set both of it to "http://localhost:5000" (change the port number according to the one specified in the .env file, no trailing slash).
Start the server
npm start