Skip to content

Commit be2e407

Browse files
committed
Merge branch 'suraj/contributor' of https://github.com/Suraj-kumar00/Scheduler-API into suraj/contributor
2 parents c8cd66a + 255d3fb commit be2e407

20 files changed

+3539
-65
lines changed

.github/workflows/commit-lint.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Commit Compliance
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened]
6+
7+
jobs:
8+
commitlint:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Checkout code with submodule
13+
uses: actions/checkout@v4
14+
with:
15+
ref: ${{ github.event.pull_request.head.ref }}
16+
repository: ${{ github.event.pull_request.head.repo.full_name }}
17+
submodules: true
18+
fetch-depth: 0
19+
20+
- name: Setup Node.js
21+
uses: actions/setup-node@v4
22+
with:
23+
node-version: 18
24+
25+
- name: Install dependencies
26+
run: |
27+
npm ci --legacy-peer-deps
28+
npm i --legacy-peer-deps
29+
30+
- name: Run commitlint on PR
31+
run: |
32+
npx commitlint --from ${{ github.event.pull_request.base.sha }} \
33+
--to ${{ github.event.pull_request.head.sha }} \
34+
--verbose
35+

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,4 @@ mvnw.cmd
3737
.DS_Store
3838
# Properties
3939
src/main/environment/common_local.properties
40+
node_modules

.husky/commit-msg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
npx --no -- commitlint --edit $1

.husky/pre-commit

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
npx lint-staged

README.md

Lines changed: 45 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# AMRIT - Scheduler Service
2-
[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0) ![branch parameter](https://github.com/PSMRI/HWC-API/actions/workflows/sast-and-package.yml/badge.svg)
2+
[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)
33

44
It acts as an interface between client and the scheduling services provided, allowing users to interact for consultation with specialists. It also provides the info of availability and unavailability of specialists, retrieving available slots for specialists, booking and cancelling slots, and fetching day views of specialists for a particular specialization.
55

@@ -12,7 +12,7 @@ It acts as an interface between client and the scheduling services provided, all
1212
This microservice is built on Java, Spring boot framework and MySQL DB.
1313

1414
### Prerequisites
15-
* JDK 1.8
15+
* JDK 17
1616
* Wildfly (or any compatible app server)
1717
* Redis
1818
* MySQL Database
@@ -34,6 +34,49 @@ To install the MMU module, please follow these steps:
3434
## Usage
3535
All features have been exposed as REST endpoints. Refer to the SWAGGER API specification for details.
3636

37+
## Setting Up Commit Hooks
38+
39+
This project uses Git hooks to enforce consistent code quality and commit message standards. Even though this is a Java project, the hooks are powered by Node.js. Follow these steps to set up the hooks locally:
40+
41+
### Prerequisites
42+
- Node.js (v14 or later)
43+
- npm (comes with Node.js)
44+
45+
### Setup Steps
46+
47+
1. **Install Node.js and npm**
48+
- Download and install from [nodejs.org](https://nodejs.org/)
49+
- Verify installation with:
50+
```
51+
node --version
52+
npm --version
53+
```
54+
2. **Install dependencies**
55+
- From the project root directory, run:
56+
```
57+
npm ci
58+
```
59+
- This will install all required dependencies including Husky and commitlint
60+
3. **Verify hooks installation**
61+
- The hooks should be automatically installed by Husky
62+
- You can verify by checking if the `.husky` directory contains executable hooks
63+
### Commit Message Convention
64+
This project follows a specific commit message format:
65+
- Format: `type(scope): subject`
66+
- Example: `feat(login): add remember me functionality`
67+
Types include:
68+
- `feat`: A new feature
69+
- `fix`: A bug fix
70+
- `docs`: Documentation changes
71+
- `style`: Code style changes (formatting, etc.)
72+
- `refactor`: Code changes that neither fix bugs nor add features
73+
- `perf`: Performance improvements
74+
- `test`: Adding or fixing tests
75+
- `build`: Changes to build process or tools
76+
- `ci`: Changes to CI configuration
77+
- `chore`: Other changes (e.g., maintenance tasks, dependencies)
78+
Your commit messages will be automatically validated when you commit, ensuring project consistency.
79+
3780
## Filing Issues
3881
3982
If you encounter any issues, bugs, or have feature requests, please file them in the [main AMRIT repository](https://github.com/PSMRI/AMRIT/issues). Centralizing all feedback helps us streamline improvements and address concerns efficiently.

commitlint.config.js

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
module.exports = {
2+
extends: ['@commitlint/config-conventional'],
3+
rules: {
4+
'body-leading-blank': [1, 'always'],
5+
'body-max-line-length': [2, 'always', 100],
6+
'footer-leading-blank': [1, 'always'],
7+
'footer-max-line-length': [2, 'always', 100],
8+
'header-max-length': [2, 'always', 100],
9+
'subject-case': [
10+
2,
11+
'never',
12+
['sentence-case', 'start-case', 'pascal-case', 'upper-case'],
13+
],
14+
'subject-empty': [2, 'never'],
15+
'subject-full-stop': [2, 'never', '.'],
16+
'type-case': [2, 'always', 'lower-case'],
17+
'type-empty': [2, 'never'],
18+
'type-enum': [
19+
2,
20+
'always',
21+
[
22+
'build',
23+
'chore',
24+
'ci',
25+
'docs',
26+
'feat',
27+
'fix',
28+
'perf',
29+
'refactor',
30+
'revert',
31+
'style',
32+
'test'
33+
],
34+
],
35+
},
36+
};

0 commit comments

Comments
 (0)