Skip to content

Commit 7cf924d

Browse files
feat(main): Enhance /about endpoint & refactor API structure for v1.1.0 [#4] (#5)
* feat: Update About DTO and schema (refs #4) * feat: Update the description field in 'About' to support an array (refs #4) * feat: Update the services to sort by the sortDate field (refs #4) * feat: Remove views field from Videos (refs #4) * feat: Remove readTime field from Blogs and add link field (refs #4) * feat: Update About DTO and schema (refs #4) * feat: Update MongoDB uri and add .env.exampl (refs #4) * chore: Update version to 1.1.0 (refs #4) * docs: Add VERSIONING.md, update CHANGELOG.md & README.md (refs #4) * fix: About DTO ISEmail (refs #4)
1 parent 9a9504e commit 7cf924d

19 files changed

+385
-72
lines changed

.env.example

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Example .env file for api.dileepa.dev
2+
# Copy this file to .env and fill in the values as needed
3+
4+
# Application
5+
PORT=3000
6+
NODE_ENV=development
7+
8+
# MongoDB
9+
MONGODB_URI=mongodb://localhost:27017/dileepa
10+
11+
# Azure Blob Storage
12+
AZURE_STORAGE_ACCOUNT_NAME=your_storage_account_name
13+
AZURE_STORAGE_ACCOUNT_KEY=your_storage_account_key
14+
AZURE_STORAGE_CONTAINER_NAME=your_container_name
15+
16+
# Other secrets (add as needed)
17+
JWT_SECRET=your_jwt_secret
18+
19+
# Swagger (optional)
20+
SWAGGER_USER=admin
21+
SWAGGER_PASSWORD=your_password

CHANGELOG.md

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,33 @@
22

33
All notable changes to this project are documented in this file.
44

5+
Changes are organized into the following categories:
6+
7+
- **Added:** New features or functionality introduced to the project.
8+
- **Changed:** Modifications to existing functionality that do not add new features.
9+
- **Fixed:** Bug fixes that resolve issues or correct unintended behavior.
10+
- **Removed:** Features or components that have been removed from the project.
11+
512
## [Unreleased]
613

714
- Changes for the next release are available in development branches.
815

16+
## [1.1.0] - 2025-05-12
17+
18+
- **Added:**
19+
20+
- Add social media and other relevant external links to the `/about` endpoint for better representation.
21+
- Add `VERSIONING.md` file to document the versioning strategy and release process for the project.
22+
23+
- **Changed:**
24+
25+
- Update the `description` field in the `/about` endpoint to support an array of multiple descriptive entries, allowing for more detailed and modular content.
26+
- Refactor the DTO (Data Transfer Object) structure to follow `camelCase` naming conventions for consistency with frontend standards.
27+
- Update MongoDB queries to return data ordered by date for improved relevance.
28+
929
## [1.0.0] - 2025-05-04
1030

11-
- **Added (New features):**
31+
- **Added**
1232

1333
- Set up initial project structure using [NestJS](https://nestjs.com/) and [TypeScript](https://www.typescriptlang.org/) running on [Node.js](https://nodejs.org/).
1434
- Built and tested the following RESTful API endpoints:
@@ -29,7 +49,7 @@ All notable changes to this project are documented in this file.
2949

3050
## [0.0.1] - 2025-05-04
3151

32-
- **Added (New features):**
52+
- **Added:**
3353

3454
- Initialize project with **NestJS**
3555
- Add Documentation:
@@ -51,14 +71,16 @@ All notable changes to this project are documented in this file.
5171
- [`other.md`](https://github.com/dileepadev/api.dileepa.dev/blob/main/.github/ISSUE_TEMPLATE/other.md)
5272
- Deploy the app to the production environment.
5373

54-
- **Changed (Improvements):**
74+
- **Changed:**
5575

5676
- Update README.md
5777

5878
<!-- Unreleased -->
79+
<!-- 1.1.0 -->
5980
<!-- 1.0.0 -->
6081
<!-- v0.0.1 -->
6182

6283
[Unreleased]: https://github.com/dileepadev/api.dileepa.dev/branches
84+
[1.1.0]: https://github.com/dileepadev/api.dileepa.dev/compare/v1.0.0...v1.1.0
6385
[1.0.0]: https://github.com/dileepadev/api.dileepa.dev/compare/v0.0.1...v1.0.0
6486
[0.0.1]: https://github.com/dileepadev/api.dileepa.dev/releases/tag/v0.0.1

README.md

Lines changed: 83 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,46 @@
22

33
This is the API for Dileepa's personal website ([dileepa.dev](https://dileepa.dev)), built with [NestJS](https://nestjs.com/). It provides various endpoints to access information about Dileepa and other related data.
44

5-
## Tech Stack
6-
7-
* **Framework:** [NestJS](https://nestjs.com/)
8-
* **Language:** [TypeScript](https://www.typescriptlang.org/)
9-
* **Runtime:** [Node.js](https://nodejs.org/)
10-
* **Package Manager:** [npm](https://www.npmjs.com/)
11-
* **Linting:** [ESLint](https://eslint.org/)
12-
* **Formatting:** [Prettier](https://prettier.io/)
13-
* **Database:** [MongoDB](https://www.mongodb.com/) (using [Mongoose](https://mongoosejs.com/))
14-
* **Deployment:** [Azure App Service](https://azure.microsoft.com/en-us/services/app-service/)
15-
* **Image Hosting:** [Azure Blob Storage](https://azure.microsoft.com/en-us/services/storage/blobs/)
16-
* **Documentation:** [Swagger](https://swagger.io/) (using [Swagger UI](https://swagger.io/tools/swagger-ui/))
5+
## Table of Contents
6+
7+
- [api.dileepa.dev](#apidileepadev)
8+
- [Table of Contents](#table-of-contents)
9+
- [Tools and Technologies](#tools-and-technologies)
10+
- [Installation](#installation)
11+
- [Running the App](#running-the-app)
12+
- [Development](#development)
13+
- [Production](#production)
14+
- [API Documentation](#api-documentation)
15+
- [Testing](#testing)
16+
- [Versioning](#versioning)
17+
- [Contributing](#contributing)
18+
- [Issues](#issues)
19+
- [Security](#security)
20+
- [License](#license)
21+
- [API Endpoints](#api-endpoints)
22+
- [Deployment on Azure](#deployment-on-azure)
23+
- [Contact](#contact)
24+
25+
## Tools and Technologies
26+
27+
- **Framework:** [NestJS](https://nestjs.com/)
28+
- **Language:** [TypeScript](https://www.typescriptlang.org/)
29+
- **Runtime:** [Node.js](https://nodejs.org/)
30+
- **Package Manager:** [npm](https://www.npmjs.com/)
31+
- **Linting:** [ESLint](https://eslint.org/)
32+
- **Formatting:** [Prettier](https://prettier.io/)
33+
- **Version Control:** [Git](https://git-scm.com/)
34+
- **Database:** [MongoDB](https://www.mongodb.com/) (using [Mongoose](https://mongoosejs.com/))
35+
- **Deployment:** [Azure App Service](https://azure.microsoft.com/en-us/services/app-service/)
36+
- **Image Hosting:** [Azure Blob Storage](https://azure.microsoft.com/en-us/services/storage/blobs/)
37+
- **Documentation:** [Swagger](https://swagger.io/) (using [Swagger UI](https://swagger.io/tools/swagger-ui/))
1738

1839
## Installation
1940

2041
1. Clone the repository:
2142

2243
```bash
23-
git clone https://github.com/your-username/api.dileepa.dev.git
44+
git clone https://github.com/dileepadev/api.dileepa.dev.git
2445
cd api.dileepa.dev
2546
```
2647

@@ -30,6 +51,13 @@ This is the API for Dileepa's personal website ([dileepa.dev](https://dileepa.de
3051
npm install
3152
```
3253

54+
3. Copy the example environment file and update it with your configuration:
55+
56+
```bash
57+
cp .env.example .env
58+
# Then edit .env as needed
59+
```
60+
3361
## Running the App
3462

3563
### Development
@@ -40,7 +68,7 @@ To run the application in development mode with file watching:
4068
npm run start:dev
4169
```
4270

43-
The application will be available at `http://localhost:3000` (or the configured port).
71+
The application will be available at `http://localhost:3000` (or the configured port in `.env`).
4472

4573
### Production
4674

@@ -51,23 +79,35 @@ npm run build
5179
npm run start:prod
5280
```
5381

54-
## Linting and Formatting
82+
## API Documentation
5583

56-
To lint the codebase:
84+
Swagger UI is available at [`/api`](http://localhost:3000/api) once the app is running. (e.g., `http://localhost:3000/api`)
5785

58-
```bash
59-
npm run lint
60-
```
86+
## Testing
6187

62-
To format the codebase using Prettier:
88+
To run tests:
6389

6490
```bash
65-
npm run format
91+
npm run test
6692
```
6793

94+
## Versioning
95+
96+
This project follows a versioning pattern similar to [Semantic Versioning](https://semver.org/) (SemVer) for managing releases. For detailed versioning information, see the [VERSIONING.md](VERSIONING.md) file.
97+
6898
## Contributing
6999

70-
Contributions are welcome! Please follow the guidelines outlined in [CONTRIBUTING.md](CONTRIBUTING.md) and adhere to the [Code of Conduct](CODE_OF_CONDUCT.md). Also, review the [Branch Naming](BRANCH_NAMING_GUIDELINES.md), [Commit Message](COMMIT_MESSAGE_GUIDELINES.md), and [Pull Request](PULL_REQUEST_GUIDELINES.md) guidelines.
100+
Contributions are welcome! Please read the following before contributing:
101+
102+
- [CONTRIBUTING.md](CONTRIBUTING.md)
103+
- [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md)
104+
- [BRANCH_NAMING_GUIDELINES.md](BRANCH_NAMING_GUIDELINES.md)
105+
- [COMMIT_MESSAGE_GUIDELINES.md](COMMIT_MESSAGE_GUIDELINES.md)
106+
- [PULL_REQUEST_GUIDELINES.md](PULL_REQUEST_GUIDELINES.md)
107+
108+
## Issues
109+
110+
For any issues or feature requests, please use the [issue templates](.github/ISSUE_TEMPLATE) provided in the repository. You can also check the [CHANGELOG.md](CHANGELOG.md) for updates and changes.
71111

72112
## Security
73113

@@ -76,3 +116,24 @@ If you discover any security vulnerabilities, please report them as described in
76116
## License
77117

78118
This project is licensed under the terms of the [LICENSE](LICENSE) file.
119+
120+
## API Endpoints
121+
122+
| Endpoint | Description |
123+
|---------------|-------------------------------------------------------|
124+
| `/about` | Provides general profile information about me. |
125+
| `/experiences`| Returns a list of my professional work experiences. |
126+
| `/educations` | Displays my academic background, including degrees. |
127+
| `/events` | Lists upcoming and past events, talks, or appearances.|
128+
| `/videos` | Links to video content such as talks or tutorials. |
129+
| `/blogs` | Returns metadata or summaries of blog posts. |
130+
| `/communities`| Tech communities I've volunteered with. |
131+
| `/tools` | Lists the tools, frameworks, and technologies I use. |
132+
133+
## Deployment on Azure
134+
135+
This project is designed for deployment on Azure App Service and uses Azure Blob Storage for image hosting. For deployment instructions, see the [official Azure documentation](https://docs.microsoft.com/en-us/azure/app-service/quickstart-nodejs?tabs=windows).
136+
137+
## Contact
138+
139+
For any inquiries or feedback, please reach out to me via [email](mailto:contact@dileepa.dev) or through my [website](https://dileepa.dev).

VERSIONING.md

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
# Versioning
2+
3+
This project follows a versioning pattern similar to [Semantic Versioning](https://semver.org/) (SemVer) for managing releases.
4+
5+
## Table of Contents
6+
7+
- [Versioning](#versioning)
8+
- [Table of Contents](#table-of-contents)
9+
- [Format](#format)
10+
- [Examples](#examples)
11+
- [Release Process](#release-process)
12+
- [Typical Steps](#typical-steps)
13+
- [Pre-release Versions](#pre-release-versions)
14+
- [Viewing Tags \& Differences](#viewing-tags--differences)
15+
- [Questions or Issues?](#questions-or-issues)
16+
17+
## Format
18+
19+
Version numbers follow the structure:
20+
21+
`MAJOR.MINOR.PATCH`
22+
23+
- **MAJOR** – Incompatible API changes or major breaking updates
24+
- **MINOR** – Backward-compatible functionality and feature additions
25+
- **PATCH** – Backward-compatible bug fixes and small improvements
26+
27+
### Examples
28+
29+
- `1.0.0` – First stable release
30+
- `1.1.0` – Adds a new endpoint or feature
31+
- `1.1.1` – Fixes a bug or makes a minor improvement
32+
33+
## Release Process
34+
35+
All notable changes are documented in the [CHANGELOG.md](CHANGELOG.md) file.
36+
37+
### Typical Steps
38+
39+
1. Complete all features and fixes planned for the release
40+
2. Update the `CHANGELOG.md` with categorized entries:
41+
- **Added**, **Changed**, **Fixed**, **Removed**
42+
3. Bump the version number in `package.json` (and `package-lock.json` if needed)
43+
4. Commit changes with a version-related message (e.g. `chore: release v1.2.0`)
44+
5. Tag the release:
45+
46+
```bash
47+
git tag v1.2.0
48+
git push origin v1.2.0
49+
```
50+
51+
6. (Optional) Create a GitHub release and paste the relevant changelog section
52+
53+
## Pre-release Versions
54+
55+
For beta or release candidates, we use suffixes:
56+
57+
- `1.2.0-beta.1` – Beta release
58+
- `2.0.0-rc.1` – Release candidate
59+
60+
These versions are intended for testing and may not be fully stable.
61+
62+
## Viewing Tags & Differences
63+
64+
List all version tags:
65+
66+
```bash
67+
git tag
68+
```
69+
70+
View differences between versions:
71+
72+
```bash
73+
git log v1.1.0..v1.2.0
74+
```
75+
76+
## Questions or Issues?
77+
78+
If you have questions about the versioning strategy or encounter version-related problems, feel free to open an issue on the [GitHub repository](https://github.com/dileepadev/api.dileepa.dev/issues).

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "api.dileepa.dev",
3-
"version": "1.0.0",
3+
"version": "1.1.0",
44
"description": "This API provides access to Dileepa Bandara's personal and other related data.",
55
"author": {
66
"name": "Dileepa Bandara",

src/app.module.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import { ToolsModule } from './tools/tools.module';
2020
MongooseModule.forRootAsync({
2121
imports: [ConfigModule],
2222
useFactory: (configService: ConfigService) => ({
23-
uri: configService.get<string>('DATABASE_CONNECTION_STRING'),
23+
uri: configService.get<string>('MONGODB_URI'),
2424
}),
2525
inject: [ConfigService],
2626
}),

src/blogs/blogs.service.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ export class BlogsService {
1212
) {}
1313

1414
async findAll(): Promise<BlogDto[]> {
15-
return this.blogModel.find().exec();
15+
return this.blogModel
16+
.find()
17+
.sort({ sortDate: -1 })
18+
.select('-sortDate')
19+
.exec();
1620
}
1721
}

src/communities/communities.service.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ export class CommunitiesService {
1212
) {}
1313

1414
async findAll(): Promise<CommunityDto[]> {
15-
return this.communityModel.find().exec();
15+
return this.communityModel
16+
.find()
17+
.sort({ sortDate: -1 })
18+
.select('-sortDate')
19+
.exec();
1620
}
1721
}

0 commit comments

Comments
 (0)