JNPLZ / speakerinnen_liste

International Women* Speaker Directory

Home Page: https://speakerinnen.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Build Status Code Climate

About speakerinnen.org

speakerinnen.org is a searchable web directory designed specifically for women conference speakers. Women speakers are encouraged to sign up and provide professional information, including their area of expertise, any previous conferences they've presented at, contact details, etc.

The aim of the app is to provide a way for conference and event organizers to find and contact appropriate women speakers. (But obviously there are many different contexts in which it can be used...)

Getting Started (Initial Setup)

  1. Clone the repository: git clone git@github.com:rubymonsters/speakerinnen_liste.git and access the folder: cd speakerinnen_liste. (If you have cloned the repository before and there is still an .env file, delete it.)
  2. Copy the file database.yml.sample and name it database.yml inside the config folder. (The sample-file is a placeholder showing the standard usecase. The file database.yml is for individual usage and changes and is ignored by git.)
  3. If you don't have Docker Engine installed, please download it here for your operating system.
  4. Run make setup (builds images, installs gems, creates and migrates the database).
  5. Run make seed (seeds database with example profiles and indexes them in Elasticsearch).

Local development with Docker (default)

  • make dev (opens a development shell, rake, bundle or rails commands will work here)
  • make up (starts the app directly)
  • make stop (stops the container)
  • make test (runs all the tests)
  • make usage (get a list of possible commands)

Local development without Docker (this is a workaround)

You need to define DATABASE_URL to point to your local Postgres and SEARCHBOX_URL to point to your local Elastic (Make sure those are set up with the right versions, etc.):

This command for example runs the tests directly on your machine using the local postgres and elastic:

$ DATABASE_URL=postgres://127.0.0.1/ SEARCHBOX_URL=http://127.0.0.1:9200/ bundle exec rspec

This matches our settings in config/database.yml, but if you have different user, password or db name you can put all that in DATABASE_URL as explained here: https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNSTRING. Or you comment out host, username and password in your config/database.yml.

Issues you might run into:

  1. Docker might create files in tmp that the process in your machine can't overwrite. Do sudo rm -rf tmp to delete.
  2. Rails can't write to log/test.log and might print to screen instead. To delete do: sudo rm -rf log/
  3. If you have problem with bundle install, throw away the Gemfile.lock and re-run the command.

Admin user

If you build or test admin features, you can use the test admin user to test those. The admin user can be found in db/seeds.rb.

Alternatively, assign the admin status to another user via the rails console:

# Open a dev shell
$ make dev

# Log into the rails console
$ bundle exec rails c

# Inside the rails console
user = Profile.find(<your-profile-id>)
user.admin = true
user.save

# Verify your user admin status
user.valid?

# => true

Testing

First, open a dev shell by running make dev.

# Run all tests of the project (same as running `make test`)
$ bundle exec rspec spec

# If the tests are still failing, run:
$ bundle exec rake db:test:clone

# If tests are still failing, run:
$ rails db:test:prepare

# Run tests excluding elasticsearch specs, so without a running elasticsearch server
$  bundle exec rspec spec --tag '~elasticsearch'

Please use Rubocop

# Open a dev shell
$ make dev
# Run rubocop and correct all errors it finds
$ rubocop -a

Database:

Our database schema looks like that:

db

Metrics

For seeing our metrics we use the free community edition of honeyycomb ( https://ui.honeycomb.io/login ) More infos how to use this: https://docs.honeycomb.io/beeline/ruby/

Report Errors

We are using sentry. heroku addons:open sentry --app speakerinnen-liste

Deployment

We use Heroku to deploy.

Contributing

Do you want to contribute?

If you want to contribute, you can get an overview over the open issues on our Project Management Board and via rubymonsters#216.

We are happy to answer your questions if you consider to help. All the issues have a link to their specification. If you want to work on an issue feel free to assign yourself.

Find further details in CONTRIBUTING.md.

#Troubleshooting

Docker

Use upgraded Postgres or Elasticsearch version in Docker

If Postgres or Elasticsearch got upgraded in the docker-compose file, you need to delete all processes, images and volumes that still use the older version:

  1. Use make tear-down to delete all processes and images

  2. Delete all your local volumes inside Docker as well. (Otherwise you will get a DB connection error) Check for your speakerinnen volumes in Docker: docker volume ls Ouput will be a list of volumes, pick all the speakerinnen ones (Postgres, Elasticsearch, Bundle) and delete them (adjust the name if yours is different):

    docker volume rm speakerinnen_liste_postgres_data

    docker volume rm speakerinnen_liste_bundle

    docker volume rm speakerinnen_liste_elastic_data

  3. make setup to recreate all images, processes and volumes.

  4. make seed to populate the volumes.

Developing on a Mac with Apple Silicon chip

To be able to run the project on a Silicon chip, please make the following adjustments:

  1. In docker-compose.yml, use an ARM specific image of postgres for the database, e.g.
services:
  db:
    image: arm64v8/postgres:13.5
  1. In docker-compose.yml, add the platform specification to the web environment
  web:
    platform: linux/amd64
  1. In config/environments/development.rb, exclude the following line by using a comment
# config.file_watcher = ActiveSupport::EventedFileUpdateChecker

♥ Code of Conduct

Please note that speakerinnen has a Contributor Code of Conduct based on the Contributor Covenant. By participating in this project online or at events you agree to abide by its terms.

About

International Women* Speaker Directory

https://speakerinnen.org

License:MIT License


Languages

Language:HTML 46.6%Language:Ruby 44.0%Language:JavaScript 4.3%Language:SCSS 4.1%Language:CSS 0.7%Language:Makefile 0.3%Language:Dockerfile 0.0%Language:Procfile 0.0%