Skip to content

Commit 401c3e6

Browse files
committed
docs update
1 parent aecc318 commit 401c3e6

File tree

16 files changed

+81
-206
lines changed

16 files changed

+81
-206
lines changed
Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,26 @@
11
# Advanced Flag in Blueprint
22

3-
The `--advanced` flag in Blueprint serves as a switch to enable additional features during project creation. It is applied with the `create` command and unlocks the following features:
4-
5-
- **HTMX Support using Templ:**
6-
Enables the integration of HTMX support for dynamic web pages using Templ.
3+
The `--advanced` or `-a` flag in Blueprint serves as a switch to enable additional features during project creation. It is applied with the `create` command and unlocks the following features:
74

85
- **CI/CD Workflow Setup using GitHub Actions:**
96
Automates the setup of a CI/CD workflow using GitHub Actions.
107

118
- **Websocket Support:**
129
WebSocket endpoint that sends continuous data streams through the WS protocol.
1310

14-
- **Tailwind:**
15-
Adds Tailwind CSS support to the project.
16-
1711
- **Docker:**
1812
Docker configuration for go project.
1913

20-
- **React:**
21-
Frontend written in TypeScript, including an example fetch request to the backend.
22-
23-
2414
To utilize the `--advanced` flag, use the following command:
2515

2616
```bash
27-
go-blueprint create --name <project_name> --backend <selected_backend> --driver <selected_driver> --advanced
17+
go-blueprint create -n <project_name> -b <selected_backend> -driver <selected_driver> -a
2818
```
2919

30-
By including the `--advanced` flag, users can choose one or all of the advanced features. The flag enhances the simplicity of Blueprint while offering flexibility for users who require additional functionality.
31-
32-
To recreate the project using the same configuration semi-interactively, use the following command:
33-
```bash
34-
go-blueprint create --name my-project --backend chi --driver mysql --advanced
35-
```
20+
By including the `--advanced` flag, users can choose one or all of the advanced features. The flag enhances the simplicity of Blueprint while offering flexibility for users who require additional functionality.
3621

3722
Non-Interactive Setup is also possible:
3823

3924
```bash
40-
go-blueprint create --name my-project --backend chi --driver mysql --advanced --feature htmx --feature githubaction --feature websocket --feature tailwind
25+
go-blueprint create -n my_project -b standard-library -d redis -a --feature docker --feature githubaction --feature websocket -g commit
4126
```

docs/docs/advanced-flag/goreleaser.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ The job outlined in this workflow includes the following steps:
3232
Fetches the project's codebase from the repository.
3333

3434
2. **Go Setup:**
35-
Configures the Go environment with version 1.21.x.
35+
Configures the Go environment with version 1.23.x.
3636

3737
3. **Build and Test:**
3838
Builds the project using `go build` and runs tests across all packages (`./...`) using `go test`.
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
Created project can utilizes several Go web backends to handle HTTP routing and server functionality. The chosen backends are:
22

3-
1. [**Chi**](https://github.com/go-chi/chi): Lightweight and flexible router for building Go HTTP services.
4-
2. [**Echo**](https://github.com/labstack/echo): High-performance, extensible, minimalist Go web framework.
5-
3. [**Fiber**](https://github.com/gofiber/fiber): Express-inspired web framework designed to be fast, simple, and efficient.
6-
4. [**Gin**](https://github.com/gin-gonic/gin): A web framework with a martini-like API, but with much better performance.
3+
1. [**Standard-library**](https://pkg.go.dev/std): Offers a vast collection of packages and functions.
4+
2. [**Chi**](https://github.com/go-chi/chi): Lightweight and flexible router for building Go HTTP services.
5+
3. [**Gin**](https://github.com/gin-gonic/gin): A web framework with a martini-like API, but with much better performance.
6+
4. [**Fiber**](https://github.com/gofiber/fiber): Express-inspired web framework designed to be fast, simple, and efficient.
77
5. [**Gorilla/mux**](https://github.com/gorilla/mux): A powerful URL router and dispatcher for Golang.
8-
6. [**HttpRouter**](https://github.com/julienschmidt/httprouter): A high-performance HTTP request router that scales well.
8+
6. [**Echo**](https://github.com/labstack/echo): High-performance, extensible, minimalist Go web framework.
99

1010
## Project Structure
1111

docs/docs/blueprint-core/db-drivers.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
To extend the project with database functionality, users can choose from a variety of Go database drivers. Each driver is tailored to work with specific database systems, providing flexibility based on project requirements:
22

3-
1. [Mongo](https://go.mongodb.org/mongo-driver): Provides necessary tools for connecting and interacting with MongoDB databases.
4-
2. [Mysql](https://github.com/go-sql-driver/mysql): Enables seamless integration with MySQL databases.
5-
3. [Postgres](https://github.com/jackc/pgx/): Facilitates connectivity to PostgreSQL databases.
6-
4. [Redis](https://github.com/redis/go-redis): Provides tools for connecting and interacting with Redis.
7-
5. [Sqlite](https://github.com/mattn/go-sqlite3): Suitable for projects requiring a lightweight, self-contained database. and interacting with Redis
3+
1. [Mysql](https://github.com/go-sql-driver/mysql): Enables seamless integration with MySQL databases.
4+
2. [Postgres](https://github.com/jackc/pgx/): Facilitates connectivity to PostgreSQL databases.
5+
3. [Sqlite](https://github.com/mattn/go-sqlite3): Suitable for projects requiring a lightweight, self-contained database.
6+
4. [Mongo](https://go.mongodb.org/mongo-driver): Provides necessary tools for connecting and interacting with MongoDB databases.
7+
5. [Redis](https://github.com/redis/go-redis): Provides tools for connecting and interacting with Redis.
88
6. [ScyllaDB](https://github.com/scylladb/gocql): Facilitates connectivity to ScyllaDB databases.
99

1010
## Updated Project Structure

docs/docs/blueprint-ui.md

Lines changed: 0 additions & 7 deletions
This file was deleted.

docs/docs/creating-project/project-init.md

Lines changed: 20 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -15,62 +15,48 @@ This command will interactively guide you through the project setup process, all
1515
For a non-interactive setup, you can use flags to provide the necessary information during project creation. Here's an example:
1616

1717
```
18-
go-blueprint create --name my-project --backend gin --driver postgres --git commit
18+
go-blueprint create -n my-project -b chi -d postgres -g commit
1919
```
2020

2121
In this example:
2222

23-
- `--name`: Specifies the name of the project (replace "my-project" with your desired project name).
24-
- `--backend`: Specifies the Go backend to be used (e.g., "gin").
25-
- `--driver`: Specifies the database driver to be integrated (e.g., "postgres").
26-
- `--git`: Specifies the git configuration option of the project (e.g., "commit").
23+
- `-n` or `--name`: Specifies the name of the project (replace "my-project" with your desired project name).
24+
- `-b` or `--backend`: Specifies the Go backend to be used (e.g., "gin").
25+
- `-d` or `--driver`: Specifies the database driver to be integrated (e.g., "postgres").
26+
- `-g` or `--git`: Specifies the git configuration option of the project (e.g., "commit").
2727

2828
Customize the flags according to your project requirements.
2929

30-
## Advanced Flag
30+
## Frontend Frameworks and Features
3131

32-
By including the `--advanced` flag, users can choose one or all of the advanced features, HTMX, GitHub Actions for CI/CD, Websocket, Docker and TailwindCSS support, during the project creation process. The flag enhances the simplicity of Blueprint while offering flexibility for users who require additional functionality.
32+
To include frontend frameworks and features in your project, you can use the `-f` flag to trigger the prompt:
3333

3434
```bash
35-
go-blueprint create --advanced
35+
go-blueprint create -f
3636
```
3737

38-
To recreate the project using the same configuration semi-interactively, use the following command:
38+
![FrontendFlag](../public/blueprint_frontend.png)
39+
40+
## Advanced Flag
41+
42+
By including the `-a` or `--advanced` flag, users can choose one or all of the advanced features, GitHub Actions for CI/CD, Websocket and Docker, during the project creation process. The flag enhances the simplicity of Blueprint while offering flexibility for users who require additional functionality.
43+
3944
```bash
40-
go-blueprint create --name my-project --backend chi --driver mysql --git commit --advanced
45+
go-blueprint create -a
4146
```
42-
This approach opens interactive mode only for advanced features, which allow you to choose the one or combination of available features.
4347

4448
![AdvancedFlag](../public/blueprint_advanced.png)
4549

46-
## Non-Interactive Setup
47-
48-
Advanced features can be enabled using the `--feature` flag along with the `--advanced` flag:
50+
## Combining Flags
4951

50-
HTMX:
51-
```bash
52-
go-blueprint create --advanced --feature htmx
53-
```
52+
Frontend and Advanced features can be combined with the `-f` and `-a` flags
5453

55-
CI/CD workflow:
5654
```bash
57-
go-blueprint create --advanced --feature githubaction
55+
go-blueprint create -af
5856
```
5957

60-
Websocket:
61-
```bash
62-
go-blueprint create --advanced --feature websocket
63-
```
64-
TailwindCSS:
65-
```bash
66-
go-blueprint create --advanced --feature tailwind
67-
```
68-
Docker:
69-
```bash
70-
go-blueprint create --advanced --feature docker
71-
```
58+
or
7259

73-
Or all features at once:
7460
```bash
75-
go-blueprint create --name my-project --backend chi --driver mysql --git commit --advanced --feature htmx --feature githubaction --feature websocket --feature tailwind --feature docker
61+
go-blueprint create -n my_project -b fiber -d mysql -f --frontend-framework htmx --frontend-advanced tailwind -a --feature docker --feature githubaction -g commit
7662
```

docs/docs/endpoints-test/redis.md

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -113,56 +113,6 @@ The `Sample Output` is dynamic and unstructured since it depends on the raw map.
113113
}
114114
```
115115

116-
- `XML serialization/deserialization`
117-
118-
```xml
119-
<?xml version="1.0" encoding="UTF-8"?>
120-
<redis_health>
121-
<status>up</status>
122-
<message>Redis connection pool utilization is high</message>
123-
<stats>
124-
<version>7.0.15</version>
125-
<mode>standalone</mode>
126-
<connected_clients>10</connected_clients>
127-
<memory>
128-
<used>
129-
<mb>22.38</mb>
130-
<gb>0.02</gb>
131-
</used>
132-
<peak>
133-
<mb>46.57</mb>
134-
<gb>0.05</gb>
135-
</peak>
136-
<free>
137-
<mb>1130.00</mb>
138-
<gb>1.10</gb>
139-
</free>
140-
<percentage>1.98%</percentage>
141-
</memory>
142-
<uptime_stats>6 days, 3 hours, 37 minutes, 20 seconds</uptime_stats>
143-
<uptime>
144-
<day>6</day>
145-
<hour>3</hour>
146-
<minute>37</minute>
147-
<second>20</second>
148-
</uptime>
149-
<pooling>
150-
<figures>
151-
<hits>10</hits>
152-
<misses>2</misses>
153-
<timeouts>0</timeouts>
154-
<total>4</total>
155-
<stale>9</stale>
156-
<idle>5</idle>
157-
<active>0</active>
158-
<percentage>62.50%</percentage>
159-
</figures>
160-
<observed_total>26</observed_total>
161-
</pooling>
162-
</stats>
163-
</redis_health>
164-
```
165-
166116
## Code Implementation
167117

168118
```go
File renamed without changes.
Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
This template provides a minimal setup for getting React working with Vite for the frontend and go on the backend. It allows you to easily integrate React with Tailwind CSS and Vite for fast development.
22

3-
The React advanced flag can be combined with the Tailwind flag for enhanced styling capabilities.
3+
The React fronted flag can be combined with the Tailwind flag for enhanced styling capabilities.
44

55
## Project Structure
66

@@ -66,10 +66,21 @@ You can extend the `vite.config.ts` to include additional configurations as need
6666
The make run target will start the Go server in the backend, install frontend dependencies, and run the Vite development server for the frontend.
6767

6868
```bash
69-
run:
70-
@go run cmd/api/main.go &
71-
@npm install --prefix ./frontend
72-
@npm run dev --prefix ./frontend
69+
run: build
70+
@echo "Starting server..."
71+
@./main & \
72+
SERVER_PID=$$!; \
73+
sleep 2; \
74+
if ps -p $$SERVER_PID > /dev/null; then \
75+
echo "Server started successfully"; \
76+
cd frontend && \
77+
npm install --prefer-offline --no-fund && \
78+
npm run dev; \
79+
kill $$SERVER_PID; \
80+
else \
81+
echo "Server failed to start. Check the logs."; \
82+
exit 1; \
83+
fi
7384
```
7485

7586
After running this command, you can verify the connection between the frontend and backend by checking the console. You can also fetch data from the backend to test the integration.
@@ -78,7 +89,7 @@ After running this command, you can verify the connection between the frontend a
7889

7990
## Dockerfile
8091

81-
Combine React advanced flag with Docker flag to get Docker and docker-compose configuration and run them with:
92+
Combine React flag with advanced Docker flag to get Docker and docker-compose configuration and run them with:
8293

8394
```bash
8495
make docker-run
@@ -217,7 +228,7 @@ The `VITE_PORT` in .env refers `PORT` from .env in project root ( for backend ).
217228

218229
## Notes
219230

220-
- First time running the project creation with Tailwind can take longer (~10 mins) as npm needs to download and cache all packages
231+
- The first time running project creation with Tailwind may take longer as npm needs to download and cache all packages.
221232

222233
- Subsequent runs will be faster as they utilize npm's cache, which we enforce during project creation.
223234

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
Tailwind is closely coupled with the advanced HTMX flag, and HTMX will be automatically used if you select Tailwind in your project.
1+
Tailwind is closely coupled with the fronted HTMX and React flags.
22

3-
We do not introduce outside dependencies automatically, and you need compile output.css (file is empty by default) with the Tailwind CLI tool.
3+
For HTMX we do not introduce outside dependencies automatically, and you need compile output.css (file is empty by default) with the Tailwind CLI tool.
44

55
The project tree would look like this:
66
```bash

0 commit comments

Comments
 (0)