You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add Makefile & streamline development documentation (#718)
* Remove unused file
* Remove unused localtunnel
* Add a makefile with useful commands
Update the README, it's gotten a bit convoluted over time and some
docker docs were missing
* Add rails console to make file
* Add step to seed DB
Copy file name to clipboardexpand all lines: README.md
+31-46
Original file line number
Diff line number
Diff line change
@@ -6,23 +6,26 @@
6
6
7
7
Flaredown makes it easy for people to track symptoms over time, and learn how to control them. Our goal is to analyze the aggregate data from users of this tool to understand the probable effects of treatments and environmental stressors on chronic illness.
8
8
9
-
Help would be appreciated! Please join us in [slack #flaredown](https://rubyforgood.herokuapp.com/) or raise a github issue, or email the contact@flaredown email which is currently checked every few days.
9
+
Help would be appreciated! Please join us in [slack #flaredown](https://rubyforgood.herokuapp.com/), raise a GitHub issue, or email <contact@flaredown>.
All dependencies are dockerized, including the application and can be run using `docker compose` so there's no dependencies to install other than docker.
21
+
The application and all dependencies are dockerized and can be run using `docker compose`, so there's no dependencies to install other than Docker.
22
+
Alternatively, you can run the app using the `make` commands available: `make help`
22
23
23
24
If you want to run the application on your own machine see the next sections on dependency installations
24
25
25
-
### Mac
26
+
### Running natively
27
+
28
+
#### Mac Prerequisites
26
29
27
30
_If you are running on an M1 mac, run the following command before you start the installation process:_
28
31
```bash
@@ -34,9 +37,13 @@ _Remove all gems before you proceed_
34
37
gem uninstall -aIx
35
38
```
36
39
37
-
### Backend
40
+
#### Backend
41
+
42
+
You can install the dependencies via [asdf-vm](https://asdf-vm.com/) declared in the `.tool-versions` file, or:
43
+
-[Ruby Version Manager](https://rvm.io/)
44
+
-[MongoDB installation on OSX](https://docs.mongodb.com/manual/tutorial/install-mongodb-on-os-x/)
38
45
39
-
On macOS, you can install libpq by running `brew install libpq && brew link --force libpq && bundle config --local build.pg "--with-ldflags=-L$(brew --prefix libpq)/lib --with-pg-include=$(brew --prefix libpq)/include"`, which is required for `bundle install` to succeed.
46
+
On macOS, you can install `libpq` by running `brew install libpq && brew link --force libpq && bundle config --local build.pg "--with-ldflags=-L$(brew --prefix libpq)/lib --with-pg-include=$(brew --prefix libpq)/include"`, which is required for `bundle install` to succeed.
40
47
41
48
```bash
42
49
cd backend
@@ -52,70 +59,48 @@ bundle exec rake app:setup
52
59
gem install foreman
53
60
```
54
61
55
-
### Frontend
62
+
####Frontend
56
63
57
64
```bash
58
65
cd frontend
59
66
npm install
60
67
```
61
68
62
-
### React Native
69
+
####React Native
63
70
64
71
```bash
65
72
cd native
66
73
npm install
67
74
```
68
75
69
-
## Running / Development
70
-
71
-
### General
72
-
It is necessary to populate environment parameters. You can take `backend/env-example` and add it to a new file in `backend/.env` and `frontend/.env`. You'll need to create a [Facebook dev app](https://developers.facebook.com/docs/development/create-an-app) and paste your own ID the frontend env file's `FACEBOOK_APP_ID` parameter. This is not necessary in the backend env but we have not yet cleaned up these two files into the necessary components.
73
-
74
-
### Docker
75
-
76
-
From the project root:
77
-
78
-
```bash
79
-
docker compose --profile dev up
80
-
```
81
-
82
-
This will build and run all the containers necessary to run the application locally.
83
-
84
-
Visit your app at [http://localhost:4300](http://localhost:4300)
76
+
## Development
85
77
78
+
### Prerequisites
86
79
87
-
### Docker (React Native)
80
+
- Populate the necessary environment parameters with `cp backend/env-example backend/.env && cp backend/env-example frontend/.env`
81
+
- Create a [Facebook dev app](https://developers.facebook.com/docs/development/create-an-app) and paste your own ID into `frontend/.env` file's `FACEBOOK_APP_ID` parameter.
82
+
- Note: This is not necessary in `backend/.env` but we have not yet cleaned up these two files into the necessary components.
83
+
- Seed your database using `make seed` or `bundle exec rails app:setup`
88
84
89
-
From the project root:
85
+
### Running
90
86
91
-
```bash
92
-
docker compose --profile dev native
93
-
```
94
-
95
-
This will build and run all the containers necessary to run the application locally.
96
-
97
-
Visit your app at [http://localhost:19006](http://localhost:19006)
98
-
99
-
### Local Machine Installation
100
-
101
-
From the project root:
102
-
103
-
```bash
104
-
docker compose up
105
-
```
87
+
If you are running the application natively, run the following to start your server. If you're using docker, this should be up and running already.
106
88
107
89
```bash
108
90
rake run
109
91
```
110
92
93
+
Visit your app at [http://localhost:4300](http://localhost:4300) for the current ember application, or [http://localhost:19006](http://localhost:19006) for the React Native version.
94
+
111
95
## Running tests locally
112
-
1. Run `docker compose build backend` to ensure the latest backend is being run
113
-
2. To run all tests run `script/backend rspec spec spec`, or you can run a specific test suite such as `script/backend rspec spec spec/services/weather_retriever_spec.rb `
96
+
97
+
1. Run `make build` or `docker compose build backend` to ensure the latest backend is built and being run
98
+
2. To run all tests run `make specs` or `script/backend rspec spec spec`, or you can run a specific test suite such as `script/backend rspec spec spec/services/weather_retriever_spec.rb `
114
99
3. Debugging tip: in Ruby code you can add a line that says `debugger` and rspec will automatically break on that line and give you an interactive Ruby shell
115
100
116
101
## CI
117
102
118
-
Several checks are configured to run on all commits using Github Actions, including lint, build and test steps. Definitions can be found in [./github/workflows](./github/workflows). Those checks which always run are required to be successful for PRs to be mergable.
103
+
Several checks are configured to run on all commits using GitHub Actions, including lint, build and test steps. Definitions can be found in [./.github/workflows](./.github/workflows). Those checks which always run are required to be successful for pull requests to be merged.
119
104
120
105
## Deployment
121
106
@@ -136,6 +121,6 @@ Addons are used for Heroku Postgres, Heroku Redis, Heroku Scheduler + Papertrail
136
121
* On first load, the app displays a blank beige screen instead of the login screen. Temporary fix is to add `console.log(process.env.FACEBOOK_APP_ID)` right inside of the module.exports at the top of the `frontend/config/environment.js` file. You can then refresh the page (no need to kill Docker) and this should fix it. You can now remove the log.
137
122
138
123
## License
139
-
Copyright 2015-2017 Logan Merriam and contributors.
124
+
Copyright 2015-2024 Logan Merriam and contributors.
140
125
141
126
Flaredown is open source software made available under the GPLv3 License. For details see the LICENSE file.
0 commit comments