Code Monkey home page Code Monkey logo

drake's Introduction

Drake Equation Calculator

Estimate the number of detectable alien civilizations in the Milky Way using the Drake Equation.

About

This project was created as part of the course, Principles and Practices in Science Education, at the University of Toronto with the intention of being a free resource for educators to introduce the Drake Equation to a wider audience.

The questions for the Drake Equation on the survey are from LoPresto and Hubble-Zdanowski (2012).

Running locally

By default, the project runs on port 8080: http://localhost:8080/drake/.

With Docker Compose

docker compose -f server-compose.yaml up -d --build server

With Go

go mod tidy
go run cmd/server/main.go

Two databases are supported SQLite (default) and PostgreSQL. For PostgreSQL, you have to set the following environmental variables:

POSTGRES_USER=%your db user%
POSTGRES_PASSWORD=%your db password%
POSTGRES_HOSTNAME=%your db hostname%
POSTGRES_DB=%your db name%

Adding a new language

Add the language go to translations.go

For Spanish, for example:

//go:generate gotext -srclang=en update -out=catalog.go -lang=en,pt-BR,es github.com/louisbranch/drake/cmd/server

Then run:

go generate translations/translations.go

A new file for the language will be created at translations/locales.

Copy the source file for the one containing the translated messages:

cp translations/locales/es/out.gotext.json translations/locales/es/messages.gotext.json

After translating the messages in messages.gotext.json, run the generator again to update the language catalog:

go generate translations/translations.go

Finally, for the language to appear on the website, add the new language to the server.

drake's People

Contributors

louisbranch avatar

Watchers

 avatar

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.