added webpack-encore for managing frontend assets #113 (#122)

* updated installation docu #113
* rewritten login page #113
* added icheck plugin #113
* changed to YesNoType in edit forms #113
* updated CONTRIBUTING.md #113
* added start of developer docu #113
* added compile scripts and compiled assets #113
This commit is contained in:
Kevin Papst
2018-02-01 22:26:19 +01:00
committed by GitHub
parent e35d73eab5
commit 7deaba8368
57 changed files with 9307 additions and 563 deletions

View File

@@ -17,7 +17,8 @@ It is based on a lot of great PHP components. Special thanks to:
- PHP 7.1 or higher
- One PHP extension of PDO-SQLite or PDO-MySQL enabled (it might work with PostgreSQL and Oracle as well, but that wasn't tested and is not officially supported)
- and the [usual Symfony application requirements](http://symfony.com/doc/current/reference/requirements.html)
- the [usual Symfony application requirements](http://symfony.com/doc/current/reference/requirements.html)
- Kimai needs to be installed in the root directory of a domain or you need to recompile the frontend assets ([read more](var/docs/developers.md))
## Installation
@@ -25,29 +26,19 @@ First, install Git and [Composer](https://getcomposer.org/doc/00-intro.md)
if you haven't already. Then, clone this repo and execute this command in the cloned directory:
```bash
$ git clone https://github.com/kevinpapst/kimai2.git
$ cd kimai2/
git clone https://github.com/kevinpapst/kimai2.git
cd kimai2/
```
Lets prepare the environment by installing all dependencies. You will be asked for your application parameter,
like the database connection afterwards (if you don't have a [app/config/parameters.yml](blob/master/app/config/parameters.yml.dist) yet):
Lets prepare the environment by installing all dependencies:
```bash
$ composer install
composer install
```
The next command will create the database, the schema and install all web assets:
```bash
$ bin/console kimai:install --relative
```
The default installation uses a SQLite database, so there is no need to create your own database for first tests.
You can configure your database through your environment (e.g. Webserver, Cloud-Provider) or in your `.env file:
```bash
$ cp .env.dist .env
```
You can adjust the following ENV values to your needs:
The default installation uses a SQLite database, so there is no need to create a database for your first tests.
The default settings will work out-of-the-box, but you might want to adjust the `.env` values to your needs.
You can configure your database through your environment (e.g. Webserver, Cloud-Provider) or in your `.env` file:
```
DATABASE_PREFIX=kimai2_
DATABASE_URL=sqlite:///%kernel.project_dir%/var/data/kimai.sqlite
@@ -55,12 +46,23 @@ APP_ENV=dev
APP_SECRET=some_random_secret_string_for_your_installation
```
The next command will create the database and the schema:
```bash
bin/console doctrine:database:create
bin/console doctrine:schema:create
```
To generate the frontend assets ([more information here](var/docs/developers.md)), execute:
```bash
yarn install
npm run prod
```
### Installation (development / demo)
Lets boostrap your environment by executing this commands (which is only available in dev environment):
```bash
$ bin/console kimai:reset-dev
bin/console kimai:reset-dev
```
You just imported demo data, to test the application in its full beauty and with several different user accounts and permission sets.
@@ -80,8 +82,8 @@ Demo data can always be deleted by dropping the schema and re-creating it.
ATTENTION - this will erase all your data:
```bash
$ bin/console doctrine:schema:drop --force
$ bin/console doctrine:schema:create
bin/console doctrine:schema:drop --force
bin/console doctrine:schema:create
```
The `kimai:reset-dev` command can always be executed later on to reset your dev database and cache.
@@ -90,7 +92,7 @@ There is no need to configure a virtual host in your web server to access the ap
Just use the built-in web server for your first tests:
```bash
$ bin/console server:run
bin/console server:run
```
This command will start a web server for Kimai. Now you can access the application in your browser at <http://127.0.0.1:8000/>.
@@ -109,17 +111,17 @@ APP_SECRET=insert_a_random_secret_string_for_production
Create the database schemas and warm up the cache:
```bash
$ bin/console doctrine:schema:create
$ bin/console cache:warmup --env=prod
bin/console doctrine:schema:create
bin/console cache:warmup --env=prod
```
Create your first user:
```bash
$ bin/console kimai:create-user username password admin@example.com ROLE_SUPER_ADMIN
bin/console kimai:create-user username password admin@example.com ROLE_SUPER_ADMIN
```
For available roles, please refer to [the user documentation](var/docs/users.md).
For available roles, please refer to the [user documentation](var/docs/users.md).
> **NOTE**
>
@@ -145,31 +147,27 @@ Before importing your data from a Kimai v1 installation, please read the followi
A possible full command for import:
```bash
$ bin/console kimai:import-v1 "mysql://user:password@127.0.0.1:3306/database?charset=utf8" "db_prefix" "password" "country"
bin/console kimai:import-v1 "mysql://user:password@127.0.0.1:3306/database?charset=utf8" "db_prefix" "password" "country"
```
It is recommended to test the import in a fresh database. You can test your import as often as you like and fix possible problems in your installation.
A sample command could look like that:
```bash
$ bin/console doctrine:schema:drop --force && bin/console doctrine:schema:create && bin/console kimai:import-v1 "mysql://kimai:test@127.0.0.1:3306/kimai?charset=latin1" "kimai_" "test123" "de"
bin/console doctrine:schema:drop --force && bin/console doctrine:schema:create && bin/console kimai:import-v1 "mysql://kimai:test@127.0.0.1:3306/kimai?charset=latin1" "kimai_" "test123" "de"
```
That will drop the configured Kimai v2 database schema and re-create it, before importing the data from the `mysql` database at `127.0.0.1` on port `3306` authenticating the user `kimai` with the password `test` for import.
The connection will use the charset `latin1` and the default table prefix `kimai_` for reading data. Imported users can login with the password `test123` and all customer will have the country `de` assigned.
## Extensions for Kimai 2
As Kimai 2 was built on top of Symfony, it can be extended like every other Symfony application.
As Kimai 2 was built on top of Symfony, it can be extended like every other Symfony application.
We call these extensions bundles, but you might also know them as add-ons, extensions or plugins.
All available Kimai 2 bundles can be found at the repository [Kimai recipes](https://github.com/kimai/recipes).
An example on how to extend Kimai 2 can be found in this [GitHub repository](https://github.com/kevinpapst/kimai2-invoice).
There are more options, for example events to hook your own links into the navigation tree.
But we don't have documentation on this by now, so please ask in the [issue tracker](https://github.com/kevinpapst/kimai2) or have a look at [this class](https://github.com/kevinpapst/kimai2/blob/master/src/EventSubscriber/MenuSubscriber.php).
All available Kimai 2 bundles can be found at the [Kimai recipes](https://github.com/kimai/recipes) repository.
## Troubleshooting
## Developer
Cannot see any assets (like images) and/or missing styles? Try executing:
```bash
$ php bin/console assets:install --symlink
```
If you want to develop for Kimai 2 please read the following documentation:
- an example on how to extend Kimai 2 can be found in this [GitHub repository](https://github.com/kevinpapst/kimai2-invoice)
- the developer documentation can be found at [var/docs/developers.md](var/docs/developers.md)