ChakshuGautam / geoquery.in

Service to get Location from ipv4 and ipv6
https://geoquery.in
28 stars 84 forks source link

Migration to NestJs #138

Open dhruv-1001 opened 2 months ago

dhruv-1001 commented 2 months ago

Migrate Project from Vanilla JS to NestJS

Overview

This issue is created to track the migration of the project from its current JS architecture to NestJS.

Current Situation

The project is currently built using vanilla JavaScript and needs to be migrated to NestJS to leverage its benefits, including a modular and scalable architecture, dependency injection, and enhanced maintainability.

Goals

  1. Framework Migration: Transition the existing codebase from vanilla JS to NestJS.
  2. Module Structure: Organize the project into NestJS modules for improved modularity and maintainability.
  3. Middleware Integration: Integrate necessary middleware for enhanced functionality and request handling.
  4. Testing: Update and create tests to ensure the correctness of the migrated code.
  5. Documentation: Document the migration process, including any potential issues and their resolutions.

Steps

  1. Setup

    • [ ] Create a new NestJS project.
    • [ ] Set up the necessary configurations.
  2. Code Migration

    • [ ] Identify and migrate existing functionality from vanilla JS to NestJS.
    • [ ] Refactor code to adhere to NestJS module structure.
    • [ ] Setup files with version controlling.
  3. Middleware Integration

    • [ ] Identify required middleware for the project.
    • [ ] Integrate middleware into the NestJS project.
  4. Testing

    • [ ] Update existing tests to match the new NestJS structure.
    • [ ] Create additional tests for newly integrated functionality.
  5. Documentation

    • [ ] Document the APIs for v1.

Collaborators

dhruv-1001 commented 2 months ago

@ChakshuGautam, for documenting APIs, I'm going ahead with swagger docs.

dhruvchandak30 commented 2 months ago

@dhruv-1001 @ChakshuGautam I would Like to work on this issue. Should I create Next App in the root folder to start with ? So that everybody can help in migrating the codebase.

Abhinav-Saxena-dev commented 1 month ago

Hey, I'd like to work on this. I've gone through the project and suggest the following approach:

Folder structure of Nest app:

- src
  - app
    - models
      - city
        - city.controller.ts
        - city.module.ts
        - city.serializer.ts
        - city.controller.spec.ts
      - georev
        - georev.controller.ts
        - georev.module.ts
        - georev.serializer.ts
        - georev.controller.spec.ts
      - location
        - location.controller.ts
        - location.module.ts
        - location.serializer.ts
        - location.controller.spec.ts
        - location.service.ts
        - location.service.spec.ts
  - config
    - config.json
    - swagger.config.json
  - geojson-data
  - services
    - geojson
        - geojson.service.ts
    - logger
        - logger.service.ts
  - util
    - common
      - gdb_to_geojson
      - parse.geojson
    - serializer
      - success
      - error

Justification

Stencil-cli will be used to setup the project. Finalized structure might slightly defer from the proposed structure.

Logger

Swagger

Scripts

Please let me know what changes are required here, I will create a tech doc post review.

dhruv-1001 commented 1 month ago

Hey @Abhinav-Saxena-dev. This looks great! This seems to cover everything that we have now. You can go ahead!

Abhinav-Saxena-dev commented 1 month ago

@dhruv-1001 Hey, I've completed the code migration and have raised a Draft PR. I have added relevant information in the description for now and maintaining a check list of tasks there.

Please review it once and let me know whatever changes / new updates that might be required there.

Abhinav-Saxena-dev commented 1 month ago

Update:

To be left / Completed by EOD

A merge conflict has occurred, attempting to public the draft PR by EOD.

dhruv-1001 commented 1 month ago

Hey, @Abhinav-Saxena-dev. Will try to review your PR this weekend.

ChakshuGautam commented 1 month ago

@dhruv-1001 what's the update on this?

Abhinav-Saxena-dev commented 3 weeks ago

@dhruv-1001 I would like to request a review of the PR. The merge conflict arose due to the db.md, which I had updated but the prompt remains. Apart from that, the PR is ready.

Please let me know any changes that you would require.