]> BookStack Code Mirror - bookstack/blob - readme.md
Refactored app service providers
[bookstack] / readme.md
1 # BookStack
2
3 [![GitHub release](https://img.shields.io/github/release/BookStackApp/BookStack.svg)](https://github.com/BookStackApp/BookStack/releases/latest)
4 [![license](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/BookStackApp/BookStack/blob/development/LICENSE)
5 [![Crowdin](https://badges.crowdin.net/bookstack/localized.svg)](https://crowdin.com/project/bookstack)
6 [![Build Status](https://github.com/BookStackApp/BookStack/workflows/test-php/badge.svg)](https://github.com/BookStackApp/BookStack/actions)
7 [![Lint Status](https://github.com/BookStackApp/BookStack/workflows/lint-php/badge.svg)](https://github.com/BookStackApp/BookStack/actions)
8 [![Maintainability](https://api.codeclimate.com/v1/badges/5551731994dd22fa1f4f/maintainability)](https://codeclimate.com/github/BookStackApp/BookStack/maintainability)
9
10 [![Repo Stats](https://img.shields.io/static/v1?label=GitHub+project&message=stats&color=f27e3f)](https://gh-stats.bookstackapp.com/)
11 [![Discord](https://img.shields.io/static/v1?label=Discord&message=chat&color=738adb&logo=discord)](https://discord.gg/ztkBqR2)
12 [![Twitter](https://img.shields.io/static/v1?label=Twitter&message=@bookstack_app&color=1d9bf0&logo=twitter)](https://twitter.com/bookstack_app)
13 [![YouTube](https://img.shields.io/static/v1?label=YouTube&message=bookstackapp&color=ff0000&logo=youtube)](https://www.youtube.com/bookstackapp)
14
15 A platform for storing and organising information and documentation. Details for BookStack can be found on the official website at https://www.bookstackapp.com/.
16
17 * [Installation Instructions](https://www.bookstackapp.com/docs/admin/installation)
18 * [Documentation](https://www.bookstackapp.com/docs)
19 * [Demo Instance](https://demo.bookstackapp.com)
20     * [Admin Login](https://demo.bookstackapp.com/login?email=admin@example.com&password=password)
21 * [Screenshots](https://www.bookstackapp.com/#screenshots) 
22 * [BookStack Blog](https://www.bookstackapp.com/blog)
23 * [Issue List](https://github.com/BookStackApp/BookStack/issues)
24 * [Discord Chat](https://discord.gg/ztkBqR2)
25
26 ## 📚 Project Definition
27
28 BookStack is an opinionated wiki system that provides a pleasant and simple out-of-the-box experience. New users to an instance should find the experience intuitive and only basic word-processing skills should be required to get involved in creating content on BookStack. The platform should provide advanced power features to those that desire it but they should not interfere with the core simple user experience.
29
30 BookStack is not designed as an extensible platform to be used for purposes that differ to the statement above.
31
32 In regard to development philosophy, BookStack has a relaxed, open & positive approach. At the end of the day this is free software developed and maintained by people donating their own free time.
33
34 ## 🌟 Project Sponsors
35
36 Shown below are our bronze, silver and gold project sponsors.
37 Big thanks to these companies for supporting the project.
38 Note: Listed services are not tested, vetted nor supported by the official BookStack project in any manner.
39 [View all sponsors](https://github.com/sponsors/ssddanbrown).
40
41 #### Silver Sponsors
42
43 <table><tbody><tr>
44 <td><a href="https://www.diagrams.net/" target="_blank">
45     <img width="400" src="https://media.githubusercontent.com/media/BookStackApp/website/main/static/images/sponsors/diagramsnet.png" alt="Diagrams.net">
46 </a></td>
47 <td><a href="https://cloudabove.com/hosting" target="_blank">
48     <img height="100" src="https://raw.githubusercontent.com/BookStackApp/website/main/static/images/sponsors/cloudabove.svg" alt="Cloudabove">
49 </a></td>
50 </tr></tbody></table>
51
52 #### Bronze Sponsor
53
54 <table><tbody><tr>
55 <td><a href="https://www.stellarhosted.com/bookstack/" target="_blank">
56     <img width="280" src="https://media.githubusercontent.com/media/BookStackApp/website/main/static/images/sponsors/stellarhosted.png" alt="Stellar Hosted">
57 </a></td>
58 </tr></tbody></table>
59
60 ## 🛣️ Road Map
61
62 Below is a high-level road map view for BookStack to provide a sense of direction of where the project is going. This can change at any point and does not reflect many features and improvements that will also be included as part of the journey along this road map. For more granular detail of what will be included in upcoming releases you can review the project milestones as defined in the "Release Process" section below.
63
64 - **Platform REST API** - *(Most actions implemented, maturing)*
65     - *A REST API covering, at minimum, control of core content models (Books, Chapters, Pages) for automation and platform extension.*
66 - **Editor Alignment & Review** - *(Done)*
67     - *Review the page editors with the goal of achieving increased interoperability & feature parity while also considering collaborative editing potential.*
68 - **Permission System Review** - *(In Progress)*
69     - *Improvement in how permissions are applied and a review of the efficiency of the permission & roles system.*
70 - **Installation & Deployment Process Revamp**
71     - *Creation of a streamlined & secure process for users to deploy & update BookStack with reduced development requirements (No git or composer requirement).*
72
73 ## 🚀 Release Versioning & Process
74
75 BookStack releases are each assigned a date-based version number in the format `v<year>.<month>[.<optional_patch_number>]`. For example:
76
77 - `v20.12` - New feature released launched during December 2020. 
78 - `v21.06.2` - Second patch release upon the June 2021 feature release.
79
80 Patch releases are generally fairly minor, primarily intended for fixes and therefore are fairly unlikely to cause breakages upon update.
81 Feature releases are generally larger, bringing new features in addition to fixes and enhancements. These releases have a greater chance of introducing breaking changes upon update, so it's worth checking for any notes in the [update guide](https://www.bookstackapp.com/docs/admin/updates/).
82
83 Each BookStack release will have a [milestone](https://github.com/BookStackApp/BookStack/milestones) created with issues & pull requests assigned to it to define what will be in that release. Milestones are built up then worked through until complete at which point, after some testing and documentation updates, the release will be deployed.
84
85 Feature releases, and some patch releases, will be accompanied by a post on the [BookStack blog](https://www.bookstackapp.com/blog/) which will provide additional detail on features, changes & updates otherwise the [GitHub release page](https://github.com/BookStackApp/BookStack/releases) will show a list of changes. You can sign up to be alerted to new BookStack blog posts (once per week maximum) [at this link](https://updates.bookstackapp.com/signup/bookstack-news-and-updates).
86
87 ## 🛠️ Development & Testing
88
89 All development on BookStack is currently done on the `development` branch. When it's time for a release the `development` branch is merged into release with built & minified CSS & JS then tagged at its version. Here are the current development requirements:
90
91 * [Node.js](https://nodejs.org/en/) v14.0+
92
93 This project uses SASS for CSS development and this is built, along with the JavaScript, using a range of npm scripts. The below npm commands can be used to install the dependencies & run the build tasks:
94
95 ``` bash
96 # Install NPM Dependencies
97 npm install
98
99 # Build assets for development
100 npm run build
101
102 # Build and minify assets for production
103 npm run production
104
105 # Build for dev (With sourcemaps) and watch for changes
106 npm run dev
107 ```
108
109 BookStack has many integration tests that use Laravel's built-in testing capabilities which makes use of PHPUnit. There is a `mysql_testing` database defined within the app config which is what is used by PHPUnit. This database is set with the database name, user name and password all defined as `bookstack-test`. You will have to create that database and that set of credentials before testing.
110
111 The testing database will also need migrating and seeding beforehand. This can be done by running `composer refresh-test-database`.
112
113 Once done you can run `composer test` in the application root directory to run all tests. Tests can be ran in parallel by running them via `composer t`. This will use Laravel's built-in parallel testing functionality, and attempt to create and seed a database instance for each testing thread. If required these parallel testing instances can be reset, before testing again, by running `composer t-reset`.
114
115 ### 📜 Code Standards
116
117 PHP code standards are managed by [using PHP_CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer).
118 Static analysis is in place using [PHPStan](https://phpstan.org/) & [Larastan](https://github.com/nunomaduro/larastan).
119 The below commands can be used to utilise these tools:
120
121 ```bash
122 # Run code linting using PHP_CodeSniffer
123 composer lint
124
125 # As above, but show rule names in output
126 composer lint -- -s
127
128 # Auto-fix formatting & lint issues via PHP_CodeSniffer phpcbf
129 composer format
130
131 # Run static analysis via larastan/phpstan
132 composer check-static
133 ```
134
135 If submitting a PR, formatting as per our project standards would help for clarity but don't worry too much about using/understanding these tools as we can always address issues at a later stage when they're picked up by our automated tools.
136
137 ### 🐋 Development using Docker
138
139 This repository ships with a Docker Compose configuration intended for development purposes. It'll build a PHP image with all needed extensions installed and start up a MySQL server and a Node image watching the UI assets.
140
141 To get started, make sure you meet the following requirements:
142
143 - Docker and Docker Compose are installed
144 - Your user is part of the `docker` group
145
146 If all the conditions are met, you can proceed with the following steps:
147
148 1. **Copy `.env.example` to `.env`**, change `APP_KEY` to a random 32 char string and set `APP_ENV` to `local`.
149 2. Make sure **port 8080 is unused** *or else* change `DEV_PORT` to a free port on your host.
150 3. **Run `chgrp -R docker storage`**. The development container will chown the `storage` directory to the `www-data` user inside the container so BookStack can write to it. You need to change the group to your host's `docker` group here to not lose access to the `storage` directory.
151 4. **Run `docker-compose up`** and wait until the image is built and all database migrations have been done.
152 5. You can now login with `admin@admin.com` and `password` as password on `localhost:8080` (or another port if specified).
153
154 If needed, You'll be able to run any artisan commands via docker-compose like so:
155
156 ```bash
157 docker-compose run app php artisan list
158 ```
159
160 The docker-compose setup runs an instance of [MailHog](https://github.com/mailhog/MailHog) and sets environment variables to redirect any BookStack-sent emails to MailHog. You can view this mail via the MailHog web interface on `localhost:8025`. You can change the port MailHog is accessible on by setting a `DEV_MAIL_PORT` environment variable.
161
162 #### Running tests
163
164 After starting the general development Docker, migrate & seed the testing database:
165
166  ```bash
167 # This only needs to be done once
168 docker-compose run app php artisan migrate --database=mysql_testing
169 docker-compose run app php artisan db:seed --class=DummyContentSeeder --database=mysql_testing
170 ```
171
172 Once the database has been migrated & seeded, you can run the tests like so:
173
174  ```bash
175 docker-compose run app php vendor/bin/phpunit
176 ```
177
178 #### Debugging
179
180 The docker-compose setup ships with Xdebug, which you can listen to on port 9090.
181 NB : For some editors like Visual Studio Code, you might need to map your workspace folder to the /app folder within the docker container for this to work.
182
183 ## 🌎 Translations
184
185 Translations for text within BookStack is managed through the [BookStack project on Crowdin](https://crowdin.com/project/bookstack). Some strings have colon-prefixed variables such as `:userName`. Leave these values as they are as they will be replaced at run-time. Crowdin is the preferred way to provide translations, otherwise the raw translations files can be found within the `resources/lang` path.
186
187 If you'd like a new language to be added to Crowdin, for you to be able to provide translations for, please [open a new issue here](https://github.com/BookStackApp/BookStack/issues/new?template=language_request.yml).
188
189 Please note, translations in BookStack are provided to the "Crowdin Global Translation Memory" which helps BookStack and other projects with finding translations. If you are not happy with contributing to this then providing translations to BookStack, even manually via GitHub, is not advised.
190
191 ## 🎁 Contributing, Issues & Pull Requests
192
193 Feel free to create issues to request new features or to report bugs & problems. Just please follow the template given when creating the issue.
194
195 Pull requests are welcome. Unless a small tweak or language update, It may be best to open the pull request early or create an issue for your intended change to discuss how it will fit into the project and plan out the merge. Just because a feature request exists, or is tagged, does not mean that feature would be accepted into the core project.
196
197 Pull requests should be created from the `development` branch since they will be merged back into `development` once done. Please do not build from or request a merge into the `release` branch as this is only for publishing releases. If you are looking to alter CSS or JavaScript content please edit the source files found in `resources/`. Any CSS or JS files within `public` are built from these source files and therefore should not be edited directly.
198
199 The project's code of conduct [can be found here](https://github.com/BookStackApp/BookStack/blob/development/.github/CODE_OF_CONDUCT.md).
200
201 ## 🔒 Security
202
203 Security information for administering a BookStack instance can be found on the [documentation site here](https://www.bookstackapp.com/docs/admin/security/).
204
205 If you'd like to be notified of new potential security concerns you can [sign-up to the BookStack security mailing list](https://updates.bookstackapp.com/signup/bookstack-security-updates).
206
207 If you would like to report a security concern, details of doing so can [can be found here](https://github.com/BookStackApp/BookStack/blob/development/.github/SECURITY.md).
208
209 ## ♿ Accessibility
210
211 We want BookStack to remain accessible to as many people as possible. We aim for at least WCAG 2.1 Level A standards where possible although we do not strictly test this upon each release. If you come across any accessibility issues please feel free to open an issue.
212
213 ## 🖥️ Website, Docs & Blog
214
215 The website which contains the project docs & Blog can be found in the [BookStackApp/website](https://github.com/BookStackApp/website) repo.
216
217 ## ⚖️ License
218
219 The BookStack source is provided under the MIT License. 
220
221 The libraries used by, and included with, BookStack are provided under their own licenses and copyright.
222 The licenses for many of our core dependencies can be found in the attribution list below but this is not an exhaustive list of all projects used within BookStack. 
223
224 ## 👪 Attribution
225
226 The great people that have worked to build and improve BookStack can [be seen here](https://github.com/BookStackApp/BookStack/graphs/contributors).
227
228 The wonderful people that have provided translations, either through GitHub or via Crowdin [can be seen here](https://github.com/BookStackApp/BookStack/blob/development/.github/translators.txt).
229
230 Below are the great open-source projects used to help build BookStack. 
231 Note: This is not an exhaustive list of all libraries and projects that would be used in an active BookStack instance.
232
233 * [Laravel](http://laravel.com/) - _[MIT](https://github.com/laravel/framework/blob/v8.82.0/LICENSE.md)_
234 * [TinyMCE](https://www.tinymce.com/) - _[MIT](https://github.com/tinymce/tinymce/blob/develop/LICENSE.TXT)_
235 * [CodeMirror](https://codemirror.net) - _[MIT](https://github.com/codemirror/CodeMirror/blob/master/LICENSE)_
236 * [Sortable](https://github.com/SortableJS/Sortable) - _[MIT](https://github.com/SortableJS/Sortable/blob/master/LICENSE)_
237 * [Google Material Icons](https://github.com/google/material-design-icons) - _[Apache-2.0](https://github.com/google/material-design-icons/blob/master/LICENSE)_
238 * [Dropzone.js](http://www.dropzonejs.com/) - _[MIT](https://github.com/dropzone/dropzone/blob/main/LICENSE)_
239 * [clipboard.js](https://clipboardjs.com/) - _[MIT](https://github.com/zenorocha/clipboard.js/blob/master/LICENSE)_
240 * [markdown-it](https://github.com/markdown-it/markdown-it) and [markdown-it-task-lists](https://github.com/revin/markdown-it-task-lists) - _[MIT](https://github.com/markdown-it/markdown-it/blob/master/LICENSE) and [ISC](https://github.com/revin/markdown-it-task-lists/blob/master/LICENSE)_
241 * [Dompdf](https://github.com/dompdf/dompdf) - _[LGPL v2.1](https://github.com/dompdf/dompdf/blob/master/LICENSE.LGPL)_
242 * [BarryVD/Dompdf](https://github.com/barryvdh/laravel-dompdf) - _[MIT](https://github.com/barryvdh/laravel-dompdf/blob/master/LICENSE)_
243 * [BarryVD/Snappy (WKHTML2PDF)](https://github.com/barryvdh/laravel-snappy) - _[MIT](https://github.com/barryvdh/laravel-snappy/blob/master/LICENSE)_
244 * [WKHTMLtoPDF](http://wkhtmltopdf.org/index.html) - _[LGPL v3.0](https://github.com/wkhtmltopdf/wkhtmltopdf/blob/master/LICENSE)_
245 * [diagrams.net](https://github.com/jgraph/drawio) - _[Embedded Version Terms](https://www.diagrams.net/trust/) / [Source Project - Apache-2.0](https://github.com/jgraph/drawio/blob/dev/LICENSE)_
246 * [OneLogin's SAML PHP Toolkit](https://github.com/onelogin/php-saml) - _[MIT](https://github.com/onelogin/php-saml/blob/master/LICENSE)_
247 * [League/CommonMark](https://commonmark.thephpleague.com/) - _[BSD-3-Clause](https://github.com/thephpleague/commonmark/blob/2.2/LICENSE)_
248 * [League/Flysystem](https://flysystem.thephpleague.com) - _[MIT](https://github.com/thephpleague/flysystem/blob/3.x/LICENSE)_
249 * [pragmarx/google2fa](https://github.com/antonioribeiro/google2fa) - _[MIT](https://github.com/antonioribeiro/google2fa/blob/8.x/LICENSE.md)_
250 * [Bacon/BaconQrCode](https://github.com/Bacon/BaconQrCode) - _[BSD-2-Clause](https://github.com/Bacon/BaconQrCode/blob/master/LICENSE)_
251 * [phpseclib](https://github.com/phpseclib/phpseclib) - _[MIT](https://github.com/phpseclib/phpseclib/blob/master/LICENSE)_
252 * [Clockwork](https://github.com/itsgoingd/clockwork) - _[MIT](https://github.com/itsgoingd/clockwork/blob/master/LICENSE)_
253 * [PHPStan](https://phpstan.org/) & [Larastan](https://github.com/nunomaduro/larastan) - _[MIT](https://github.com/phpstan/phpstan/blob/master/LICENSE) and [MIT](https://github.com/nunomaduro/larastan/blob/master/LICENSE.md)_
254 * [PHP_CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer) - _[BSD 3-Clause](https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt)_
Morty Proxy This is a proxified and sanitized view of the page, visit original site.