Global's views consists of 6 differents routes:
- Landing page '/': Introduction into the project and its tecnologies.
- Home '/home': Display of all the countries in the world. Filters to sort the countries based on name, population and/or continent. Searchbar for searching specific countries. Pagination for easy navigation.
- Country detail '/home/:id': Detail of an specific country, displaying more information about the country and its associated activities.
- Create activity '/home/createActivity': Controlled form to create touristic activities in the desired countries.
- Activities '/home/activities': Display of all the created activities in the database. Pagination for practical navigation.
- Activity detail '/home/activities/:activityId': Detail of an specific activity with all the information and the associated countries.
The countries data was extracted from the API and modified for practical uses. The database recieves this data and creates all the countries in the Country table. The activities get loaded into the database in the Activity table. The relation between Country and Activity is many to many, in the CountryActivity table.
The models and server request are fully tested using mocha. The react components are tested using supertest.
- First of all, you will need to have a text editor (VScode recomended).
- Then install Git and Node.js. If you have averything ready then open VScode and run in the terminal:
# Clone this repository
$ git clone https://github.com/Facundo-Romano/GlobalProject.git
- Inside the api folder, you will need to create a file named ".env" like this:
DB_USER= DB_PASSWORD= DB_HOST=
-
You will need to have PostgreSQL installed (learn how here).
-
If you already have PostgreSQL, create a new database called countries (learn how here, tip: scroll down to the section: Create Database using pgAdmin, it is the easier one).
-
Inside your .env file complete DB_USER with your postgreSQL user and DB_PASSWORD with your postgreSQL password (not the pgAdmin password). Complete DB_HOST with localhost.
-
Now that everything is completed you can start the app. In the terminal run the following commands:
# Go into the api folder
$ cd api
# Install dependencies
$ npm install
# Run the backend
$ npm start
# Open new terminal
$ cd client
# Install dependencies
$ npm install
# Run the frontend
$ npm start
- If there is any problem feel free to contact me.