Skip to content

Commit 45ab57a

Browse files
committed
Update README.md
1 parent b092145 commit 45ab57a

File tree

1 file changed

+26
-71
lines changed

1 file changed

+26
-71
lines changed

crates/cargo-rustapi/README.md

Lines changed: 26 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,26 @@
11
# cargo-rustapi
22

3-
CLI tool for the RustAPI framework - Project scaffolding and development utilities.
3+
The official CLI tool for the RustAPI framework. Scaffold new projects, run development servers, and manage database migrations.
44

55
## Installation
66

7-
```bash
7+
`ash
88
cargo install cargo-rustapi
9-
```
9+
`
10+
11+
## Features
12+
13+
- **Project Scaffolding**: Create new projects with
14+
ew command, choosing from templates like pi, web, or ull.
15+
- **Development Server**: Run your project with un command, supporting hot-reloading (via cargo-watch integration if available).
16+
- **Code Generation**: Generate handlers, models, and CRUD operations with generate.
17+
- **Database Management**: (Planned) Simple wrappers around migration tools.
1018

1119
## Usage
1220

1321
### Create a New Project
1422

15-
```bash
23+
`ash
1624
# Interactive mode
1725
cargo rustapi new my-project
1826

@@ -21,91 +29,38 @@ cargo rustapi new my-project --template api
2129

2230
# With features
2331
cargo rustapi new my-project --features jwt,cors
24-
```
25-
26-
### Available Templates
27-
28-
- `minimal` - Bare minimum RustAPI app (default)
29-
- `api` - REST API with CRUD example
30-
- `web` - Web app with templates
31-
- `full` - Full-featured with JWT, CORS, database
32+
`
3233

3334
### Run Development Server
3435

35-
```bash
36+
`ash
3637
# Run with auto-reload
3738
cargo rustapi run
3839

3940
# Run on specific port
4041
cargo rustapi run --port 8080
41-
42-
# Run with specific features
43-
cargo rustapi run --features jwt
44-
```
42+
`
4543

4644
### Generate Code
4745

48-
```bash
46+
`ash
4947
# Generate a new handler
5048
cargo rustapi generate handler users
5149

5250
# Generate a model
5351
cargo rustapi generate model User
5452

55-
# Generate CRUD endpoints
53+
# Generate CRUD endpoints (Handlers + Models + Tests)
5654
cargo rustapi generate crud users
57-
```
58-
59-
## Commands
60-
61-
| Command | Description |
62-
|---------|-------------|
63-
| `new <name>` | Create a new RustAPI project |
64-
| `run` | Run development server with auto-reload |
65-
| `generate <type> <name>` | Generate code from templates |
66-
| `docs` | Open API documentation |
67-
68-
## Project Templates
69-
70-
### Minimal Template
71-
```
72-
my-project/
73-
├── Cargo.toml
74-
├── src/
75-
│ └── main.rs
76-
└── .gitignore
77-
```
78-
79-
### API Template
80-
```
81-
my-project/
82-
├── Cargo.toml
83-
├── src/
84-
│ ├── main.rs
85-
│ ├── handlers/
86-
│ │ └── mod.rs
87-
│ ├── models/
88-
│ │ └── mod.rs
89-
│ └── error.rs
90-
├── .env.example
91-
└── .gitignore
92-
```
93-
94-
### Web Template
95-
```
96-
my-project/
97-
├── Cargo.toml
98-
├── src/
99-
│ ├── main.rs
100-
│ └── handlers/
101-
├── templates/
102-
│ ├── base.html
103-
│ └── index.html
104-
├── static/
105-
│ └── style.css
106-
└── .gitignore
107-
```
55+
`
56+
57+
## Templates
58+
59+
- minimal: Bare bones setup.
60+
- pi: REST API structure with handlers and models.
61+
- web: Includes ustapi-view and emplates folder.
62+
- ull: Complete setup with Auth, DB (SQLx), and more.
10863

10964
## License
11065

111-
MIT OR Apache-2.0
66+
MIT OR Apache-2.0

0 commit comments

Comments
 (0)