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
{{ message }}
This repository was archived by the owner on Aug 12, 2020. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+55-13
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,22 @@ This is the codebase for the JustFix.nyc platform, including the Tenant Webapp,
4
4
5
5
This guide assumes that you are using a [UNIX](http://i.imgur.com/uE6fkx7.gif) system (most likely macOS), but everything is available on Windows if you follow the appropriate guides thru the links below.
6
6
7
+
There are two ways to get started. Both require a bit of common setup.
2. You should have a `development.js` copy from me. (If not, email me at [[email protected]](mailto:[email protected])). Place that file in `config/env`.
18
+
19
+
Now you have the option to set up and run everything locally, or use Docker.
20
+
21
+
### Option 1: Run everything locally
22
+
7
23
#### Build tools and languages
8
24
9
25
0. Open terminal. Some of these steps may require `sudo` in order to install.
@@ -35,28 +51,20 @@ This guide assumes that you are using a [UNIX](http://i.imgur.com/uE6fkx7.gif) s
2. You should have a `development.js` copy from me. (If not, email me at [[email protected]](mailto:[email protected])). Place that file in `config/env`.
45
-
46
-
3. Use npm to install the needed back-end and buildtool libraries. It should trigger a `bower install` for front-end dependencies automatically. Make sure you're in the root directory for the project - i.e. the same level as the `package.json` file.
54
+
Use npm to install the needed back-end and buildtool libraries. It should trigger a `bower install` for front-end dependencies automatically. Make sure you're in the root directory for the project - i.e. the same level as the `package.json` file.
47
55
48
56
```
49
57
npm install
50
58
```
51
59
52
-
#### Regular use
60
+
#### Start everything up
53
61
54
62
1. To start, you'll need an active mongodb instance running. I like to do this in a folder within `app` - e.g. `app/mongodb` but it can be run globally or anywhere else.
55
63
56
64
```
57
65
mongod --dbpath . &
58
66
```
59
-
Open a new terminal window and make sure its running:
67
+
Open a new terminal window and make sure it's running:
60
68
```
61
69
ps aux | grep mongo
62
70
```
@@ -73,9 +81,43 @@ You should see the process running, as well as the `grep mongo` command process
73
81
grunt
74
82
```
75
83
76
-
3. Go to `http://localhost:3000` to see your development version! Grunt will watch for any changes you make to the code and automatically restart the server for live development.
84
+
### Option 2: Use Docker
85
+
86
+
1. Download [Docker Community Edition](https://www.docker.com/community-edition).
87
+
88
+
2. Run `bash docker-update.sh`.
89
+
90
+
Note that in the future, you'll want to run this whenever you update the repository or switch branches, too, to make sure you have all the latest dependencies.
91
+
92
+
3. Run `docker-compose up`.
93
+
94
+
### Visit your local server
95
+
96
+
Now that you've got everything up and running, go to `http://localhost:3000` to see your development version! Grunt will watch for any changes you make to the code and automatically restart the server for live development.
97
+
98
+
### Tips on using Docker
99
+
100
+
If you decided to go the Docker route but aren't very familiar with Docker, here are some tips.
101
+
102
+
#### Running command-line tools
103
+
104
+
If you ever want to run an individual command-line tool on the project, such as a specific grunt task or linter, you can dive into your Docker's main `web` container by running:
105
+
106
+
```
107
+
docker-compose run web bash
108
+
```
109
+
110
+
You will be in the container's `/tenants` directory, which maps to the root of your repository on your local machine.
111
+
112
+
Alternatively, you can run individual commands just by running `docker-compose run web <command name>`. Some people do this so often that they create a shell alias called `dcr` that's short for `docker-compose run`.
113
+
114
+
#### Uninstalling or starting from scratch
115
+
116
+
If you ever get your Docker setup into a weird state where nothing works, or if you're done with the project and want to free all resources used by Docker, run `docker-compose down -v`.
117
+
118
+
You'll then need to re-run `bash docker-update.sh` set everything up again.
77
119
78
-
####More Questions
120
+
### More Questions
79
121
80
122
Check out [MEAN.JS](http://meanjs.org/docs/0.3.x/) - will have more tutorials on the architecture setup and things for troubleshooting.
0 commit comments