Files
jambotron/backups/tutorials.ndjson
T
2025-08-14 18:50:16 +03:00

5 lines
7.2 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{"id": 1, "body": "## Markdown __rulez__!\n---\n\n### Syntax highlight\n```typescript\nconst language = 'typescript';\n```\n\n### Lists\n1. Ordered list\n2. Another bullet point\n - Unordered list\n - Another unordered bullet\n\n### Blockquote\n> Blockquote to the max", "title": "Test 1", "userid": 1, "created": "2025-08-11T18:07:54.037686+03:00", "modified": "2025-08-11T18:07:54.037686+03:00", "published": true, "titleimage": "http://localhost:8082/files/Tutorial_user-image-1-07a460cf07aa41d1b7f2f9d2b9789c0b.png", "description": null, "tobepublished": true}
{"id": 3, "body": "## Markdown __rulez__!\n---\n\n### Syntax highlight\n```typescript\nconst language = 'typescript';\n```\n\n### Lists\n1. Ordered list\n2. Another bullet point\n - Unordered list\n - Another unordered bullet\n\n### Blockquote\n> Blockquote to the max", "title": "Test 2", "userid": 1, "created": "2025-08-11T18:08:33.839282+03:00", "modified": "2025-08-11T18:08:33.839403+03:00", "published": true, "titleimage": "http://localhost:8082/files/Tutorial_user-image-1-c4281de414ae44ba8e39e03f06c8f803.png", "description": null, "tobepublished": true}
{"id": 4, "body": "## Markdown __rulez__!\n---\n\n### Syntax highlight\n```typescript\nconst language = 'typescript';\n```\n\n### Lists\n1. Ordered list\n2. Another bullet point\n - Unordered list\n - Another unordered bullet\n\n### Blockquote\n> Blockquote to the max", "title": "Test 3", "userid": 1, "created": "2025-08-11T18:08:59.02719+03:00", "modified": "2025-08-11T18:08:59.02719+03:00", "published": true, "titleimage": "http://localhost:8082/files/Tutorial_user-image-1-0a55158e36d34fe8842ceac520bd6032.png", "description": null, "tobepublished": true}
{"id": 6, "body": "# How to run the application\n\nTo run the application, follow these steps:\n\n1. **Build the Project**:\n - Ensure you have Java 24, Gradle, and Node.js installed.\n - Run the following command to build the project:\n ```bash\n ./gradlew build\n ```\n\n 2. **Prepare Frontend Resources**:\n - Build the Angular frontend by navigating to the `jambotron-ui` directory and running\n ```bash\n cd jambotron-ui\n ```\n - next:\n ```bash\n npm install\n ```\n - next:\n ```bash\n npm run build\n ```\n - This will generate the frontend files in the `jambotron-ui/dist/jambotron-ui/browser` directory.\n\n\n3. **Copy Frontend Resources**:\n - Use the Gradle task to copy the frontend resources to the `jumbotron/src/main/resources/public` directory:\n ```bash\n cd ..\n ```\n - next:\n ```bash\n ./gradlew copyResources\n ```\n then\n4. **Create postgres server and database**:\n - Create a PostgreSQL database \n - named `jambotronDB` with the \n - user `admin` and \n - password `postgrespw`.\n \n - You can use a PostgreSQL client or run the following command in your terminal:\n ```sql\n CREATE DATABASE jambotronDB;\n CREATE USER admin WITH PASSWORD 'postgrespw';\n GRANT ALL PRIVILEGES ON DATABASE jambotronDB TO admin;\n ```\n - If you are using Docker, you can run PostgreSQL using the following command:\n - port 5433 is used.\n ```bash\n docker run --name postgresDB -p 5433:5432 -e POSTGRES_USER=admin -e POSTGRES_PASSWORD=postgrespw -e POSTGRES_DB=jambotronDB -d postgres\n ```\n - if you are wont to use pgadmin\n ```bash\n docker run --name pgadmin -e \"PGADMIN_DEFAULT_EMAIL=name@example.com\" -e \"PGADMIN_DEFAULT_PASSWORD=admin\" -p 5050:80 -d dpage/pgadmin4\n ```\n then\n - create a network for the containers to communicate:\n ```bash\n docker network create --driver bridge pgnetwork\n ```\n - Show list of networks:\n ```bash\n docker network ls\n ```\n - Connect pgadmin to the network:\n ```bash\n docker network connect pgnetwork pgadmin\n ```\n - Connect postgresDB to the network (postgresDB must by running):\n ```bash\n docker network connect pgnetwork postgresDB\n ```\n - Inspect the network to ensure both containers are connected:\n ```bash\n docker network inspect pgnetwork\n ```\n \n\n\n5. **Run the Application**:\n - Start the Spring Boot application:\n ```bash\n ./gradlew bootRun\n ```\n\n6. **Access the Application**:\n - Open your browser and navigate to `http://localhost:8080`.\n\nMake sure all dependencies and configurations are correctly set up before running these steps.\n\n\n\n\n# How to run the application in Docker\n\nTo run the application in Docker, follow these steps:\n\n- build jar file\n```bash\n./gradlew bootJar\n ```\n- Run docker compose to start the application and PostgreSQL:\n```bash\ndocker-compose -f src/Docker/docker-compose.yml up -d \n```\n- For connection from pgadmin use \nhostename: **host.docker.internal**\n\n# How to run the application in Docker with HTTPS support\n\nTo run the application in Docker with HTTPS support, follow these steps:\n\n1. **Cerbot**\n \n - Run this command below to get certificate and store it to volume certs.\n\n - Expanded(readable) command example:\n\n docker run -d \\\n --name certbot \\\n -v certs:/etc/letsencrypt \\\n -v certs-data:/var/lib/letsencrypt \\\n -p 80:80 \\\n -p 443:443 \\\n certbot/certbot \\\n certonly --standalone --preferred-challenges http --email youremail@gmail.com -d yourdomain.com --agree-tos\n\n - Command to run certbot with specific domain and email:\n ```bash\n docker run -d --name certbot -v certs:/etc/letsencrypt -v certs-data:/var/lib/letsencrypt -p 8081:80 -p 8443:443 certbot/certbot certonly --standalone --preferred-challenges http --email liosha84@gmail.com -d jambotron.run.place --agree-tos\n ```\n - Tip: You can generate certificate to local machine used next command:\n ```bash\n docker run -it --rm -p 8081:80 --name certbot -v \"C:\\certbot\\etc\\letsencrypt:/etc/letsencrypt\" -v \"C:\\certbot\\var\\lib\\letsencrypt:/var/lib/letsencrypt\" certbot/certbot certonly --standalone -d jambotron.run.place \n ```\n certificate files will be stored in `C:\\certbot\\etc\\letsencrypt` and `C:\\certbot\\var\\lib\\letsencrypt` directories.\n\n - If you have same trouble before running certbot, run this project\n `Helper_projects/spring-boot-https-main` insted of jambotron project.\n \n\n - TODO: Add cron job to renew certificate automatically.\n\n### Reference Documentation\nFor further reference, please consider the following sections:\n\n* [Official Gradle documentation](https://docs.gradle.org)\n* [Spring Boot Gradle Plugin Reference Guide](https://docs.spring.io/spring-boot/3.5.0/gradle-plugin)\n* [Create an OCI image](https://docs.spring.io/spring-boot/3.5.0/gradle-plugin/packaging-oci-image.html)\n\n### Additional Links\nThese additional references should also help you:\n\n* [Gradle Build Scans insights for your project's build](https://scans.gradle.com#gradle)\n\n\n\nFor docker-compose db connect with pgAdmin used\nhost.docker.internal", "title": "Test 4", "userid": 1, "created": "2025-08-11T18:10:12.111675+03:00", "modified": "2025-08-11T18:10:12.111675+03:00", "published": true, "titleimage": "http://localhost:8082/files/Tutorial_9a17dfe0-9d45-4e4f-bddc-d514b5774529.png", "description": null, "tobepublished": true}