Skip to content

Commit 76d67d6

Browse files
FEATURE (docs): Update docs how to run frontend and backend
1 parent 7adb921 commit 76d67d6

File tree

4 files changed

+64
-64
lines changed

4 files changed

+64
-64
lines changed

backend/Makefile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
run:
2+
go run cmd/main.go
3+
4+
test:
5+
go test -count=1 ./internal/...
6+
7+
lint:
8+
golangci-lint fmt && golangci-lint run
9+
10+
migration-create:
11+
goose create $(name) sql
12+
13+
migration-up:
14+
goose up
15+
16+
migration-down:
17+
goose down
18+
19+
swagger:
20+
swag init -g ./cmd/main.go -o swagger

backend/README.md

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,44 +9,39 @@ instead of postgresus-db from docker-compose.yml in the root folder.
99
1010
# Run
1111

12-
To build:
13-
14-
> go build /cmd/main.go
15-
1612
To run:
1713

18-
> go run /cmd/main.go
14+
> make run
1915
2016
To run tests:
2117

22-
> go test ./internal/...
18+
> make test
2319
2420
Before commit (make sure `golangci-lint` is installed):
2521

26-
> golangci-lint fmt
27-
> golangci-lint run
22+
> make lint
2823
2924
# Migrations
3025

3126
To create migration:
3227

33-
> goose create MIGRATION_NAME sql
28+
> make migration-create name=MIGRATION_NAME
3429
3530
To run migrations:
3631

37-
> goose up
32+
> make migration-up
3833
3934
If latest migration failed:
4035

4136
To rollback on migration:
4237

43-
> goose down
38+
> make migration-down
4439
4540
# Swagger
4641

4742
To generate swagger docs:
4843

49-
> swag init -g .\cmd\main.go -o swagger
44+
> make swagger
5045
5146
Swagger URL is:
5247

contribute/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Example:
3737
Before any commit, make sure:
3838

3939
1. You created critical tests for your changes
40-
2. `golangci-lint fmt` and `golangci-lint run` are passing
40+
2. `make lint` is passing (for backend) and `npm run lint` is passing (for frontend)
4141
3. All tests are passing
4242
4. Project is building successfully
4343

frontend/README.md

Lines changed: 36 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,39 @@
1-
# React + TypeScript + Vite
2-
3-
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
4-
5-
Currently, two official plugins are available:
6-
7-
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Babel](https://babeljs.io/) for Fast Refresh
8-
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
9-
10-
## Expanding the ESLint configuration
11-
12-
If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules:
13-
14-
```js
15-
export default tseslint.config({
16-
extends: [
17-
// Remove ...tseslint.configs.recommended and replace with this
18-
...tseslint.configs.recommendedTypeChecked,
19-
// Alternatively, use this for stricter rules
20-
...tseslint.configs.strictTypeChecked,
21-
// Optionally, add this for stylistic rules
22-
...tseslint.configs.stylisticTypeChecked,
23-
],
24-
languageOptions: {
25-
// other options...
26-
parserOptions: {
27-
project: ['./tsconfig.node.json', './tsconfig.app.json'],
28-
tsconfigRootDir: import.meta.dirname,
29-
},
30-
},
31-
});
1+
# Frontend Development
2+
3+
## Development
4+
5+
To run the development server:
6+
7+
```bash
8+
npm run dev
9+
```
10+
11+
## Build
12+
13+
To build the project for production:
14+
15+
```bash
16+
npm run build
17+
```
18+
19+
This will compile TypeScript and create an optimized production build.
20+
21+
## Code Quality
22+
23+
### Linting
24+
25+
To check for linting errors:
26+
27+
```bash
28+
npm run lint
3229
```
3330

34-
You can also install [eslint-plugin-react-x](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x) and [eslint-plugin-react-dom](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom) for React-specific lint rules:
35-
36-
```js
37-
// eslint.config.js
38-
import reactDom from 'eslint-plugin-react-dom';
39-
import reactX from 'eslint-plugin-react-x';
40-
41-
export default tseslint.config({
42-
plugins: {
43-
// Add the react-x and react-dom plugins
44-
'react-x': reactX,
45-
'react-dom': reactDom,
46-
},
47-
rules: {
48-
// other rules...
49-
// Enable its recommended typescript rules
50-
...reactX.configs['recommended-typescript'].rules,
51-
...reactDom.configs.recommended.rules,
52-
},
53-
});
31+
### Formatting
32+
33+
To format code using Prettier:
34+
35+
```bash
36+
npm run format
5437
```
38+
39+
This will automatically format all TypeScript, JavaScript, JSON, CSS, and Markdown files.

0 commit comments

Comments
 (0)