This App was built using React, Redux, Node, Express and Sequelize with PostGres.
The app is structured in two main parts, api, which is the backend, and client, which is the front end
The main code of api is in the folder src, which is in turn divided in three folders:
- models
- routes
- controllers
Here is where all the app models or tables are defined using Sequelize, there are two basic models Country and Activity
The Country model keeps all countries where activities are held, including information such as Name, Continent, Sub region, Area, Flag, etc
This model keeps track of all the activities there are, it includes information such as name, type (which can be Skiing, Bungee, canooing, etc.)
In controllers we can find all enpoints that perform actions on the database.
Activity.Controllers have endpoints like addActivity, that as the name implise, adds activities to the model Activity, and Country.Controller that has all country methods needed
It will tell us of all the routes to controller methods, and the type of endpoints: get, post, put or delete
In the client part we find all the components that render the info on the front end
There is the src folder, which in turns has the components, and the redux folder
Each component is accompanied by its CSS own style module, the project uses styled components
Here we can find all redux related folders, actions, reducers and store.
We use action creators for all method that will affect the redux state, methods such as fetchCountriesRequestActn, then fetches all countries and load the into the redux state
We use only one reducer, and one store
The app loads all the countries from an external API named REST Countries, then, there's a button to save all countries and activities created to a Postgres database named countries