Translation: broadcast.listennotes.com/the-boring-…

See how the author can easily build a commercial website using Django+ Other techniques.

Introduction to the

Listen Note is a podcast search engine and database. The technology behind Listen Note is pretty simple and boring, with no use of AI, deep learning or blockchain. (Anyone who says they use AI isn’t using real AI.)

A PodCast, also called a PodCast, is a digital medium in which a series of audio, movie, electronic radio, or text files are distributed over the Internet in the form of a list. Listeners then subscribe to the list via an electronic device to download or stream the contents of the electronic files.

After reading this article, you should also be able to build a Listen Notes or do something similar easily.

You don’t have to hire a lot of people. Remember when Instagram was bought by FaceBook for $1 billion? At the time, Instagram had 13 employees, and not all of them were engineers.

Now more than ever, it’s possible to build something worthwhile and meaningful with a small team (or even one person).

Listten Notes overview

Listen Notes offers users two things.

  • 1. A website at: Listennotes.com, which provides a search engine database, a podcast, also provides listening, playlists, later listen to podcasts fragment (it allows you to clip any podcast is a section of the interface, then listen to) and podcasts to monitor reminded (Internet new podcast mentioned you specify the keyword, it will inform you), and other functions
  • 2. Provide developers with podcast search and directory API, through the API can understand the user’s usage.

I ran all of ListenNotes on AWS, using a total of 20 production servers (as of 5 May 2019)

You can guess from the host name, what does each server do

  • 1. Production – Web (production network server) : Mainly used to provide listenNotes.com network traffic service.
  • 2. Production API server: mainly used to provide API services. At present, I have run two versions of API(V1API legacy API and V2API new API).
  • 3. Production-db: Use PostgreSQL to build primary and secondary databases
  • 4. Production-es (Elasticsearch cluster) : is responsible for search
  • 5. Production-worker: Mainly used to run various offline tasks (crawling the latest podcast) to keep the podcast database up to date and provide some other small functions.
  • 6. Production – LB: simple build with Redis and RabbitMQ (not ideal, but I’ve never been a perfect person)
  • Production – Pangu is used to run one-off scripts and test the machine (here pangu is pangu, Chinese culture is still very attractive abroad)

The back-end

The entire back end is written using Django/Python3 and the operating system is Ubuntu.

Use uWSGI+Nginx to deploy Django. Nginx is also used as a load balancer. (This is a common Ubuntu+uWSGI+Nginx+Django deployment.

The database mainly uses PostgreSQL. I have many years of experience in developing and operating PostgreSQL, so I can use it well.

Redis is used for various purposes, such as caching, statistics, and so on

Elasticsearch is the search engine for the entire site, and I use Elasticsearch to index podcasts and episodes on the site in the same way that many boring companies do.

I use Celery to schedule offline tasks and container to manage processes on the server.

Why not use Docker Kubernetes/Serverless these technologies?

Not necessarily, for small and medium sized companies, over-engineering is not good. In fact, I did some early Docker work for my employer back in 2014, which is a good thing for a mid-size billion dollar startup, but probably too much for a one-man startup like mine.

The front end

React+Redux+WebPack+ES is now standard.

When deployed to production, I exported the JS package to Amazon S3 and provided the CDN service through CloudFront

Amazon CloudFront is a content delivery network (CDN) with basic services provided by Amazon Web Services systems. It has its own data centers in many major cities in Europe, Asia, North America, Australia, South America and the United States, with 107 network marginal service points providing services.

At Listennotes.com, most pages use half the Django module and half the React application. The server rendering part provides a sample of the Web page, while the client (browser-side) part is basically an interactive Web application.

But there are some pages that render exactly the same as Django templates, because I’m too lazy to do things perfectly, and it might have some SEO benefits.

Music player

On ListenNotes, I use an open source music player, React-media-Player, which has been modified a lot. I use this player in many places. It’s easy to embed the player on the required page with iframe.

React-media-player github.com/souporserio

Podcast API

Listennotes provides a simple and reliable podcast API for developers. Building the API is similar to building a website, using Django/Python on the back end and ReactJS on the front end.

For the API, we need to keep track of how many requests are used by users using the API during the current billing cycle and charge them at the end of the billing cycle.

DevOps

Machine configuration and code deployment

I used Ansible for server deployment and simply wrote a bunch of YAML files to specify what configuration files and software should be declared for what type of server. Here is the directory structure of these Ansible YAMl files.

I also used Ansible to deploy the code to a production summary, basically just running a deployment script deploy.sh in MacOS.

Ansible is a simple, easy-to-use IT automation engine. Ansible has a rich ecosystem of documents to refer to.

Sh receives three parameters as follows:

./deploy.sh production HEAD web
Copy the code
  • 1.Envireonment: Used to distinguish between a production environment and a staging environment
  • Listennotes RepO version: HEAD only deploys the latest version, and if SHA is specified in Git Commite, it deploys a specific version, which is useful for code that I need to roll back to a version from a bad deployment.
  • 3.Server Kind Server type: There are different Server types to choose from, such as Web, Woker and API. I don’t need to deploy all servers at the same time

Staging environment: Usually a Web project needs a staging environment, which can be used as a demo for customers and as a “preview” for Production Server to detect problems before new features are released.

Much of the deployment process is orchestrated by Ansible YamL configuration files, and Ansible automatically performs the process, which is, of course, very simple:

  • 1. On my MacBook Pro: Automatically build JavaScript packages and upload them to Amazon S3 if you want to deploy to a Web server
  • 2. On the target server: Clone the corresponding ListenNotes repo into a folder named with a timestamp through Git, check the specific version, and install the new Python dependencies through PIP
  • 3. On the target server: point the soft connection (created using the ln command) to the new timestamp folder and run the container container to restart the server

I didn’t use any complicated techniques, just some simple and practical techniques to achieve such a process.

Monitoring and alarm

I use the DataDog service for monitoring and alerting, which is a SaaS service, so I don’t have to do anything complicated to get a simple dashboard and see all the metrics on my server.

I link DataDog to PagerDuty, which alerts me by phone or text if anything goes wrong.

I also use a Rollbar to keep track of the health of My Django code, which catches unexpected exceptions and notifys me via email or Slack(Slack’s proprietary cloud-based instant messaging platform).

Datadog is a monitoring service for cloud services applications that provides monitoring of servers, databases, tools and services through a Saas-based data analytics platform. PagerDuty is an American cloud computing company that provides SaaS event response platform for IT departments. Rollbar automates error monitoring and filtering, allows developers to fix important errors in minutes, and allows software to be built quickly and easily. These are SaaS services, and they all cost money 🙁

I personally use Slack a lot, but I’m the only one in the company, so INSTEAD of using Slack to communicate with others, I use Slack to monitor interesting application-level events.

In addition to integrating DataDog and Rollbar with Slack, I also used Slack incoming Webhooks in my Listen Notes back-end code that let Slack notify me when a user signs up or performs some action.

Since the launch of ListeNote at the beginning of 2017, ListeNote only went down once due to power failure on April 22, 2018. During that time, ListenNote website was shut down for 4 hours, and I lost 10 hours of production data, which was a major blow. On ListeNote, there was no interruption.

The development of

I work in a WeWork shared space in San Francisco.

Why not at home?

I value productivity very much, I’m willing to invest in productivity, and I don’t think playing around at home is conducive to software development (or any type of intellectual/creative work). I rarely work more than eight hours a day, and I treasure every minute.

Therefore, I need a nice and relatively expensive private office. I am not willing to spend more time to save money, but prefer to spend some money to make money in less time.

I used a MacBook Pro for my development work, I ran almost the same environment in Vagrant+VirtualBox as I did online, and I also used Anserable YAML files to deploy the Vagrant internal development environment.

I host all of ListenNote’s code on Github’s private REPO, I do all of the development work on the main branch, and I rarely use the functional branch.

I wrote and ran dev services (Django RunServer and Webpack Dev Server) using PyCharm, which was pretty boring… I’m not using VS Code or Atom or some other cool IDE.

Stay calm and keep moving

As you can see, we are living in the good old days started his company, can easily, there are so many tools and services available, you can save our time and money, and improve our productivity, now more than ever to a small group or a person with some simple and boring technology to build some useful things in the world.

As companies get smaller over time, you don’t need to hire full-time employees, you can do it through SaaS and Upwork with contractors.

Most of the time, what gets in the way of action is overthinking, and you think, what if this… If that… Everyone is busy with their own lives and no one pays attention to what you build until you prove that you deserve attention. Even if you completely screw up the initial product launch, few people will notice.

Think big, start small, act fast.

It’s perfectly ok to use boring technology and start doing simple things, as long as you can actually solve the problem.

The tail

Domestic many articles will be a complicated things, a lot of detail, and foreign many articles will say, this is a simple and boring, I prefer the atmosphere of foreign articles, not to say that technology must be very simple, but set up the information to the person, can do have the confidence to oneself is a good thing.

If my article helps you, please click “look good”, which is very important to me as a trumpet, thanks Horne.