Radio map is a clone of radio.garden, hosted on AWS and built on a MERN stack. Test it out here.
- Browse radio stations throughout the world
- Listen to internet radio
- See most popular stations in different areas
To run the project locally, run the following:
git clone https://github.com/andersan/radio-map.git
Start the express server in one terminal:
cd backend
yarn install
yarn run dev
Start the frontend in another terminal:
cd frontend
yarn install
yarn run dev
For debugging the backend, use npm run dev >> logfile.log
. Anything crashing the backend is likely caused by an uncaught API issue.
Note that the frontend project requires a .env.local file with the following variables assigned:
- NEXT_PUBLIC_ENVRIONMENT: set this to "development" for running locally
- NEXT_PUBLIC_CESIUM_ACCESS_TOKEN: api token for cesium Ion access (maps/images)
- Search functionality
- Basic user functionality (save a list of fave stations)
- Manage states with Redux, allowing for an easy back button in menu navigation
- Browse using alternative station list from Radio browser API
- Radio station list view (also using Radio browser API)
- Allow users to submit corrections and new stations
- Video streaming map
- Allow running front and back end with one command (use concurrently)
These steps work on an amazon linux x86 (non-arm) VM with 2gb RAM or more:
- Set up
~/.ssh/config
to contain an entry as follows:
Host radio-map
HostName 3.224.32.55
User ec2-user
AddKeysToAgent yes
IdentityFile ~/.ssh/aws-radio-map.pem
- Deploy code with
sh deploy-code.sh
- Install nginx with
sudo dnf install nginx
- Paste nginx config from radio.andersan.com.conf into /etc/nginx/conf.d/radio-map.conf
- Install node 20 as shown here https://tecadmin.net/install-latest-nodejs-amazon-linux/
- Install yarn and pm2 globally
mkdir apps && mkdir apps/radio-map && cd apps/radio-map
- Run the project's frontend and backend:
cd frontend && yarn build && pm2 start 'yarn start' --name 'frontend'
cd backend && yarn build && pm2 start 'yarn start' --name 'backend'
- Ensure DNS and network settings have been set up properly for the VM
Check if the frontend and backend are up:
pm2 status
pm2 logs
curl localhost:3000
should return something like the following in the VM:
curl localhost:5000
returns something like: <title>Express</title>
Welcome to Express
[ec2-user@ip-172-31-25-144 frontend]$Run this in the remote server:
sudo apt update
sudo apt install certbot python3-certbot-nginx
sudo certbot --nginx -d radio.andersan.com
Or the following, on amazon linux 2023:
# if using dnf
sudo dnf update
sudo dnf install certbot python3-certbot-nginx
sudo certbot --nginx -d radio.andersan.com
# if using yum
# sudo yum update
# sudo yum install certbot python3-certbot-nginx
# sudo certbot --nginx -d radio.andersan.com
Rename apps/radio-map/radio.andersan.com.ssl.conf
to