retromeet / core

This is the core API of RetroMeet, an open-source dating app
https://join.retromeet.social
GNU Affero General Public License v3.0
0 stars 0 forks source link
dating retromeet

RetroMeet

RetroMeet is a free, open-source dating and friend-finding application. RetroMeet has a philosophy of giving more space to give more information about yourself and to help find people who share common interests with you. The whole philosophy of RetroMeet is described in the philosophy.

This repository contains the RetroMeet core. This component provides an API to access the app functionalities without any external interface.

Development

RetroMeet is written in Ruby. Currently, instructions are only available to run RetroMeet without any kind of virtualization. Feel free to submit a PR to add to our instructions ;)

Linting

We use Rubocop for linting. To make your experience easier, it's recommended that you enable rubocop in your IDE, depending on your IDE the way to do that might be different, but most of the Ruby Language servers support rubocop, so you should be able to enable it whether you're using NeoVim or VScode.

There's a pronto github action running on each pull request that will comment on any forgotten lint issues. You can also get ahead of it by enabling lefthook, you can do it by running locally: lefthook install --force. The --force is optional, but will override any other hooks you have in this repo only, so it should be safe to run. This will run pronto any time you try to push a branch.

Setup

RetroMeet requires Postgresql >= 16.0 (it might work with a lower version than that, but it is not guaranteed).

First, we need to set up the database. RetroMeet uses rodauth, the following instructions will create the needed users, database and extensions needed for roda.

  1. Create two users:
    createuser -U postgres retromeet
    createuser -U postgres retromeet_password
  2. Create the database:
    createdb -U postgres -O retromeet retromeet_dev
  3. Load the citext extension:
    psql -U postgres -c "CREATE EXTENSION citext" retromeet_dev
  4. Give the password user temporary rights to the schema:
    psql -U postgres -c "GRANT CREATE ON SCHEMA public TO retromeet_password" retromeet_dev

Then, you need to run the following command so that the database set up:

rake db:setup

Finally, you need to revoke the temporary rights:

psql -U postgres -c "REVOKE CREATE ON SCHEMA public FROM retromeet_password" retromeet_dev

The same setup needs to be done for the test database, replacing retromeet_dev for retromeet_test:

createdb -U postgres -O retromeet retromeet_test
psql -U postgres -c "CREATE EXTENSION citext" retromeet_test
psql -U postgres -c "GRANT CREATE ON SCHEMA public TO retromeet_password" retromeet_test
RACK_ENV=test rake db:setup
psql -U postgres -c "REVOKE CREATE ON SCHEMA public FROM retromeet_password" retromeet_test

Database migrations

While working on the project, you might pull a newer version of main or merge a newer version of main into your branch which contains database modifications. To bring your database to the latest version, you need to migrate your database. You can do so by running:

bundle exec rake db:migrate

You need to do it for your test environment too, but you need to prepend the command with the variable that controls the environment:

APP_ENV=test bundle exec rake db:migrate

Running tests

You can run all tests with:

bundle exec rake test

Or a single test by running it directly:

bundle exec ruby test/to/run.rb