Full-stack messaging application that communicates with a telegram user via a telegram bot.
I'm building this application to make use of the various full-stack related topics that I've learned.
I'm using the MEAN stack:
- Angular
- Nodejs with Expressjs
- MongoDb
I'm making use of the following key concepts and technologies:
- Angular routing
- RxJs
- JSON Web Tokens
- User authentication and authorisation
- Websockets
Follow these steps to set up and run the project on your local machine. Before you begin, ensure you have the following prerequisites installed:
- Git
- Node.js
- NPM (Node Package Manager)
- Angular CLI (Command Line Interface)
- MongoDB
Once you have these installed, proceed with the steps below.
-
Clone the Repository:
git clone git@github.com:AnevRensburg/telegram-app.git
-
Navigate to the Project Directory:
cd telegram-app
-
Install Dependencies:
npm install
-
Open your code editor: VS Code is opened like this:
code .
-
Navigate into the 'config' folder and create a file called keys.js:
cd config
touch keys.js
-
Add code to private.js: Add the following code to private.js, replacing the strings with your values, also as strings:
module.exports = { // Secret key for JWT secret: 'your_secret_key', // Bot ID botId: 'your_telegram_bot_token', // Channel ID channelId: 'your_telegram_channel_id' }
6.1 Replace your_secret_key with another string; it should look like a password, and you should treat it like one too!
6.2 Replace your_telegram_bot_token with the unique token you get when creating a telegram bot:
6.2.1 Search BotFather on Telegram.
6.2.2 Type /start to get started.
6.2.3 Type /newbot to get a bot.
6.2.4 Enter your Bot name and unique Username, which should end with the bot.
6.2.5 Then, you would get your Bot token.6.3 Replace your_telegram_bot_token with the unique id of a telegram channel:
6.3.1 Create a new telegram channel.
6.3.2 Add your bot to the channel as an admin.
6.3.3 Send a message in the channel and forward it to @userinfobot to get the channel id. -
Change back into your root directory:
cd ..
-
Run the Project:
npm start
-
Navigate to the Angular App: In another tab, cd into the angular-src folder:
cd angular-src
-
Install Dependencies:
npm install
-
Serve the Application:
ng serve
-
Open the Application: Open a web browser and navigate to
http://localhost:4200/
to see the application in action.
Note: You can change the MongoDB database configuration in config/database.js
.
If you encounter any errors or need assistance, please feel free to contact me directly at anejvr06@gmail.com.