Climate Watch South Africa Country Platform
# Climate Watch - South Africa Platform
Table of Contents:
- Starter kit
- Local Setup
- Modules
## Starter-kit
This repo is a fork from the project boilerplate of cw-projects so please remember to keep it updated on bugs fixes or features adds.
## Local setup
### Installing dependencies
```
yarn install
```
and then
```
gem install bundler
bundle install
```
These will satisfy both the frontend and backend's dependency requirements.
#### Setting up the Rails environment
Copy the sample `.env.sample` file to `.env` and modify it as needed to fit the
project's settings. At the very least you'll need to have the `DATABASE_URL`
env variable.
```
DATABASE_URL=postgresql://postgres@localhost/cw-south-africa_development
```
#### Setting up the database
```
bundle exec rails db:create
bundle exec rails db:migrate
```
These will create the development database and then run the database migration tasks.
### Launching The App
You'll need to run both the rails server and the webpack server, which will be used internally by rails. Run, separately:
```
bundle exec rails s
```
and
```
yarn start
```
Point your browser to `
localhost`. Ta-da!
### Launching the app with docker
```docker-compose up```
Ta-da!
## Frontend Architectural choices
The fronted uses react, redux and redux-router-first.
There are some peculiarities in the architectural choices that we will outline in this section.
## Router
Interesting read about motivation to use it.
- Routes are defined as another reducer
- Navigation are just actions
- You can grab the piece of state from the url that you need in any component
- Seamless code splitting using react-universal-component
- Routes are defined as a data-structure instead of using `jsx` inside the `routes.js` file.
- All of the router data will be located in the `location` store.
## Modules
Perhaps the bigger peculiarity is the module based architecture. What a module architecture means is that all the elements that are …