Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jwarwick/info_gather
Elixir web app using Dynamo and Ecto
https://github.com/jwarwick/info_gather
Last synced: about 6 hours ago
JSON representation
Elixir web app using Dynamo and Ecto
- Host: GitHub
- URL: https://github.com/jwarwick/info_gather
- Owner: jwarwick
- Created: 2013-08-27T02:55:43.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2015-08-25T22:28:23.000Z (about 9 years ago)
- Last Synced: 2023-04-13T20:27:16.907Z (over 1 year ago)
- Language: JavaScript
- Size: 289 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# InfoGather
This is a project built with Elixir that uses Dynamo to serve web requests and Ecto
to interface with Postgres.To setup:
* `mix deps.get`
* `mix db.create`
* `mix db.seed`
* `mix server` to start the webserver## Postgres Setup
This application assumes Postgres is configured properly.
You must have either `DATABASE_URL` (Heroku style) defined to reference the database to
use or have a local postgres install with the current user having privleges on the database `infogather`.``` sql
CREATE DATABASE infogather;
```
To connect to a Heroku database of a deployed application, use `heroku pg:psql --app `
There is a mix helper defined to create the required tables. Run `mix db.create`.
## Postgres Commands
Some postgres commands that are useful
* `psql ` to connect to the database
* `\dt` list tables
* `\q` to close the connectionUseful sql
```SELECT * FROM BUS;
INSERT INTO bus (name) VALUES ('A New bus');
INSERT INTO classroom (grade_level, name) VALUES (1, 'First Grade, Teacher C');
UPDATE bus SET name = '--None--' WHERE id = 1;
DELETE FROM data; -- deletes all rows from table
DELETE FROM bus WHERE id = 22; -- delete an individual row
DROP TABLE bus; -- delete the table```
## Environment Variables
Define the following environment variables to enable certain features
* `SENDGRID_USERNAME` and `SENDGRID_PASSWORD`: to send email using the Heroku SendGrid Addon
* `NOTIFY_EMAIL_TO` and `NOTIFY_EMAIL_FROM`: also need to be defined to use the SendGrid Addon
* `SUPPORT_EMAIL`: if defined, adds a line of help text with a `mailto` link in to the top of the page