API for managing prompt templates with integration to Google's Gemini API!
- Day 01: Basic application setup + Gemini integration
- Day 02: Save prompts and set up the test environment
- Day 03: Creating CRUD for categories and unit tests with mocks
- Day 04: Writing integration tests
- Day 05: Categorizing prompts
- Day 06: Adding Swagger documentation
- Day 07: Continuous integration with GitHub Actions
- Initialized a new Node.js project with TypeScript.
- Configured TypeScript with
tsconfig.json
. - Set up Express server in
src/index.ts
. - Integrated Google Generative AI with the Gemini model.
- Added environment variable support using dotenv.
- Added
.gitignore
to excludenode_modules
and.env
files.
- Created
TemplateService
with methods for CRUD operations. - Created
TemplateController
to handle HTTP requests for templates. - Set up routes for template operations in
src/routes/template.routes.ts
. - Configured Jest for testing with
jest.config.js
. - Added MongoDB in-memory server for testing.
- Added unit tests for
Template
model intest/models/template.model.test.ts
.
- Created
CategoryService
with methods for CRUD operations. - Created
CategoryController
to handle HTTP requests for categories. - Set up routes for category operations in
src/routes/category.routes.ts
. - Added unit tests for
Category
model intest/models/category.model.test.ts
. - Added unit tests for
TemplateService
intest/services/template.services.test.ts
with mocks. - Added unit tests for
CategoryService
intest/services/category.services.test.ts
with mocks.
- Wrote integration tests for
Template
andCategory
routes. - Used
supertest
to simulate HTTP requests and validate responses. - Ensured all CRUD operations are working correctly through tests.