docs: add gitlab issue templates, code of conduct and contributing files

- update prettier config for markdown file for better readability
- fix some formatting issues
This commit is contained in:
Yassine Doghri 2020-10-12 14:47:21 +00:00
commit 4101ef47ad
9 changed files with 467 additions and 57 deletions

View file

@ -14,11 +14,15 @@
## Introduction
Castopod is a web app based on the `php` framework [CodeIgniter 4](https://codeigniter.com).
Castopod is a web app based on the `php` framework
[CodeIgniter 4](https://codeigniter.com).
To setup a dev environment, we use [Docker](https://www.docker.com/). A `docker-compose.yml` and `Dockerfile` are included in the project's root folder to help you kickstart your contribution.
To setup a dev environment, we use [Docker](https://www.docker.com/). A
`docker-compose.yml` and `Dockerfile` are included in the project's root folder
to help you kickstart your contribution.
> Know that you don't need any prior knowledge of Docker to follow the next steps. However, if you wish to use your own environment, feel free to do so!
> Know that you don't need any prior knowledge of Docker to follow the next
> steps. However, if you wish to use your own environment, feel free to do so!
## Prerequisites
@ -30,7 +34,8 @@ To setup a dev environment, we use [Docker](https://www.docker.com/). A `docker-
git clone https://code.podlibre.org/podlibre/castopod.git
```
2. Create a `.env` file with the minimum required config to connect the app to the database:
2. Create a `.env` file with the minimum required config to connect the app to
the database:
```ini
CI_ENVIRONMENT = development
@ -41,12 +46,17 @@ database.default.username = podlibre
database.default.password = castopod
```
> _NB._ You can tweak your environment by setting more environment variables in your custom `.env` file. See the `env` for examples or the [CodeIgniter4 User Guide](https://codeigniter.com/user_guide/index.html) for more info.
> _NB._ You can tweak your environment by setting more environment variables in
> your custom `.env` file. See the `env` for examples or the
> [CodeIgniter4 User Guide](https://codeigniter.com/user_guide/index.html) for
> more info.
3. Add the repository you've cloned to docker desktop's `Settings` > `Resources` > `File Sharing`.
3. Add the repository you've cloned to docker desktop's `Settings` >
`Resources` > `File Sharing`.
4. Install castopod's php dependencies
> The project's php dependencies aren't included in the repository, you have to download them using the composer service defined in `docker-compose.yml`
> The project's php dependencies aren't included in the repository, you have to
> download them using the composer service defined in `docker-compose.yml`
```bash
docker-compose run --rm composer install --ignore-platform-reqs
@ -54,7 +64,8 @@ docker-compose run --rm composer install --ignore-platform-reqs
5. Install castopod's js dependencies
> The project's js dependencies aren't included in the repository, you have to download them using the node service defined in `docker-compose.yml`
> The project's js dependencies aren't included in the repository, you have to
> download them using the node service defined in `docker-compose.yml`
```bash
docker-compose run --rm node npm install
@ -89,11 +100,14 @@ docker ps -a
> The `docker-compose up -d` command will boot 3 containers in the background:
>
> - `castopod_app`: a php based container with codeigniter requirements installed
> - `castopod_mariadb`: a [mariadb](https://mariadb.org/) server for persistent data
> - `castopod_app`: a php based container with codeigniter requirements
> installed
> - `castopod_mariadb`: a [mariadb](https://mariadb.org/) server for persistent
> data
> - `castopod_phpmyadmin`: a phpmyadmin server to visualize the mariadb database
>
> _NB._ `./mariadb`, `./phpmyadmin` folders will be mounted in the project's root directory to persist data and logs.
> _NB._ `./mariadb`, `./phpmyadmin` folders will be mounted in the project's
> root directory to persist data and logs.
## Initialize and populate database
@ -146,9 +160,11 @@ This will add an active superadmin user with the following credentials:
## Install/Update app dependencies
Castopod uses `composer` to manage php dependencies and `npm` to manage javascript dependencies.
Castopod uses `composer` to manage php dependencies and `npm` to manage
javascript dependencies.
You can install / update the project's dependencies using both `composer` and `node` services:
You can install / update the project's dependencies using both `composer` and
`node` services:
```bash
# install php dependencies
@ -158,7 +174,9 @@ docker-compose run --rm composer install --ignore-platform-reqs
docker-compose run --rm composer update --ignore-platform-reqs
```
> _NB._ composer commands look for the `composer.json` file to find castopod's php dependencies, all of which live in the `vendor/` folder. For more info, check out [Composer documentation](https://getcomposer.org/doc/).
> _NB._ composer commands look for the `composer.json` file to find castopod's
> php dependencies, all of which live in the `vendor/` folder. For more info,
> check out [Composer documentation](https://getcomposer.org/doc/).
```bash
# install js dependencies
@ -168,11 +186,16 @@ docker-compose run --rm node npm install
docker-compose run --rm node npm update
```
> _NB._ npm commands look for the `package.json` file to find castopod's js dependencies, all of which live in the `node_modules/` folder. For more info, check out [NPM documentation](https://docs.npmjs.com/).
> _NB._ npm commands look for the `package.json` file to find castopod's js
> dependencies, all of which live in the `node_modules/` folder. For more info,
> check out [NPM documentation](https://docs.npmjs.com/).
## Start hacking
You're all set! Start working your magic by updating the project's files! Help yourself to the [CodeIgniter4 User Guide](https://codeigniter.com/user_guide/index.html) for more insights.
You're all set! Start working your magic by updating the project's files! Help
yourself to the
[CodeIgniter4 User Guide](https://codeigniter.com/user_guide/index.html) for
more insights.
To see your changes, go to:
@ -205,18 +228,25 @@ docker-compose restart
docker-compose down
```
Check [docker](https://docs.docker.com/engine/reference/commandline/docker/) and [docker-compose](https://docs.docker.com/compose/reference/) documentations for more insights.
Check [docker](https://docs.docker.com/engine/reference/commandline/docker/) and
[docker-compose](https://docs.docker.com/compose/reference/) documentations for
more insights.
## Developing inside a Container
If you're working in VSCode, you can take advantage of the `./.devcontainer/` folder. It defines a development container with preinstalled VSCode extensions so you don't have to worry about them. The container will be loaded with php, composer and git:
If you're working in VSCode, you can take advantage of the `./.devcontainer/`
folder. It defines a development container with preinstalled VSCode extensions
so you don't have to worry about them. The container will be loaded with php,
composer and git:
1. Install the VSCode extension [Remote - Containers](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers)
1. Install the VSCode extension
[Remote - Containers](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers)
2. `Ctrl/Cmd + Shift + P` > `Open in container`
The VSCode window will reload inside the dev container.
You can check that the required packages are running in the console (`Terminal` > `New Terminal`):
You can check that the required packages are running in the console
(`Terminal` > `New Terminal`):
```bash
php -v
@ -226,4 +256,5 @@ composer -V
git version
```
For more info, see [VSCode Remote Containers](https://code.visualstudio.com/docs/remote/containers)
For more info, see
[VSCode Remote Containers](https://code.visualstudio.com/docs/remote/containers)