Skip to content

Commit 7617b9a

Browse files
authored
docs: refresh design for readme (#17)
* Update README.md * fix: lint
1 parent ead7301 commit 7617b9a

File tree

1 file changed

+59
-67
lines changed

1 file changed

+59
-67
lines changed

README.md

Lines changed: 59 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1,72 +1,33 @@
1-
# Open Bus Backend
1+
# 🚌 Open Bus Backend
22

3-
### Swagger UI
3+
A backend service powering the Open-Bus platform.
4+
Provides APIs for health checks, GitHub issue creation, complaints, and government transportation data.
45

5-
The API documentation is automatically generated and available at:
6+
## 📢 Get Involved
67

7-
```
8-
https://open-bus-backend.k8s.hasadna.org.il/docs
9-
http://localhost:3001/docs
10-
```
11-
12-
## API Endpoints
13-
14-
### Health Check
15-
16-
- **GET** `/` - Health check endpoint
17-
18-
#### GitHub Issues
19-
20-
- **POST** `/issues` - Create a new GitHub issue
21-
- Requires: title, contactName, contactEmail, description, environment, expectedBehavior, actualBehavior, reproducibility
22-
- Optional: attachments (array of URLs)
23-
24-
#### Complaints
25-
26-
- **POST** `/complaints` - Submit a complaint to government forms
27-
- Requires: userData (firstName, lastName, id, email, phone), databusData (operator)
28-
- Optional: debug mode for testing, complaintType, description
29-
30-
#### Government Transportation
31-
32-
The following endpoints provide access to government transportation data:
33-
34-
- **POST** `/gov/lines-by-station` - Get bus lines by station
35-
- Requires: EventDate (DD/MM/YYYY), OperatorId, StationId
36-
37-
- **POST** `/gov/stations-by-line` - Get stations by line
38-
- Requires: eventDate (DD/MM/YYYY), OperatorId, OfficelineId, Directions
8+
- 💬 For general help and system updates, join the Hasadna Slack: [#open-bus channel](https://join.slack.com/t/hasadna/shared_invite/zt-167h764cg-J18ZcY1odoitq978IyMMig)
9+
- 🐞 Found a bug or have a feature request? [Open an issue](https://github.com/hasadna/open-bus-map-search/issues/new)
10+
- 🤝 Want to contribute? See our [contributing guidelines](https://github.com/hasadna/open-bus-pipelines/blob/main/CONTRIBUTING.md)
3911

40-
- **POST** `/gov/subjects` - Get subject types for vehicles
41-
- Requires: listName (set to "subject_type_vehicles")
12+
## 📖 API Documentation
4213

43-
- **POST** `/gov/train-stations` - Get train stations
44-
- Requires: StationTypeId
14+
- 📄 Swagger UI (production): [https://open-bus-backend.k8s.hasadna.org.il/docs](https://open-bus-backend.k8s.hasadna.org.il/docs)
15+
- 🖥️ Swagger UI (local): [http://localhost:3001/docs](http://localhost:3001/docs)
4516

46-
- **POST** `/gov/pniya` - Get pniya (vehicles type)
47-
- Requires: listName (set to "pniya")
17+
## 🔗 Related Projects
4818

49-
- **POST** `/gov/not-real-numbers` - Get not real numbers
50-
- Requires: listName (set to "notrealnumbers")
19+
- [🗺️ Open Bus Map Search (Client App)](https://github.com/hasadna/open-bus-map-search) - [Live Website](https://open-bus-map-search.hasadna.org.il/dashboard)
20+
- [📦 NPM Package](https://www.npmjs.com/package/@hasadna/open-bus-api-client)
5121

52-
- **POST** `/gov/lines-by-line` - Get lines by line ID
53-
- Requires: eventDate (DD/MM/YYYY), OperatorId, OperatorLineId
54-
55-
- **POST** `/gov/cities` - Get cities list
56-
- No body required
57-
58-
- **GET** `/gov/time` - Get current server time
59-
- No body required
60-
61-
## Installation
22+
## ⚙️ Installation
6223

6324
```bash
6425
npm install
6526
```
6627

67-
## Environment Variables
28+
## 🌍 Environment Variables
6829

69-
Create a `.env` file with the following variables:
30+
Create a `.env` file:
7031

7132
```env
7233
# Server Configuration
@@ -81,7 +42,7 @@ GITHUB_OWNER=your_github_username
8142
GITHUB_REPO=your_repository_name
8243
```
8344

84-
## Running the Application
45+
## 🚀 Running the Server
8546

8647
### Development
8748

@@ -95,33 +56,31 @@ npm run dev
9556
npm start
9657
```
9758

98-
## Testing
59+
## 🧪 Testing
9960

10061
```bash
10162
# Run all tests
10263
npm test
10364

104-
# Run tests with coverage
65+
# Run with coverage
10566
npm run test:coverage
10667

107-
# Run linting
68+
# Run lint checks
10869
npm run test:lint
10970

110-
# Fix linting issues
71+
# Fix lint issues
11172
npm run lint:fix
11273
```
11374

114-
## Running with Docker
115-
116-
To build and run the backend using Docker:
75+
## 🐳 Running with Docker
11776

118-
1. **Build the Docker image:**
77+
1. **Build the image**
11978

12079
```bash
12180
docker build -t open-bus-backend .
12281
```
12382

124-
2. **Run the container:**
83+
2. **Run the container**
12584

12685
```bash
12786
docker run -it -p 3001:3001 \
@@ -132,6 +91,39 @@ docker run -it -p 3001:3001 \
13291
open-bus-backend
13392
```
13493

135-
Replace the environment variable values with your actual configuration.
94+
## 🔗 API Endpoints
95+
96+
### 🩺 Health Check
97+
98+
- `GET /` → Returns server status
99+
100+
### 🐞 GitHub Issues
101+
102+
- `POST /issues` → Create a new GitHub issue
103+
- **Required:** `title`, `contactName`, `contactEmail`, `description`, `environment`, `expectedBehavior`, `actualBehavior`, `reproducibility`
104+
- **Optional:** `attachments[]` (array of URLs)
105+
106+
### 📣 Complaints
107+
108+
- `POST /complaints` → Submit a complaint to government forms
109+
- **Required:**
110+
- `userData`: `firstName`, `lastName`, `id`, `email`, `phone`
111+
- `databusData`: `operator`
112+
113+
- **Optional:** `debug`, `complaintType`, `description`
114+
115+
### 🏛️ Government Transportation
116+
117+
| Endpoint | Method | Required Body |
118+
| ----------------------- | ------ | ------------------------------------------------------- |
119+
| `/gov/lines-by-station` | POST | `EventDate`, `OperatorId`, `StationId` |
120+
| `/gov/stations-by-line` | POST | `eventDate`, `OperatorId`, `OfficelineId`, `Directions` |
121+
| `/gov/subjects` | POST | `listName = "subject_type_vehicles"` |
122+
| `/gov/train-stations` | POST | `StationTypeId` |
123+
| `/gov/pniya` | POST | `listName = "pniya"` |
124+
| `/gov/not-real-numbers` | POST | `listName = "notrealnumbers"` |
125+
| `/gov/lines-by-line` | POST | `eventDate`, `OperatorId`, `OperatorLineId` |
126+
| `/gov/cities` | POST | none |
127+
| `/gov/time` | GET | none |
136128

137-
The server will be accessible at `http://localhost:3001`.
129+
Server will be available at: [http://localhost:3001](http://localhost:3001)

0 commit comments

Comments
 (0)