Update the docs

This commit is contained in:
Alex Tselegidis 2023-07-26 12:08:22 +02:00
parent 7fa145cf44
commit d6c97509c6
5 changed files with 21 additions and 40 deletions

View File

@ -2,7 +2,7 @@
## Introduction
Plainpad exposes a flexible REST API that will enables you to handle all the information of your installations through
Plainpad exposes a flexible REST API that will enable you to handle all the information of your installations through
HTTP requests. The API is using JSON as its data transaction format and features many best practices in order to make
the resources easily consumable.
@ -22,11 +22,11 @@ Header:
The API honors the REST architecture which means that the client can use various HTTP verbs in order to perform various
operations on the available resources. For example you should use a GET request for fetching resources, a POST for
creating new and PUT for updating existing ones in the database. Finally a DELETE request will remove a resource from
operations on the available resources. For example, you should use a GET request for fetching resources, a POST for
creating new and PUT for updating existing ones in the database. Finally, a DELETE request will remove a resource from
the system.
GET requests accept some parameter helpers that enable the sort, search, pagination and minification of the responses
GET requests accept some parameter helpers that enable the sort, search, pagination and minification of the response
information. Take a look in the following examples:
### Search
@ -39,7 +39,7 @@ https://url/to/public/api.php/v1/notes?filter=keyword
### Sort
Sort the results in ascending or descending direction by providing the the respective sign and the property
Sort the results in ascending or descending direction by providing the respective sign and the property
name to be used for sorting.
```
@ -67,7 +67,7 @@ https://url/to/public/api.php/v1/notes?fields=id,book,hash,notes
### Expected Responses
Most of the times the API will return the complete requested data in a JSON string but there are some cases that the
Most of the time the API will return the complete requested data in a JSON string but there are some cases that the
responses might not contain a message but always a proper HTTP status code.
## Resources & URIs

View File

@ -5,7 +5,7 @@ evolution of the project and help in the creation of high quality features.
### Development
With collaboration mainly taking place on [GitHub](https://github.com/alextselegidis/plainpad), pull requests are
With collaboration mainly taking place on [GitHub](https://github.com/alextselegidis/plainpad), pull requests
are welcome. Please ensure that you follow the coding guidelines before submitting new code to the project.
### Testing

View File

@ -1,10 +1,10 @@
# Docker
Run the development containers of Plainpad with Docker and Docker Compose utility. Docker allows you to compose
your application from micro-services, without worrying about inconsistencies between development and production
your application from microservices, without worrying about inconsistencies between development and production
environments and without locking into any platform or language.
Enter the `docker` directory and run `docker-compose up` to start the environment.
Run `docker-compose up -d` to start the environment.
You will need modify the root `.env` so that it matches the following example:
@ -33,7 +33,7 @@ APP_DEBUG=true
# This URL is used by the console to properly generate URLs when using
# the Artisan command line tool. You should set this to the root of
# your application so that it is used when running Artisan tasks.
APP_URL=http://localhost:8000/
APP_URL=http://localhost
# This URL is used by the auto update mechanism to resolve available updates
# whenever available. Change this only if you have your own Plainpad repository
@ -46,7 +46,7 @@ APP_REPOSITORY=https://cdn.alextselegidis.com/plainpad/updates/stable
DB_CONNECTION=mysql
# The database connection host, this defaults to "localhost" for most servers.
DB_HOST=plainpad-database
DB_HOST=mysql
# The database connection port, this defaults to "3306" for most servers.
DB_PORT=3306
@ -55,38 +55,21 @@ DB_PORT=3306
DB_DATABASE=plainpad
# The database username for the connection.
DB_USERNAME=root
DB_USERNAME=user
# The database password for the connection.
DB_PASSWORD=root
DB_PASSWORD=password
```
Enter the server container with `docker exect -it plainpad-server bash` and run the seed the database with
Enter the server container with `docker exect -it plainpad-php-fpm-1 bash` and run the seed the database with
`php artisan migrate:fresh --seed`.
In the host machine the server is accessible from `http://localhost:8000` and the database from `localhost:8001`.
In the host machine the server is accessible from `http://localhost` and the database from `localhost:3306`.
You can remove the docker containers with `docker rm plainpad-server plainpad-database`.
You can remove the docker containers with `docker compose down --volumes`.
You can remove the server image with `docker rmi plainpad-server:v1`.
The client can be executed locally but needs to know of the server API URL, thus change the `client/.env` to match
the following example:
```
PORT=3000
CHOKIDAR_USEPOLLING=true
REACT_APP_BASE_URL=api.php
REACT_APP_VERSION=v1.0.0
```
Additionally, make sure the package.json file has the following value set:
```
"proxy": "http://localhost:8000"
```
You can then execute `npm start` to run the client in development mode.
You can then execute `npm start` from within the client directory and the php-fpm container to run the dev server in
development mode.
[Back](readme.md)

View File

@ -1,7 +1,7 @@
## Introduction
Plainpad is a self hosted, open source note taking application that is very easy to setup on your server. Your data
will never leave your server and you will be able to access them from any device connected to the internet.
Plainpad is a self-hosted, open source note taking application that is very easy to set up on your server. Your data
will never leave your server, and you will be able to access them from any device connected to the internet.
With Plainpad you can allow multiple users to access the application without being able to see each other's notes. The
notes are being encrypted and stored safely in the database.
@ -12,11 +12,9 @@ will only have to concentrate on the content.
All the contents and notes are being encrypted before being stored so that the maximum security is guaranteed. Only the
note owners are able to access the notes in a readable form.
The installation is pretty simple and only requires a web server with PHP and MySQL configured. You can start using the
app right after filling a simple form.
Being an PWA application, Plainpad will give you access to your notes even when are offline. Changes will be synced once
you get back online.

View File

@ -1,6 +1,6 @@
## Upgrade
The self hosted version supports an automated updates that will notify admin users whenever new packages are available
The self-hosted version supports an automated updates that will notify admin users whenever new packages are available
for download.
It is important the Plainpad installation directory is writable so that the modified files can be replaced and the old