Coder Social home page Coder Social logo

because-transcripts's Introduction

Because Transcripts

Because having searchable transcripts isn't just good accessibility!

Using

Developing

It is highly reccomended to use docker to handle installing the non-go dependencies.

Prerequisites

You will need a properly setup Go development environment to develop on this. You will either need to use docker with the included compose script, or install a postgres 14 database.

For data model changes you'll need:

  • sqlboiler installed with the postgres plugin (something like go install github.com/volatiletech/sqlboiler/v4/drivers/sqlboiler-psql@latest )

Config file setup

  1. Copy sqlboiler.sample.yaml and config.sample.yaml to new files - removing the .sample (you should have config.yaml and sqlboiler.yaml)
  2. You'll need to at least change the Database Name (<DATABASE>), DB User (<DBUSER>) and DB Password (<DBPASS>) in those files to a suitable config for your system.
    • It's a good idea to use a unique database and user and a random password to avoid issues with your dev environment
    • The helper tool will create a user for you
  3. You may need to change the host and port entries to reflect your local setup. The example fields in config.sample.json are the defaults and will work with the supplied docker-compose.yml
  4. config.yaml is used by the live application, while boiler.yaml is only used to generate new datamodels from database data.
  5. The "development" flag is used for a number of things:
    • to read the migrations from files rather than the bindata
    • to read the html/email templates from files rather than the bindata
    • to output the SQL used to the console for debugging

Bindata

You will need to build a local copy of the bindata - the helpertool will let you do this. See Updating bindata via helperTool below

Helper tool

In the subdirectory helperTool of this repo is package that compiles a helper tool. This should be built via go build.

  • By default the helper tool will look for your config file in the working directory (the helper tool is designed to be run from helpertool)
  • By default the helper tool will use the postgres user postgres (this needs to be a root user)
  • By default the helper tool will use the postgres password rootpassword
  • If you've changed the docker config these may need to be specified - run the tool with the --help (macOS/linux) or /h (windows) option to get help

Helper tool run examples

macOS / linux

cd helperTool
go build 

Database Setup via helperTool

  1. Setup the config file with the correct:
    1. database host
    2. database port
    3. the desired database name to use (this will be created and if this exists, it will be overwritten)
    4. the desired user to user (this will be created and if this exists, it will be overwritten)
    5. the desired user's password
  2. run the helper tool with the createDatabase command
  3. if no errors are encountered, the base setup is complete!

Updating bindata via helperTool

  1. run the helper tool with the updateBindata command

Changing data models

  1. Ensure you have the development flag turned on to test your migration scripts
  2. run the helper tool with the createMigration command. This command takes the following parameters:
    1. directory - the root directory of this repository (if the helpertool is being run in the helperTool directory, then this will be either ..\ or ../ depending on your os)
    2. name - the name of the migration to create. Should be related to what the migration does, should probably be enclosed in quotes. The tool will replace whitespace with _, and non-alpha numeric characters with -
  3. Specify the migration syntax in the new files created in the datasource/migrations/ directory
  4. Test your migration via compiling and running the server with the development flag turned on
  5. Once your migration has the correct SQL, regenerate the bindata using the helperTool's updateBindata command
    1. directory - the root directory of this repository (if the helpertool is being run in the helperTool directory, then this will be either ..\ or ../ depending on your os)
  6. Then generate the models:
    1. Ensure you have copied boiler.sample.yaml to boiler.yaml and changed the various directives to your local ones.
    2. Run sqlboiler psql -o datasource_raw -p datasource_raw -c boiler.yaml from the root of the repo.

because-transcripts's People

Contributors

lordmortis avatar

Stargazers

Nikoli Daigneault avatar

Watchers

 avatar James Cloos avatar

because-transcripts's Issues

Transcript name issues

  1. Compare should be case insensitive (Daniel should be the same as DANIEL)
  2. NAME and NAME probably should be parsed properly
  3. Episode 37 has a speaker So what I want to ask here is because there's a daniel line that starts with that. (line 751 in the transcript)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.