Technical docs (#553)

* WIP

* Working on configuration

* wip

* Finished docs

* Self hosted comparison + more links
This commit is contained in:
Julien Nahum
2024-09-02 15:33:17 +02:00
committed by GitHub
parent 6d4b5b8ff4
commit 4cd8b3c62e
33 changed files with 1289 additions and 242 deletions

View File

@@ -0,0 +1,34 @@
---
title: "Cloud vs Self-Hosting"
description: "Understand the differences between cloud and self-hosting options for OpnForm"
---
When deciding between using OpnForm's cloud service or self-hosting, it's important to understand the key differences and benefits of each option. Below is a comparison to help you make an informed decision:
| | Self-Hosted | OpnForm Cloud |
| ------------------------------ | ----------------------------------- | ---------------------------------- |
| High availability servers | \~$50+/month | ✅ |
| Load balancer | \~$15+/month | ✅ |
| Managed database | \~$45-70+/month | ✅ |
| SMTP server | \~$15+/month | ✅ |
| Support | Discord | Live Chat |
| Setup time | Manual | ✅ Up and running in minutes |
| Upgrades | Manual | ✅ Automatic |
| Multi-zone availability | Manual | ✅ |
| Backups | Manual | ✅ Automatic |
| Monitoring | Manual | ✅ |
| Custom code and forks | ✅ | ❌ |
| SSL certificate | Manual | ✅ |
| Where your money goes | 3rd-party services | Improving OpnForm |
### When Should You Self-Host?
There are specific scenarios where self-hosting OpnForm might be the better choice:
- **Regulatory Compliance**: If you need an air-gapped environment for regulatory reasons (e.g., HIPAA compliance).
- **Custom Builds**: If you want to run a custom build or fork of OpnForm with your own customizations.
- **Custom Integrations**: If you need to use community or custom integrations that are not supported in the cloud version.
For most users, the managed OpnForm Cloud service will be the better option due to its ease of use, automatic updates, and comprehensive support.
*This comparison is inspired by the [Metabase Cloud vs Self-Hosting page](https://www.metabase.com/docs/latest/cloud/cloud-vs-self-hosting).*

View File

@@ -0,0 +1,94 @@
---
title: "Docker"
description: "OpnForm can be easily set up using Docker. We provide pre-built images on Docker Hub, which is the recommended method for most users."
---
import CloudVersion from "/snippets/cloud-version.mdx";
<CloudVersion/>
## Prerequisites
- Docker
- Docker Compose
## Quick Start
1. Clone the repository:
```bash
git clone https://github.com/JhumanJ/OpnForm.git
cd OpnForm
```
2. Set up environment files:
```bash
./scripts/setup-env.sh --docker
```
3. (Optional) Customize the environment variables:
You can modify two environment files to customize your OpnForm installation:
- The `.env` file in the `api` directory for backend configuration
- The `.env` file in the `client` directory for frontend configuration
For more information on available environment variables, please refer to our [Environment Variables](/configuration/environment-variables) page.
4. Start the application:
```bash
docker-compose up -d
```
5. Access OpnForm at http://localhost
## Docker Images
OpnForm provides pre-built Docker images for easy deployment. You can find our official Docker images on Docker Hub:
- [OpnForm API Image](https://hub.docker.com/r/jhumanj/opnform-api)
- [OpnForm Client Image](https://hub.docker.com/r/jhumanj/opnform-client)
We recommend using these official images for your OpnForm deployment.
## Building Your Own Docker Images
If you prefer to build your own Docker images, you can do so using the provided Dockerfiles in the repository:
1. Build the API image:
```bash
docker build -t opnform-api:local -f docker/Dockerfile.api .
```
2. Build the UI image:
```bash
docker build -t opnform-ui:local -f docker/Dockerfile.client .
```
### Overriding Docker Compose Configuration
You can override the default Docker Compose configuration by creating a `docker-compose.override.yml` file. This allows you to customize various aspects of the deployment without modifying the main `docker-compose.yml` file.
Example `docker-compose.override.yml`:
```yaml
services:
api:
image: opnform-api:local
ui:
image: opnform-ui:local
api-worker:
image: opnform-api:local
```
### Clearing all resources
To completely remove all Docker containers, networks, and volumes created by docker-compose and also remove all images used by these services, you can use the following command:
```
docker-compose down -v --rmi all
```

View File

@@ -0,0 +1,64 @@
---
title: "Local Deployment"
description: "Set up OpnForm locally for development"
---
import CloudVersion from "/snippets/cloud-version.mdx";
<CloudVersion/>
## Requirements
Before proceeding with the local deployment, ensure you have the following prerequisites installed on your system:
- **PHP**: Version 8.0 or higher
- **Composer**: The PHP dependency manager
- **Node.js**: Version 14 or higher
- **NPM** or **Yarn**: Package managers for Node.js
- **MySQL**, or **PostgreSQL**: A supported database system
Make sure these components are properly installed and configured on your local machine before proceeding with the deployment steps.
## Local setup
1. Install Laravel Herd -Download and install Laravel Herd from the official website: https://herd.laravel.com/
2. Clone the repository and install dependencies:
```bash
git clone git@github.com:JhumanJ/OpnForm.git && cd OpnForm
cd api && composer install
cd ../client && npm install
```
3. Compile assets and run dev server:
```bash
cd client && npm run dev # or build
```
4. Set up environment files:
```bash
./scripts/setup-env.sh
```
This script will create the necessary `.env` files for both the API and client.
5. Run the migrations:
```bash
cd api
php artisan migrate
```
6. Set up Herd:
For detailed instructions on setting up Herd, refer to the [Herd documentation](https://herd.laravel.com/docs).
- Open the Herd application
- Add your OpnForm's `api` directory to Herd
- Herd will automatically configure a local domain for your project
This will start the Nuxt.js development server, typically on `http://localhost:3000`.
8. Access your local OpnForm installation:
- The API will be available at the domain provided by Herd (e.g., `http://opnform.test`)
- The frontend will be accessible at `http://localhost:3000`