2024-05-08 16:22:48 +02:00
16 changed files with 273 additions and 7 deletions

View File

View File

@@ -0,0 +1,11 @@
// Om iets met de database te doen, is het handig om een functie te maken
// die een `app` parameter en een `pool` parameter accepteert.
// Deze moet dan geëxporteerd worden om deze te kunnen gebruiken in `server.js`.
// Dit is een voorbeeld van hoe je dat zou kunnen doen:
// module.exports = function(app, pool) { ... }

25
code/web/server.js Normal file
View File

@@ -0,0 +1,25 @@
const mariadb = require('mariadb');
const express = require('express');
const app = express();
const serverPort = 3000;
const databaseCredentials = {
host: 'localhost',
user: 'fitbot',
password: 'fitbot123',
database: 'fitbot',
connectionLimit: 5,
allowUnauthorized: true
}
// Create connection pool
const pool = mariadb.createPool(databaseCredentials);
// Register incoming HTTP request handlers
require('incoming_request_handlers')(app, pool);
// Start server
app.listen(port, () => {
console.log(`Server running on port ${serverPort}`);
})

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

View File

@@ -15,11 +15,38 @@ Colors can be an effective way to influence emotions and feelings. They may infl
Red is an interesting color because it increases excitement, activity, aggression, bravery, and youthfulness. People associate the color red with boldness, fire, competition, love, energy, speed, power, youth, and so much more. These emotions are useful when developing a fitness app, but even a different shade of red affects emotions and effectiveness. Lighter shades highlight the energetic qualities of red. Darker shades emphasize power. This makes red a powerful color and for us and an interesting option because Strava, a fitness app focused on running, uses the same colors.
![palettes of red](redpalette.png)
<span style="color:ORANGE">
<strong> ORANGE: </strong>
</span>
Orange is a warm color that is a combination of red and yellow, making it a good middle ground between the two. Orange is an interesting color for our project because it promotes emotions like playful, warm, friendly, social, gregarious, cheerful, vibrant, confident, and successful. As we can see, there is a good balance of red and yellow emotions. People associate the color orange with extroversion, adventure, celebration, courage, confidence, good health, friendship, and success. This makes it a suitable choice for our project because it triggers most of the emotions we wanted. It is not as aggressive as red, but it basically has the same effect. Deeper oranges are warmer, while lighter tints make it feel more like yellow. We should consider orange for our app because it stimulates the desired emotions.
![palettes of orange](orangepalette.png)
<span style="color:yellow">
<strong> YELLOW: </strong>
</span>
Yellow belongs in the same park as red because they are both warm colors. Yellow boosts emotions such as warmth, cheerfulness, happiness, energy, clarity, and attention, making it a good choice for us to look at. People associate the color or yellow with. Sunshine, creativity, imagination, hope, joy, the future, and spirituality. The various shades affect yellow in different ways, and bright sharp yellows can be tiring and cause headaches. Lighter shades appeal to the happiness aspect, reminding users of summer and the sun. Darker shades, such as gold, add weight. This makes yellow an interesting color option for our app.
![palettes of yellow](yellowpalette.png)
<span style="color:green">
<strong> GREEN: </strong>
</span>
Green is on the opposite side of the spectrum from red and yellow. Green is a colder color, which gives it a different effect. Green enhances emotions such as restful, natural, stable, healthy, and prosperity. This can make it a viable option, especially because it gives people a sense of good health. People associate color green with. Freshness, ecology, nature, health, balance, fertility, growth, renewal, healing, money, and good luck. This is interesting because it not only provides people with the feeling of being healthy, but also of being outside in nature, which may help elderly people feel less isolated. However, the shades of green also make people feel different. Pale greens are soothing. Dark greens can improve concentration. However, because we do not rely on concetration, it will have little impact on our project.
![palletes of green](greenpalette.png)
<span style="color:BLUE">
<strong> BLUE: </strong>
</span>
Blue is also a colder color, so it takes the same path as green, giving it a more calming effect. However, it is not comparable to green because they influnce other emotions. Blue enhances emotions like calm, security, peace, patience, loyalty, trust, and sadness. It has the same soothing effect as green, but it does not give people the feeling of being healthy. It gives people trust and peace, which are interesting emotions, but they are not beneficial to us. People associate the color blue with stability, protection, trust, loyalty, patience, perseverance, security, peace, loyalty, sadness and depression, and masculinity. This further confirms that blue gives people a sense of security, which is not important for us because we want people to start exercising. Pale blue is cooling and relaxing, but it should not be used inappropriately because it can make people feel sad and depressed. Indigo is useful in situations where fear prevents activity. Indigo may be useful for a cool-down exercise or if someone is afraid of exercising.
![palletes of blue](bluepalette.png)
### Conclusion
We decided to go for
@@ -27,4 +54,6 @@ We decided to go for
# Source
https://eldertech.org/color-in-designing-technology-for-seniors/
https://eldertech.org/color-in-designing-technology-for-seniors/
https://decode.agency/article/choose-color-palette-for-apps/

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

View File

@@ -0,0 +1 @@
# Apache

View File

@@ -0,0 +1,47 @@
# Apache Setup on Raspberry Pi
Apache is a popular open-source web server that is widely used to serve web content. It is a powerful and flexible server that can be used to host websites, web applications, and more. In this guide, we will show you how to set up Apache on your Raspberry Pi. This will allow you to host your own websites and serve content to users on your local network or the internet.
## Prerequisites
Before you begin, you will need the following:
- A Raspberry Pi with Raspbian installed
- Access to the terminal on your Raspberry Pi
## Installation
### Step 1: Update the Package List
The first step is to update the package list on your Raspberry Pi. This will ensure that you have the latest information about available packages.
Run the following command to update the package list:
```bash
sudo apt update
```
### Step 2: Install Apache
Next, you will need to install the Apache web server on your Raspberry Pi. You can do this by running the following command:
```bash
sudo apt install apache2
```
During the installation process, you may be prompted to confirm that you want to install the packages. Type `Y` and press `Enter` to continue.
### Step 3: Verify the Installation
To verify that Apache has been installed correctly, you can open a web browser on your computer and enter the IP address of your Raspberry Pi in the address bar. If Apache has been installed successfully, you should see the default Apache web page.
For example, if the IP address of your Raspberry Pi is `145.92.8.132`, you would enter `http://145.92.8.132` in the address bar.
## Conclusion
You have successfully set up Apache on your Raspberry Pi. You can now host your own websites and serve content to users on your local network or the internet. If you have any questions or run into any issues, feel free to refer to the [Apache documentation](https://httpd.apache.org/docs/) for more information.
```

View File

@@ -1,3 +1,57 @@
# MariaDB
# MariaDB create database
MariaDB is a fork of MySQL and is a popular choice for database management systems. It is open-source and is widely used in web applications. MariaDB is a community-driven project and is developed by the original developers of MySQL. It is designed to be fully compatible with MySQL, meaning that it can be used as a drop-in replacement for MySQL.
In this guide, we will show you how to create a new database in MariaDB. This will allow you to store and manage data in a structured way.
## Prerequisites
Before you begin, you will need the following:
- A Raspberry Pi with Raspbian installed
- Access to the terminal on your Raspberry Pi
- MariaDB installed on your Raspberry Pi
If you have not already installed MariaDB, you can follow our guide on [how to install MariaDB on your Raspberry Pi](../mariaDB/mariaSetup.md).
## Step 1: Access the MariaDB Shell
The first step is to access the MariaDB shell. You can do this by running the following command in the terminal:
```bash
sudo mysql -u root -p
```
You will be prompted to enter the root password that you set during the MariaDB installation process.
## Step 2: Create a New Database
Once you are in the MariaDB shell, you can create a new database by running the following command:
```sql
CREATE DATABASE database_name;
```
Replace `database_name` with the name that you want to give to your new database.
For example, to create a database called `mydatabase`, you would run the following command:
```sql
CREATE DATABASE mydatabase;
```
## Step 3: Verify the Database Creation
To verify that the database has been created successfully, you can run the following command in the MariaDB shell:
```sql
SHOW DATABASES;
```
This will display a list of all the databases on your MariaDB server, including the one that you just created.
## Conclusion
You have successfully created a new database in MariaDB. You can now start adding tables and data to your database to store and manage information. If you have any questions or run into any issues, feel free to refer to the [MariaDB documentation](https://mariadb.com/kb/en/) for more information.

View File

@@ -1,4 +1,4 @@
# MariaDB
# MariaDB Setup on Raspberry Pi
MariaDB is a fork of MySQL and is a popular choice for database management systems. It is open-source and is widely used in web applications. MariaDB is a community-driven project and is developed by the original developers of MySQL. It is designed to be fully compatible with MySQL, meaning that it can be used as a drop-in replacement for MySQL.

View File

@@ -1,6 +1,4 @@
# NodeJs Setup
https://pimylifeup.com/raspberry-pi-nodejs/
# NodeJs Setup on Raspberry Pi
## Prerequisites

View File

@@ -0,0 +1 @@
# phpMyAdmin

View File

@@ -0,0 +1,100 @@
# phpMyAdmin setup on Raspberry Pi
phpMyAdmin is a free and open-source tool written in PHP that allows you to manage MySQL and MariaDB databases through a web interface. It provides an easy-to-use graphical interface for performing database operations such as creating, editing, and deleting databases, tables, and records.
In this guide, we will show you how to set up phpMyAdmin on your Raspberry Pi. This will allow you to manage your MySQL and MariaDB databases through a web browser.
## Prerequisites
Before you begin, you will need the following:
- A Raspberry Pi with Raspbian installed
- Access to the terminal on your Raspberry Pi
- MySQL or MariaDB installed on your Raspberry Pi
If you have not already installed MySQL or MariaDB, you can follow our guides on [how to install MySQL on your Raspberry Pi](../mysql/mysqlSetup.md) or [how to install MariaDB on your Raspberry Pi](../mariaDB/mariaSetup.md).
## Installation
### Step 1: Install phpMyAdmin
The first step is to install phpMyAdmin on your Raspberry Pi. You can do this by running the following command:
```bash
sudo apt install phpmyadmin
```
During the installation process, you will be prompted to select the web server that you are using. If you are using Apache, select `apache2` by pressing the `Space` key, then press `Tab` to select `OK` and press `Enter` to continue.
You will also be prompted to configure the database for phpMyAdmin. Select `Yes` and enter the root password for your MySQL or MariaDB server when prompted.
### Step 2: Configure phpMyAdmin
After installing phpMyAdmin, you will need to configure it to work with your web server. You can do this by running the following command:
```bash
sudo dpkg-reconfigure phpmyadmin
```
During the configuration process, you will be prompted to select the web server that you are using. If you are using Apache, select `apache2` by pressing the `Space` key, then press `Tab` to select `OK` and press `Enter` to continue.
You will also be prompted to configure the database for phpMyAdmin. Select `Yes` and enter the root password for your MySQL or MariaDB server when prompted.
### Step 3: Access phpMyAdmin
Once you have installed and configured phpMyAdmin, you can access it through a web browser. Open a web browser on your computer and enter the IP address of your Raspberry Pi followed by `/phpmyadmin` in the address bar.
For example, if the IP address of your Raspberry Pi is `145.92.8.132/phpmyadmin`, you would enter `http://145.92.8.132/phpmyadmin` in the address bar.
You will be prompted to enter the username and password for your MySQL or MariaDB server. Enter `root` as the username and the root password that you set during the installation process.
You should now see the phpMyAdmin login page, where you can log in and start managing your databases. If not, you may need to restart the Apache web server by running the following command:
```bash
sudo systemctl restart apache2
```
Check phpMyAdmin Configuration: Ensure that phpMyAdmin is correctly configured in Apache2. There should be a phpMyAdmin configuration file in the /etc/apache2/conf-enabled/ directory named phpmyadmin.conf. If it's not there, you can create a symbolic link to it with:
```bash
sudo ln -s /etc/phpmyadmin/apache.conf /etc/apache2/conf-enabled/phpmyadmin.conf
```
### Step 4: Log in to phpMyAdmin
Once you have restarted the Apache web server, you can log in to phpMyAdmin using the username `root` and the root password that you set during the installation process.
You should now see the phpMyAdmin dashboard, where you can manage your MySQL or MariaDB databases through a web interface.
If not you may need to change the port number in the phpMyAdmin configuration file. You can do this by editing the `config.inc.php` file located in the `/etc/phpmyadmin` directory:
```bash
sudo nano /etc/phpmyadmin/config.inc.php
```
Find the line that starts with `$cfg['Servers'][$i]['host']` and add the port number after the host name. For example, if your MySQL or MariaDB server is running on port `3306`, the line should look like this:
```php
$cfg['Servers'][$i]['host'] = 'localhost:3306';
```
Save the file and restart the Apache web server by running the following command:
```bash
sudo systemctl restart apache2
```
You should now be able to log in to phpMyAdmin using the username `root` and the root password that you set during the installation process.
## Conclusion
You have successfully set up phpMyAdmin on your Raspberry Pi. You can now use phpMyAdmin to manage your MySQL or MariaDB databases through a web interface. If you have any questions or run into any issues, feel free to refer to the [phpMyAdmin documentation](https://docs.phpmyadmin.net/en/latest/) for more information.