Compare commits

...

9 Commits

Author SHA1 Message Date
Daniel Luiz Alves
da64d65401 feat: enable reverse proxy support and add pnpm.lock for custom builds in apps/web (#13) 2025-04-04 23:40:35 -03:00
Daniel Luiz Alves
7b2f15dcd5 refactor: remove lock files from .gitignore and update vite config
Remove unnecessary lock files from .gitignore to streamline version control. Update Vite configuration to allow all hosts in both development and preview modes for better accessibility
2025-04-04 23:37:08 -03:00
Daniel Luiz Alves
ca7bdefcdb Merge branch 'main' of github.com:kyantech/Palmr 2025-04-04 00:44:02 -03:00
Daniel Luiz Alves
92b437ee36 chore: bump version to 1.1.6 across all apps 2025-04-04 00:41:55 -03:00
Daniel Luiz Alves
fcaef88850 docs: update installation guide with security and deployment details
Add a new section "Quick Start with Default Docker Compose" to emphasize the risks of using default credentials and provide recommendations for secure deployment. Clarify the usage of Docker Compose for different environments (local, production) and update port configuration recommendations with a warning about ReactJS limitations.
2025-04-04 00:40:49 -03:00
Daniel Luiz Alves
68d6fd09af chore: add docker-compose.yaml and update .gitignore
Add docker-compose.yaml to define services for the application stack, including API, app, MinIO, and PostgreSQL. Remove docker-compose.yaml from .gitignore to track it in version control
2025-04-04 00:12:02 -03:00
Daniel Luiz Alves
1768aa81b7 Update README.md 2025-04-03 16:16:27 -03:00
Daniel Luiz Alves
644fc7aa30 Update README.md 2025-04-03 16:15:34 -03:00
Daniel Luiz Alves
cc6fe6d62e Update README.md 2025-04-03 16:15:06 -03:00
10 changed files with 9311 additions and 24 deletions

5
.gitignore vendored
View File

@@ -26,7 +26,4 @@ apps/web/*.sw?
#SERVER
apps/server/node_modules
apps/server/.env
apps/server/dist/*
#COMPOSE
docker-compose.yaml
apps/server/dist/*

View File

@@ -47,6 +47,18 @@
|------------------|
| <img src="https://github.com/danielalves96.png" width="150px" alt="Daniel Luiz Alves" /> |
</br>
## ⭐ Star History
<a href="https://www.star-history.com/#kyantech/Palmr&Date">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=kyantech/Palmr&type=Date&theme=dark" />
<source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/svg?repos=kyantech/Palmr&type=Date" />
<img alt="Star History Chart" src="https://api.star-history.com/svg?repos=kyantech/Palmr&type=Date" />
</picture>
</a>
## 🛠️ Contributing
For contribution guidelines, please refer to the [CONTRIBUTING.md](CONTRIBUTING.md) file.

View File

@@ -1,7 +1,7 @@
{
"name": "palmr-docs",
"type": "module",
"version": "0.0.1",
"version": "1.1.6",
"scripts": {
"dev": "astro dev",
"start": "astro preview",

View File

@@ -5,9 +5,23 @@ description: Guide to install and run Palmr using Docker Compose
import { Tabs, TabItem } from '@astrojs/starlight/components';
### Startup Script for Docker Compose
### Quick Start with Default Docker Compose
To simplify the execution of the project and enable it to run on any machine, a **startup script** for Docker Compose was created. This script automates the generation of secure credentials and facilitates local setup.
There is a default `docker-compose.yml` file in the project root that can be used for quick execution. While this provides a convenient way to get started, it's important to note that using the default passwords is **not secure**, especially if the application is exposed to public networks. Malicious users could potentially exploit known default credentials to attack your deployment.
This base Docker Compose configuration works perfectly for localhost development but may require modifications when deployed to a VPS or production environment for optimal performance and security. Please consult the complete documentation for proper production deployment configurations.
For a quick start using the default configuration, simply run:
```bash
docker compose up -d
```
This command will start the project using the default configuration.
> ⚠️ **Important:** We strongly recommend testing your configuration locally first, especially if you've made any modifications to the Docker Compose files. Only after confirming everything works as expected locally should you proceed with deployment to a VPS or server environment.
### Startup Script for Docker Compose
To simplify the execution of the project and enable it to run on any machine, a **startup script** for Docker Compose was created. This script automates the generation of secure credentials and facilitates local setup. While this method provides better security than using default passwords, for maximum security, we strongly recommend moving all sensitive credentials to environment variables instead.
To execute the project using this approach, you need to have **Docker** and **Docker Compose** installed on your machine. While this is the simplest way to execute the project, it is **not recommended for production environments**.
@@ -23,13 +37,13 @@ There are two ways to execute the script:
<TabItem label="1. Using a Makefile">
To use this method, you need to have the `make` command installed on your machine.
To generate the `docker-compose.yml` file using a Makefile, run the following command from the project root:
To generate the new `docker-compose.yml` file using a Makefile, run the following command from the project root:
```bash
make gen-compose
```
This command will generate a `docker-compose.yml` file in the root of the project.
This command will subcribe the `docker-compose.yml` file in the root of the project.
- The script's primary function is to generate secure passwords for **MinIO** (object storage) and **Postgres** (database).
- The generated `docker-compose.yml` file serves as a base and can be modified at any time.
- It is configured to run locally via `localhost` and is **not intended for production** or VPS environments.
@@ -51,7 +65,7 @@ There are two ways to execute the script:
---
### Running the Project
After generating the `docker-compose.yml` file, you can start the project by running the following command from the project root:
After generating the new `docker-compose.yml` file, you can start the project by running the following command from the project root:
```bash
docker compose up -d
@@ -64,9 +78,9 @@ To access Palmr. in a local environment, open your browser and visit:
---
### Deployment in Production
For production environments, we recommend using **Kubernetes**, **Docker Swarm**, or a similar container orchestrator.
For production environments with high scalability and availability requirements, we recommend using **Kubernetes**, **Docker Swarm**, or a similar container orchestrator.
For local execution or testing environments, you can use Docker Compose with the `docker-compose.yml` file. This file pulls the latest Palmr. images from Docker and makes them available on specific ports, as shown below:
For homelab, personal projects, or environments where high availability and scalability are not critical, Docker Compose can be used without issues. The `docker-compose.yml` file pulls the latest Palmr. images from Docker and makes them available on specific ports, as shown below:
- **Frontend:** [http://localhost:4173](http://localhost:4173)
- **Backend:** [http://localhost:3333](http://localhost:3333)
@@ -79,7 +93,7 @@ For local execution or testing environments, you can use Docker Compose with the
### Port Configuration Recommendations
In this version of `docker-compose.yml`, none of the ports for the frontend and backend should be modified. Consequently, none of the URLs should be changed because the frontend image contains a pre-built version configured to work on port **4173**.
Due to technical limitations related to **ReactJS**, environment variables executed at runtime cannot be changed. Therefore, to ensure that the system functions correctly as designed, keep the `docker-compose.yml` file unchanged.
> ⚠️ Due to technical limitations related to **ReactJS**, environment variables executed at runtime cannot be changed. Therefore, to ensure that the system functions correctly as designed, keep the `docker-compose.yml` file unchanged.
---

View File

@@ -1,6 +1,6 @@
{
"name": "palmr-api",
"version": "1.1.5",
"version": "1.1.6",
"description": "",
"main": "index.js",
"scripts": {

6
apps/web/.gitignore vendored
View File

@@ -22,9 +22,3 @@ dist-ssr
*.njsproj
*.sln
*.sw?
pnpm-lock.yaml
yarn.lock
package-lock.json
bun.lockb

View File

@@ -1,7 +1,7 @@
{
"name": "vite-template",
"private": true,
"version": "1.1.5",
"version": "1.1.6",
"type": "module",
"scripts": {
"dev": "vite",

9166
apps/web/pnpm-lock.yaml generated Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -2,15 +2,16 @@ import react from "@vitejs/plugin-react";
import { defineConfig } from "vite";
import tsconfigPaths from "vite-tsconfig-paths";
// https://vitejs.dev/config/
export default defineConfig({
plugins: [react(), tsconfigPaths()],
server: {
host: "0.0.0.0", // Importante para aceitar conexões externas
host: "0.0.0.0",
port: 5173,
allowedHosts: true
},
preview: {
host: "0.0.0.0", // Para modo de produção
host: "0.0.0.0",
port: 4173,
allowedHosts: true
},
});

103
docker-compose.yaml Normal file
View File

@@ -0,0 +1,103 @@
services:
palmr-api:
image: kyantech/palmr-api:latest
container_name: palmr-api
depends_on:
postgres:
condition: "service_healthy"
minio:
condition: "service_healthy"
environment:
- PORT=3333
- DATABASE_URL=postgresql://postgres:postgresRootPassword@postgres:5432/palmr_db?schema=public
- MINIO_ENDPOINT=minio
- MINIO_PORT=9000
- MINIO_USE_SSL=false
- MINIO_ROOT_USER=minio_root_user
- MINIO_ROOT_PASSWORD=minioRootPassword
- MINIO_REGION=sa-east-1
- MINIO_BUCKET_NAME=files
- FRONTEND_URL=http://localhost:4173
- BASE_URL=http://localhost:3333
ports:
- "3333:3333"
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3333/health"]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
palmr-app:
image: kyantech/palmr-app:latest
container_name: palmr-web
ports:
- "4173:4173"
depends_on:
palmr-api:
condition: "service_healthy"
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:4173"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
minio:
image: minio/minio:RELEASE.2025-03-12T18-04-18Z
container_name: minio
environment:
- MINIO_ROOT_USER=minio_root_user
- MINIO_ROOT_PASSWORD=minioRootPassword
- MINIO_SITE_REGION=sa-east-1
command: server /data --console-address ":9001"
volumes:
- minio_data:/data
ports:
- "9000:9000"
- "9001:9001"
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/ready"]
interval: 10s
timeout: 5s
retries: 5
minio-init:
image: minio/mc:RELEASE.2025-03-12T17-29-24Z
container_name: minio-init
depends_on:
minio:
condition: "service_healthy"
restart: "no"
entrypoint: >
sh -c "
sleep 5 &&
mc alias set myminio http://minio:9000 minio_root_user minioRootPassword &&
mc mb myminio/files --ignore-existing &&
mc anonymous set download myminio/files
"
postgres:
image: bitnami/postgresql:17.2.0
container_name: palmr-postgres
environment:
- POSTGRESQL_USERNAME=postgres
- POSTGRESQL_PASSWORD=postgresRootPassword
- POSTGRESQL_DATABASE=palmr_db
volumes:
- postgres_data:/bitnami/postgresql
ports:
- "5432:5432"
restart: unless-stopped
healthcheck:
test: ["CMD", "pg_isready", "-U", "palmr"]
interval: 10s
timeout: 5s
retries: 5
volumes:
minio_data:
postgres_data: