diff --git a/README.md b/README.md index ebbef4c..951c0fe 100644 --- a/README.md +++ b/README.md @@ -38,8 +38,9 @@ docker build -t invoiceshelf/docs . ## Deployment -Documentation is automatically built and published to GitHub Container Registry on every push to master. +Every push builds and publishes a commit-SHA image. Pushes to `master` also publish the +`latest` image. Images are available at: -- `ghcr.io/invoiceshelf/docs:latest` - Latest master branch -- `ghcr.io/invoiceshelf/docs:` - Specific commit builds +- `ghcr.io/invoiceshelf/docs:latest` - Latest `master` build +- `ghcr.io/invoiceshelf/docs:` - A specific commit build diff --git a/docs/developer-guide.md b/docs/developer-guide.md index 3e70ccd..a06d713 100644 --- a/docs/developer-guide.md +++ b/docs/developer-guide.md @@ -6,12 +6,15 @@ lang: en-US # Developer Guide This guide will help you set up your development environment and get started with InvoiceShelf. -There are three primary ways to install and set up InvoiceShelf for development: Docker, NGINX/PHP-FPM, and Laravel Herd. +There are three primary ways to set up InvoiceShelf for development: Docker, +NGINX/PHP-FPM, and Laravel Herd. The application currently uses Laravel 13, PHP 8.4, +Node.js 24, and pnpm. ## Docker Environment -If you want to use the pre-configured Docker dev environment +Use the application's `./devenv` wrapper to choose and start the pre-configured Docker +development environment. [[Read more]](./developer/docker.md) @@ -24,7 +27,7 @@ If you want to use Laravel Herd on your Windows/Mac machine ## Manual Nginx/php-fpm -If you want to install InvoiceShelf on plain Linux Debian/Ubuntu +Use this when you want to run the application directly on a Linux host. [[Read more]](./developer/manual.md) @@ -36,4 +39,4 @@ Hopefully one of those guides will help you get started with InvoiceShelf develo If you have any questions or run into issues, feel free to open an issue on [GitHub](https://github.com/InvoiceShelf/InvoiceShelf/issues). -Happy coding! 🧑‍💻 \ No newline at end of file +Happy coding! 🧑‍💻 diff --git a/docs/developer/docker.md b/docs/developer/docker.md index 66b0b81..06be128 100644 --- a/docs/developer/docker.md +++ b/docs/developer/docker.md @@ -5,57 +5,60 @@ lang: en-US # Setting Up with Docker -Using Docker is one of the easiest ways to set up InvoiceShelf for development. The necessary Docker configuration files are located in the `.dev` folder of the repository. +Using Docker is one of the easiest ways to set up InvoiceShelf for development. The +repository provides a `./devenv` wrapper that selects the supported Compose configuration, +adds the local hostname when needed, and starts the stack. The Compose files live in +`docker/development/`; `.dev` is no longer used. ## Step 1 : Clone the Repository If you forked the project, you can use the fork url instead. ```bash -git clone https://github.com/InvoiceShelf/InvoiceShelf.git +git clone --branch 2.x https://github.com/InvoiceShelf/InvoiceShelf.git cd InvoiceShelf +cp .env.example .env ``` -If you are using Linux/macOS, you need to setup the correct permissions: -```bash -chmod 775 storage/framework storage/logs bootstrap/cache -``` - -## Step 2 : Set up DNS host - -The dockerized development environment uses `invoiceshelf.test` local domain. - -This domain needs to be set up on your machine to access the default configuration. - -### a.) Linux/MacOS - -If you are using Linux or macOS, edit `/etc/hosts` as root/sudo. - -### b.) Windows +## Step 2 : Start the development environment -If you are using Windows, run Notepad as administrator and File > Open the `hosts` file in `C:Windows\System32\drivers\etc` +Run the wrapper with no arguments. It verifies Docker, adds `invoiceshelf.test` to the +hosts file when necessary (requesting sudo on Linux/macOS), then asks you to choose MySQL, +PostgreSQL, or SQLite and whether to enable Gotenberg. -### Finalize +```bash +./devenv +``` -Add the following line at the end of the hosts file to make the invoiceshelf.test available: +Your selected Compose file is saved in `.devenvconfig`. Later sessions can use: -``` -127.0.0.1 invoiceshelf.test +```bash +./devenv start +./devenv stop +./devenv logs +./devenv shell +./devenv run php artisan migrate +./devenv test +./devenv format ``` -## Step 3 : Spin up Docker +## Step 3 : Install application dependencies -To spin up the Docker environment, run: +Install PHP dependencies and generate an application key inside the running PHP container: ```bash -docker compose -f docker/development/docker-compose.mysql.yml up --build +./devenv run composer install +./devenv run php artisan key:generate ``` -Once the environment is up and running you have the following containers: +The frontend runs on the host. Install Node.js 24, enable Corepack, install the locked +dependencies, and keep the Vite development server running while you work: -- invoiceshelf-dev-php -- invoiceshelf-dev-mysql (or pgsql for sqlite) -- invoiceshelf-dev-nginx +```bash +corepack enable +pnpm install --frozen-lockfile +pnpm dev +``` ## Step 4 : Access the Application @@ -64,34 +67,36 @@ Once the containers are up and running, you can access the InvoiceShelf applicat ## Useful details -### a.) Working with composer/npm/phpunit +### a.) Working with Composer, pnpm, and tests -To access `composser`, `npm`, `vendor/bin/pint`, `vendor/bin/pest`, you need to SSH into the `invoiceshelf-dev-php` container as follows: +Use `./devenv run` to run a command in the PHP container, or use `./devenv shell` for an +interactive shell: ```bash -docker exec -it --user invoiceshelf invoiceshelf-dev-php /bin/bash +./devenv run php artisan migrate +./devenv test +./devenv format ``` ### b.) Previewing the database To see the database we use a tool called Adminer. -You can open it at http://invoiceshelf.test:8080 - -You can log in with the database details as [explained here](https://github.com/InvoiceShelf/InvoiceShelf/blob/develop/.dev/README.md#2-databases). +You can open it at `http://localhost:8080`. ### c.) Previewing Mail To see the mail we use a tool called Mailpit. -You can open it at http://invoiceshelf.test:8025 +You can open it at `http://localhost:8025`. ---   -For more details, refer to the [Docker setup README](https://github.com/InvoiceShelf/InvoiceShelf/blob/develop/.dev/README.md). +For implementation details, refer to +[docker/development](https://github.com/InvoiceShelf/InvoiceShelf/tree/2.x/docker/development).   diff --git a/docs/developer/manual.md b/docs/developer/manual.md index 9feee87..af38aaa 100644 --- a/docs/developer/manual.md +++ b/docs/developer/manual.md @@ -5,7 +5,9 @@ lang: en-US # Setting Up with NGINX/PHP-FPM -Setting up InvoiceShelf with NGINX and PHP-FPM is ideal for Linux systems. Follow the Laravel deployment guide for NGINX to set up your environment. +Setting up InvoiceShelf with NGINX and PHP-FPM is ideal for Linux systems. Follow the +[Laravel 13 NGINX deployment guide](https://laravel.com/docs/13.x/deployment#nginx) for the +web-server configuration. ## Step 1 : Install Dependencies @@ -23,13 +25,14 @@ sudo apt install nginx # Install required tools sudo apt install git curl zip unzip sqlite3 -# Install PHP/PHP-FPM -sudo apt install php8.3-fpm php8.3-gd php8.3-exif php8.3-mbstring php8.3-zip php8.3-curl php8.3-bcmath +# Install PHP 8.4/PHP-FPM and the extensions InvoiceShelf uses +sudo apt install php8.4-fpm php8.4-gd php8.4-exif php8.4-mbstring php8.4-zip php8.4-curl php8.4-bcmath php8.4-xml php8.4-intl -# Install NPM +# Install Node.js 24 and enable pnpm through Corepack curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.5/install.sh | bash -nvm install 20 -nvm use 20 +nvm install 24 +nvm use 24 +corepack enable ``` ## Step 2 : Clone the Repository @@ -37,7 +40,7 @@ nvm use 20 If you forked the project, you can use the fork url instead. ```bash -git clone https://github.com/InvoiceShelf/InvoiceShelf.git +git clone --branch 3.x https://github.com/InvoiceShelf/InvoiceShelf.git cd InvoiceShelf ``` @@ -58,11 +61,11 @@ cp .env.example .env ```bash composer install -npm install -# If you want one-time build run: -npm run prod +pnpm install +# For a one-time production build: +pnpm build # If you want dev builds run: -npm run dev +pnpm dev ``` ## Step 5 : Generate Application Key @@ -79,7 +82,9 @@ php artisan migrate ## Step 7 : Configure NGINX -Follow the Laravel guide to create NGINX server block configuration at [Laravel NGINX Deployment Guide](https://laravel.com/docs/11.x/deployment#nginx) +Follow the [Laravel 13 NGINX deployment guide](https://laravel.com/docs/13.x/deployment#nginx) +to create the NGINX server block configuration. Point the document root at the project's +`public` directory. Finally, you need to restart NGINX. @@ -93,4 +98,4 @@ Once the server is running, you can access the InvoiceShelf application in your This guide should help you get started with InvoiceShelf development. If you have any questions or run into issues, feel free to open an issue on [GitHub](https://github.com/InvoiceShelf/InvoiceShelf/issues). -Happy coding! 🧑‍💻 \ No newline at end of file +Happy coding! 🧑‍💻 diff --git a/docs/index.md b/docs/index.md index 2dae614..deea959 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,17 +1,17 @@ # Introduction -InvoiceShelf is an open-source web & mobile app that helps you track expenses, payments & create professional invoices & estimates. +InvoiceShelf is an open-source, self-hosted web application for creating professional +invoices and estimates, tracking payments, and managing expenses. The supported product is +the web application, built with Laravel and Vue. -Web Application is made using Laravel & VueJS while the Mobile Apps are built using React Native. - -## Features: +## Features - [Dashboard](./guide/dashboard.md) - [Customers](./guide/customers.md) - [Items](./guide/items.md) - [Estimates](./guide/estimates.md) - [Invoices](./guide/invoices.md) -- [Recurring-Invoices](./guide/recurring-invoices.md) +- [Recurring invoices](./guide/recurring-invoices.md) - [Payments](./guide/payments.md) - [Expenses](./guide/expenses.md) - [Taxes](./guide/taxes.md) diff --git a/docs/install/docker.md b/docs/install/docker.md index b0250b6..9658c3b 100644 --- a/docs/install/docker.md +++ b/docs/install/docker.md @@ -5,11 +5,15 @@ lang: en-US # Docker Installation -We have pre-configured [Docker image](https://hub.docker.com/r/invoiceshelf/invoiceshelf) that can be run on your computer or cloud server. +InvoiceShelf publishes production images at +[Docker Hub](https://hub.docker.com/r/invoiceshelf/invoiceshelf). The supported Compose +examples live in [InvoiceShelf/docker](https://github.com/InvoiceShelf/docker), which is +separate from the application's development Docker environment. -Follow the steps bellow to get started. +Follow the steps below to get started. -If you notice any issues report it to [InvoiceShelf/docker](https://github.com/invoiceshelf/docker). +If you notice an issue with these production images or examples, report it to +[InvoiceShelf/docker](https://github.com/InvoiceShelf/docker). ## Step 1 : Install Docker @@ -20,34 +24,49 @@ Install Docker on your host: [https://docs.docker.com/install/](https://docs.doc Open terminal and clone the repository by running: ``` -git clone https://github.com/InvoiceShelf/docker +git clone https://github.com/InvoiceShelf/docker.git +cd docker ``` ## Step 3 : Prepare docker-compose -Navigate to the cloned repository folder (`docker`) and copy one of the example files (docker-compose.{db}.yml) to docker-compose.yml +Choose a database variant and copy it to `docker-compose.yml`: -If you want to use MySQL, take `docker-compose.mysql.yml` and copy it to `docker-compose.yml` in the same folder. +```bash +# SQLite (smallest setup; no separate database service) +cp docker-compose.sqlite.yml docker-compose.yml -This will make it possible to run `docker compose up/down` commands without specifying `-f path/to/docker-compose.yml` in the `docker` folder. +# or MariaDB +cp docker-compose.mysql.yml docker-compose.yml +# or PostgreSQL +cp docker-compose.pgsql.yml docker-compose.yml +``` + +The repository's default `docker-compose.yml` points to the SQLite variant, but copying +the selected file makes the configuration explicit and lets you use normal `docker compose` +commands without `-f`. + + +### 3.1 Configure your public address -### 3.1 Reverse Proxy Requirements -For spinning up the Docker Compose stack using reverse proxies and your own domain, the following environment variables are **required**:
+Before starting the stack, edit `docker-compose.yml`. Set these values to the address that +your browser uses to reach InvoiceShelf. Include a non-standard port in `APP_URL` and +`SANCTUM_STATEFUL_DOMAINS`; `SESSION_DOMAIN` is the hostname only. #### APP_URL - The full public URL (including protocol and port) where your application is accessed. Used for generating absolute URLs and redirects
+ The full public URL (including protocol and port) where your application is accessed. It is used for absolute URLs and redirects. - **Format**: `https://..` - **Examples**: - `APP_URL=http://192.168.1.200` - `APP_URL=http://192.168.1.200:8080` - - `APP_URL=http://199.199.1.199` # not recommended, run behind reverse proxy with SSL - - `APP_URL=http://invoiceshelf.acme.com` # not recommended, try adding SSL + - `APP_URL=http://199.199.1.199` + - `APP_URL=http://invoiceshelf.acme.com` - `APP_URL=https://invoiceshelf.acme.com` - `APP_URL=https://invoiceshelf.acme.com:8080` #### SESSION_DOMAIN - The domain used for session cookies. Include port if using non-standard ports
+ The domain used for session cookies. Do not include a protocol or port. - **With leading dot (.)**: Allows cookies across all subdomains (e.g., `.acme.com`) - **Without dot**: Restricts cookies to specific domain only (e.g., `invoiceshelf.acme.com`) - **Format**: `..` (note the leading dot for subdomain support) @@ -56,41 +75,55 @@ For spinning up the Docker Compose stack using reverse proxies and your own doma - `SESSION_DOMAIN=invoiceshelf.acme.com` (without dot for specific domain) #### SANCTUM_STATEFUL_DOMAINS -This is comma-separated list of domains allowed to manage stateful sessions. Typically includes your frontend domain(s) and ports
+This is a comma-separated list of domains allowed to manage stateful sessions. It normally +contains the same public host as `APP_URL`, including its port when one is used. - **Format**: Comma-separated list of domains - **Examples**: - `SANCTUM_STATEFUL_DOMAINS=invoiceshelf.acme.com` - `SANCTUM_STATEFUL_DOMAINS=invoiceshelf.acme.com,invoiceshelf.acme.com:8080` - `SANCTUM_STATEFUL_DOMAINS=localhost,localhost:3000,invoiceshelf.acme.com` -**Important**: Restart the container each time after modifying these variables in `docker-compose.yaml`. +For example, a reverse-proxied installation at `https://invoices.example.com` uses: + +```yaml +- APP_URL=https://invoices.example.com +- SESSION_DOMAIN=invoices.example.com +- SANCTUM_STATEFUL_DOMAINS=invoices.example.com +``` + +Restart the stack after changing these variables. ## Step 4 : Finalize & Run docker-compose -Edit `docker-compose.yml` and adjust the configuration as per your needs. +Edit `docker-compose.yml` and replace the example database credentials before exposing the +stack publicly. You may also pin the image tag instead of relying on `latest`. And finally, open Terminal in the `docker` folder and spin up InvoiceShelf app: ``` -$ docker compose up -d +docker compose up -d ``` ## Step 5 : Complete installation wizard -Open your web browser and go to your given domain and follow the installation wizard. +Open the public address configured in `APP_URL` (for the supplied examples, +`http://localhost:8090`) and complete the installation wizard. -##### 5.1. MySQL/PostgresSQL +##### 5.1. MariaDB/PostgreSQL -For MySQL or PostgreSQL, you can use the following Database setup: +For the MariaDB or PostgreSQL Compose variants, use the values you set in +`docker-compose.yml`. The database host is the Compose service name, `database`: -- Database Host: `invoiceshelf` +- Database Host: `database` - Database Name: `invoiceshelf` - Database Username: `invoiceshelf` - Database Password: `somepass` -**Important**: The database password `somepass` is example and should be changed in the docker-compose.yml file before you run the project, especially if you expose it in public. +`somepass` is only an example. Change it, the database name, and username in both relevant +services in `docker-compose.yml` before making the installation public. ##### 5.2. SQLite Database -Leave the `database.sqlite` path as is, otherwise it will NOT work correctly. +Select SQLite and leave the database path unchanged: +`/var/www/html/storage/app/database.sqlite`. diff --git a/docs/install/manual.md b/docs/install/manual.md index c140b6e..87cc745 100644 --- a/docs/install/manual.md +++ b/docs/install/manual.md @@ -5,23 +5,29 @@ lang: en-US # Manual Installation -Since InvoiceShelf is based on Laravel, the manual installation is very similar to Laravel. If you get stuck somewhere, you can also consult the official [Laravel guide](https://laravel.com/docs/11.x/deployment#nginx). +Since InvoiceShelf is based on Laravel 13, the manual installation is similar to a Laravel +deployment. If you get stuck, consult the official [Laravel 13 deployment guide](https://laravel.com/docs/13.x/deployment#nginx). ## Requirements ``` -PHP >= 8.2.0 +PHP >= 8.4 BCMath PHP Extension Ctype PHP Extension cURL PHP Extension DOM PHP Extension +Exif PHP Extension +Fileinfo PHP Extension Filter PHP Extension +GD PHP Extension Iconv PHP Extension +Intl PHP Extension JSON PHP Extension Mbstring PHP Extension OpenSSL PHP Extension PDO PHP Extension Session PHP Extension +SQLite3 PHP Extension Tokenizer PHP Extension XML PHP Extension ZIP PHP Extension @@ -29,9 +35,10 @@ ZIP PHP Extension ## Step 1 : Download -[Download](http://invoiceshelf.com/) the latest InvoiceShelf package. +[Download](https://invoiceshelf.com/download) the latest InvoiceShelf package. -Alternatively, If you are a developer, follow the instructions to setup development environment on [this Link](../developer-guide.md) +If you are a developer, follow the [development environment guide](../developer-guide.md) +instead. ## Step 2 : Upload to Server @@ -49,7 +56,7 @@ Please note that, InvoiceShelf must be installed on a primary domain or subdomai - `invoiceshelf.example.com` (Valid) - `invoiceshelf.test` (Valid) -## Step 3: Fix File Permissions +## Step 4: Fix File Permissions It is important to set the correct permissions for the storage and bootstrap/cache directories to ensure the application can write to these locations. Here are the steps: @@ -67,7 +74,7 @@ chown -R www-data:www-data storage chown -R www-data:www-data bootstrap/cache ``` -## Step 4 : Copy Environment File +## Step 5 : Copy Environment File 1. Locate the Example File: In the root directory of your project, find the file named `.env.example`. 2. Copy the `.env.example` file and create a new file named `.env` in the same root directory. @@ -75,19 +82,16 @@ chown -R www-data:www-data bootstrap/cache ```sh cp .env.example .env ``` -3. Make sure you set APP_KEY. You can generate one using: +3. Generate a unique `APP_KEY` on the server: ```sh php artisan key:generate ``` -or generate it manually on the [following link](https://generate-random.org/laravel-key-generator). - - By following these steps, you will create a new `.env` file that can be customized with your environment-specific settings. > For example, you can change the default SQLite database to MySQL or PostgreSQL. -## Step 5 : Complete installation wizard +## Step 6 : Complete installation wizard Open the link to the domain in the browser (Example: `https://demo.invoiceshelf.com`) and complete the installation wizard as directed. diff --git a/docs/installation.md b/docs/installation.md index 706e7ae..2e5b773 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -5,22 +5,23 @@ lang: en-US # Installation -InvoiceShelf can be installed with Docker or Manually. +This guide covers the supported InvoiceShelf 2.x release. InvoiceShelf 3.x is +still an alpha preview and should not be used with production data. -We usually recommend Docker because it is automatically packaged with all the required tools needed to run InvoiceShelf correct. +InvoiceShelf can be installed with Docker Compose or manually. For most self-hosted +installations, we recommend Docker Compose because the supported production images and +database variants are maintained in one place. ## Docker Installation -You can find more details about Docker Installation on the link below. +Use the official production Compose repository and choose SQLite, MariaDB, or PostgreSQL. [[Learn More]](./install/docker.md) ## Manual Installation -You can find more details about Manual Installation on the link below. +Use this option when you manage PHP, the web server, and the database yourself. [[Learn More]](./install/manual.md) - - diff --git a/docs/mobile.md b/docs/mobile.md index a8de754..232d807 100644 --- a/docs/mobile.md +++ b/docs/mobile.md @@ -1,3 +1,4 @@ -# Mobile Apps +# Mobile apps -The mobile APP is currently in development. The section will be updated as soon as we have initial version of it. +InvoiceShelf is currently available as a web application. Native mobile apps are not +available yet; this page will be updated when there is a supported mobile release. diff --git a/docs/translation-guide.md b/docs/translation-guide.md index 856f00f..d34f9ba 100644 --- a/docs/translation-guide.md +++ b/docs/translation-guide.md @@ -5,15 +5,15 @@ lang: en-US # Translation Guide -InvoiceShelf uses Crodwin.com to handle the translations. +InvoiceShelf uses [Crowdin](https://crowdin.com/) to manage translations. We welcome anyone that want to translate InvoiceShelf to their native language. -## Step 1 : Go to crowdin +## Step 1 : Go to Crowdin -Navigate to the project page on Crodwin.com. +Navigate to the InvoiceShelf project on Crowdin. -[[Navigate to Crodwin]](https://crowdin.com/project/invoiceshelf) +[[Open Crowdin]](https://crowdin.com/project/invoiceshelf) ## Step 2 : Open in Editor @@ -25,4 +25,4 @@ In the left sidebar you will see a list with languages, select your language. ## Step 4 : Start translating -You can go through each words and translate them. Do not forget to click on "Save" on each translated word. \ No newline at end of file +You can go through each words and translate them. Do not forget to click on "Save" on each translated word.