Coder Social home page Coder Social logo

cookiescrumbs / lets-fish Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 393.86 MB

A website for finding places to go fly fishing

Home Page: https://lets.fish

Ruby 44.16% JavaScript 8.77% CSS 5.41% HTML 34.58% Python 0.13% TypeScript 5.79% SCSS 1.13% Procfile 0.02%

lets-fish's Introduction

Codeship Status for cookiescrumbs/lets-fish

Let's Fish

A website for finding places to go fly fishing.

Getting your development machine setup

Install RVM

https://rvm.io/

Create a Ruby environment using RVM

http://stackoverflow.com/questions/15212104/ruby-openssl-issues-on-mac

This is a fix for the openssl problem with RVM compiled rubies

rvm get stable
brew install libyaml
rvm pkg install openssl
rvm osx-ssl-certs update all
rvm install ruby-2.3.1 --with-openssl-dir=$HOME/.rvm/usr --disable-binary

Install bundler to manage dependencies

gem install bundler

Create the repository locally

git clone https://github.com/cookiescrumbs/lets-fish.git

Install rails and other dependencies

bundle install

Setting up your Postgres DB

Install Postgres via brew
psql --version
brew install postgresql
initdb /usr/local/var/postgres
pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start

May need to symlink the socket for postgres

mkdir /var/pgsql_socket/ 
ln -s /private/tmp/.s.PGSQL.5432 /var/pgsql_socket/

More information about installing Postgres for Rails

Start Postgres
bundle exec rake pg_db:start

or for postgresql installed via Brew

brew services start postgresql
Create development and test db
bundle exec rake pg_db:create_development #create and load the dev db
bundle exec rake pg_db:create_test #create and load the test db
Add some development data to your database
bundle exec rake pg_db:restore #Restore development db (data only) from /db/pg_backups (using "live" data)
Setup Heroku

Download the toolbelt

heroku git:remote -a lets-fish #add Heroku remote to git repo

Restore DB from dump

pg_restore  --verbose  --no-acl --no-owner -h localhost --data-only -d lets_fish_development ~/Desktop/lets-fish-22-37.dump
rake pg_db:restore  # Restore development db (data only) from /db/pg_backups

Use rake pg_db:restore locally to add test data to your dev app. It grabs the data from from /db/pg_backups. I'll periodically backup the directory with live data. So you should have somthing similiar to "live".

Removes DB config

Removed so I can run the app in production on my dev machine without having to alert this file or worry about it. I can precompile my production assets and debug locally.

RAILS_ENV=production bundle exec rake assets:clobber
RAILS_ENV=production bundle exec rake assets:precompile

Example /config/database.yml

test: &test
  adapter: postgresql
  encoding: unicode
  database: lets_fish_test
  username: stevencook
  password:
  pool: 5
  timeout: 5000

development:
  adapter: postgresql
  encoding: unicode
  database: lets_fish_development
  username: stevencook
  password:
  pool: 5
  timeout: 5000

production:
  adapter: postgresql
  encoding: unicode
  database: lets_fish_development
  username: stevencook
  password:
  pool: 5
  timeout: 5000

Running Let's Fish locally

Install the Foreman gem

gem install foreman

create a .env file for running locally

RAILS_SERVE_STATIC_FILES=false
RAILS_ENV=development
RACK_ENV=development
AWS_ACCESS_KEY_ID=xxxxxxxx
AWS_REGION=eu-west-1
AWS_SECRET_ACCESS_KEY=xxxxxx
S3_BUCKET_NAME=lets-fish
S3_REGION=eu-west-1
ASSET_HOST=dur8xuaowfaya.cloudfront.net
SECRET_KEY_BASE=xxxxxx
GEOGRAPH_API_KEY=xxxxx
DARK_SKY_API=xxxxx
GOOGLE_API_KEY_BROWSER=xxxxxx
INSTAGRAM_API_KEY=xxxx

Start Redis

redis-server /usr/local/etc/redis.conf

Start DB

rake pg_db:start

Start let's fish, run foreman from the root folder

foreman start

Foreman will pick up the .env file :)

Alt text

Member when the assest pipeline couldn't find assets like Fonts? Member?

Asset pipeline

Member to use asset_path () and change the css file from .css to .css.erb

@font-face {
    font-family: 'Glyphicons Halflings';
    src: url(<%= asset_path 'glyphicons-halflings-regular.eot' %>);

Domain Model

Domain model

App requirements

proj is used to calculate and convert the lat,lng from a OS grid ref. It is a requirement of the global_convert gem, which is a requirement of the Northern Pike gem.

```brew install proj``

lets-fish's People

Contributors

cookiescrumbs avatar daniel-ellis avatar dependabot[bot] avatar jamesruston avatar

Watchers

 avatar  avatar

lets-fish's Issues

Add the season period to waters

The model has a season field ready to use. Need to add a data picker into the water form to enable users to pick a start and an end date.

Amazon keys

What's the best way to handle production and development keys. At the moment the same key is used for production and development.

Model prices

Model Prices and create has_many relationship with Waters

Result card Icons

Geocoder as background process

reverse_geocoded_by :latitude, :longitude
Should be added as a background process rather than when a new water is added.
Timeout of external services is a problem.

Water type

Need to add a type of water.

Stillwater or River

Structured data

Create json-ld structured data for search results.

Here's something minimal:
https://gist.github.com/tfgrahame/0df4e51711e44e71f7c8

This adds coordinates:
https://gist.github.com/tfgrahame/47a7a502426709ca4419
You can get them from GeoHack, which is a wikipedia thing: https://tools.wmflabs.org/geohack/geohack.php?pagename=Cow_Green_Reservoir&params=54_40_5_N_2_18_30_W_type:waterbody_region:GB
If you put a sameAs property in, then feasibly you could map to entities in the Knowledge graph API

Some things aren't in Wikipedia, but they still have coordinates and Google maps
https://gist.github.com/tfgrahame/53a8594a1b76941369bf
And Geohack:
https://tools.wmflabs.org/os/coor_g/?pagename=List_of_lochs_of_Scotland&params=NR540852_region%3AGB_scale%3A25000

But I think you need to be focussing on the business and offers:
https://gist.github.com/tfgrahame/c74e53f9fa47ddc01459
Note areaCovered and the hasOfferCatalog.

Also found this, of interest:
http://gateway.snh.gov.uk/pls/apex_cagdb2/f?p=111:1000:16005290815488

Add a water location

Add a water location to the water table. Currently hard coded as "Settle, North Yorkshire".

Water image

Admin needs away of uploading an image of a water.

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.