-
Notifications
You must be signed in to change notification settings - Fork 0
Update README.md #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Haothai1
wants to merge
3
commits into
main
Choose a base branch
from
Haothai1-patch-1
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 2 commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,8 +4,27 @@ | |
|
||
1. Install Ruby `3.2.1`. | ||
2. Create `.env` file in root folder of the project. | ||
2. Install [PostgreSQL](https://www.postgresql.org/download/) `>=14.13`. | ||
3. Add corresponded env vars to `.env` file with DB credentials. E.g.: | ||
3. Install [PostgreSQL](https://www.postgresql.org/download/) `>=14.13`. | ||
''' | ||
sudo apt update | ||
sudo apt install postgresql-14 | ||
''' | ||
4. Create PostgreSQL user and set password: | ||
''' | ||
sudo -u postgres psql | ||
''' | ||
''' | ||
CREATE USER healthkeeper WITH PASSWORD 'magic'; | ||
''' | ||
''' | ||
ALTER USER healthkeeper CREATEDB; | ||
''' | ||
6. Quit postgres | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This seems to be a sub-item of |
||
''' | ||
\q | ||
''' | ||
|
||
7. Add corresponded env variables to `.env` file with DB credentials. E.g.: | ||
``` | ||
HEALTHKEEPER_DEVELOPMENT_DATABASE = "healthkeeper_development" | ||
HEALTHKEEPER_DEVELOPMENT_DATABASE_USERNAME = "healthkeeper" | ||
|
@@ -16,11 +35,37 @@ HEALTHKEEPER_TEST_DATABASE_USERNAME = "healthkeeper" | |
HEALTHKEEPER_TEST_DATABASE_PASSWORD = "magic" | ||
``` | ||
4. Run `./bin/bundle install` | ||
5. Run `rails db:setup`. | ||
6. In order to recreate DB run `rails db:reset`. | ||
7. In order to (re)populate DB with a testing data run `rails db:seed`. | ||
8. To run Rails server use `./bin/dev` instead of `rails s`/`rails server` (see [next chapter](#bootstrap-and-tailwindCSS) if curious why). | ||
6. Run `rails db:setup`. | ||
7. In order to recreate DB run `rails db:reset`. | ||
8. In order to (re)populate DB with a testing data run `rails db:seed`. | ||
9. Run 'rails db:migrate' | ||
10. To run Rails server use `./bin/dev` instead of `rails s`/`rails server` (see [next chapter](#bootstrap-and-tailwindCSS) if curious why). | ||
|
||
# Troubleshooting | ||
1. ActiveRecord::DatabaseConnectionError: There is an issue connecting to your database with your username/password, username: healthkeeper. (ActiveRecord::DatabaseConnectionError) | ||
Edit the PostgreSQL authentication configuration: | ||
''' | ||
sudo nano /etc/postgresql/14/main/pg_hba.conf | ||
''' | ||
Make sure all content is all the same: | ||
''' | ||
# PostgreSQL Client Authentication Configuration File | ||
# =================================================== | ||
|
||
# TYPE DATABASE USER ADDRESS METHOD | ||
|
||
# Database administrative login by Unix domain socket | ||
local all postgres peer | ||
|
||
# "local" is for Unix domain socket connections only | ||
local all all md5 | ||
|
||
# IPv4 local connections: | ||
host all all 127.0.0.1/32 md5 | ||
|
||
# IPv6 local connections: | ||
host all all ::1/128 md5 | ||
''' | ||
### Bootstrap and TailwindCSS | ||
As we have both Bootstrap and TailwindCSS installed inside the project we need to split them somehow. | ||
> Thus, to utilize TailwindCSS make sure that you use the classes with the prefix. | ||
|
@@ -50,4 +95,4 @@ TODO | |
- [x] Authorization. | ||
- [x] Role management. | ||
- [x] Tune role policies. | ||
5. [ ] Wrap an app in Docker. | ||
5. [ ] Wrap an app in Docker. |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works only on Debian-based Linux distributions like Ubuntu, Linux Mint, and Debian itself.
I suggest to either add other options (e.g. for Mac/Windows) or just point that this is only for Debian-based distributions.