You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+62-5Lines changed: 62 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,9 +11,14 @@ A Rust project template featuring a todo application with SQLite database and te
11
11
- 🚀 CI/CD with GitHub Actions
12
12
- 📦 Cross-platform releases
13
13
- 🔒 Security auditing
14
+
- 🐳 Docker and Docker Compose support
15
+
- ❄️ Nix flakes for reproducible environments
16
+
- 📦 Devcontainer configuration for GitHub Codespaces
14
17
15
18
## Installation
16
19
20
+
> **💡 Quick Start**: See [SETUP.md](SETUP.md) for detailed setup instructions using Docker, Nix, Codespaces, or local development.
21
+
17
22
### From Source
18
23
19
24
```bash
@@ -26,6 +31,33 @@ cargo build --release
26
31
27
32
Download the latest binary from the [Releases](https://github.com/pnstack/template-rust/releases) page.
28
33
34
+
### With Docker
35
+
36
+
```bash
37
+
# Build the image
38
+
docker build -t template-rust:latest .
39
+
40
+
# Run with interactive TUI
41
+
docker run --rm -it -v $(pwd)/data:/app/data template-rust:latest tui
42
+
43
+
# Or use Docker Compose
44
+
docker compose up
45
+
```
46
+
47
+
### With Nix
48
+
49
+
```bash
50
+
# Enter development environment
51
+
nix develop
52
+
53
+
# Or run directly
54
+
nix run
55
+
```
56
+
57
+
### With GitHub Codespaces
58
+
59
+
Click the "Code" button on GitHub and select "Create codespace on main" - everything is pre-configured!
60
+
29
61
## Usage
30
62
31
63
### Command Line Interface
@@ -93,15 +125,28 @@ template-rust/
93
125
94
126
## Development
95
127
128
+
> **📚 Full Setup Guide**: See [SETUP.md](SETUP.md) for comprehensive development environment setup instructions.
129
+
96
130
### Prerequisites
97
131
98
-
- Rust 1.70 or later
99
-
- SQLite3
132
+
Choose your preferred development method:
133
+
134
+
-**Local**: Rust 1.70 or later, SQLite3
135
+
-**Docker**: Docker 20.10+ and Docker Compose
136
+
-**Nix**: Nix package manager with flakes enabled
137
+
-**Codespaces**: Just a GitHub account!
100
138
101
139
### Building
102
140
103
141
```bash
142
+
# Local
104
143
cargo build
144
+
145
+
# Docker
146
+
docker compose up --build
147
+
148
+
# Nix
149
+
nix build
105
150
```
106
151
107
152
### Running Tests
@@ -122,6 +167,15 @@ cargo clippy -- -D warnings
122
167
cargo fmt
123
168
```
124
169
170
+
### Development Environments
171
+
172
+
The project provides multiple development environment options:
173
+
174
+
-**Docker Compose**: `docker compose up dev` - Containerized development with live code mounting
175
+
-**Nix Flakes**: `nix develop` - Reproducible environment with all dependencies
176
+
-**Devcontainer**: Open in VS Code or GitHub Codespaces - Fully configured IDE
177
+
-**Traditional**: Local Rust installation with cargo
178
+
125
179
## Database
126
180
127
181
The application uses SQLite for persistence. By default, it creates a `todo.db` file in the current directory. You can specify a different database path:
@@ -140,9 +194,12 @@ For testing with in-memory database:
140
194
141
195
The project includes comprehensive GitHub Actions workflows:
142
196
143
-
-**CI**: Build, test, lint, and format checks on multiple platforms
144
-
-**Security**: Weekly security audits with `cargo audit`
145
-
-**Release**: Automated binary releases for Linux, macOS, and Windows
197
+
-**CI** (`ci.yml`): Build, test, lint, and format checks on multiple platforms (Linux, macOS, Windows)
198
+
-**Security** (`security.yml`): Weekly security audits with `cargo audit`
199
+
-**Release** (`release.yml`): Automated binary releases for Linux, macOS, and Windows on version tags
200
+
-**Docker** (`docker.yml`): Docker image build testing and docker-compose validation
201
+
202
+
All workflows run automatically on push and pull requests to ensure code quality and security.
0 commit comments