https://github.com/kelvinjuliusarmandoh/morse-code-converter
https://github.com/kelvinjuliusarmandoh/morse-code-converter
bootstrap5 flask html5 oop python
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/kelvinjuliusarmandoh/morse-code-converter
- Owner: kelvinjuliusarmandoh
- Created: 2024-06-30T03:18:41.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-06-30T03:55:10.000Z (about 2 years ago)
- Last Synced: 2025-09-12T03:17:49.403Z (10 months ago)
- Topics: bootstrap5, flask, html5, oop, python
- Language: Python
- Homepage:
- Size: 11.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Morse Code Converter and Inverter
A web application built with Flask that allows users to convert text to Morse code and invert Morse code back to text.
## Features
* Convert text to Morse code
* Invert Morse Code back to text
* User-friendly web interface
## Screenshoots
## Getting Started
Follow these instructions to set up and run the project locally on your machine.
### Prequisites
Ensure you have the following installed:
- Python 3.8.19
- or install the **requirements.txt**
### Installation
1. **Clone the repository**:
```bash
git clone https://github.com/kelvinjuliusarmandoh/morse-code-converter.git
cd morse-code-converter
```
2. **Create a virtual environment** (optional but recommended):
```bash
python -m venv venv
source venv/bin/activate # On Windows use `venv\Scripts\activate`
```
3. **Install the required packages**:
```bash
pip install -r requirements.txt
```
4. **Set the `SECRET_KEY`**:
In the `main.py` file, the Flask application requires a `SECRET_KEY` for session management and security purposes. You can set the `SECRET_KEY` as follows:
```python
import os
from flask import Flask
app = Flask(__name__)
app.config['SECRET_KEY'] = os.urandom(24) # Generate a random secret key
```
Alternatively, you can set a fixed `SECRET_KEY` for development purposes:
```python
app.config['SECRET_KEY'] = 'your_secret_key_here'
```
### Running the Application
1. **Set the FLASK_APP environment variable**:
```bash
export FLASK_APP=app.py # On Windows use `set FLASK_APP=app.py`
```
2. **Run the Flask application**:
```bash
flask run
```
3. Open your web browser and go to `http://127.0.0.1:5000` to access the application.
## Usage
1. Navigate to the home page.
2. Enter the text you want to convert to Morse code or the Morse code you want to invert.
3. Click the appropriate button to get the result.
## Project Structure
```
morse-code-converter/
├── main.py # Main application file
├── requirements.txt # Python dependencies
├── templates/ # HTML templates
│ ├── index.html
└── README.md # Project README file
```