Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Routing #83

Merged
merged 16 commits into from
Sep 29, 2024
Merged

Routing #83

merged 16 commits into from
Sep 29, 2024

Conversation

JasonWarrenUK
Copy link
Contributor

@JasonWarrenUK JasonWarrenUK commented Sep 28, 2024

The Great Router Update

Run npm install before trying this update

1. Scripts

command outcome
npm run dev run the project without compiling & monitor for changes in realtime

2. Packages

List of changes that should be implemented via npm install

New Packages

package purpose
@types/prompt-sync take & store user input from terminal

Updated Packages

package change old value new value
@types/node version 22.5.5 22.7.4
tsx dependency type dependencies devDependencies

3. Configuration

file parameter old value new value
tsconfig target es2016 es2020
tsconfig module NodeNext ESNext
tsconfig strict false true
nodemon exec "ts-node --esm -r tsconfig-paths/register ./src/app.ts" "tsx src/app.ts"

4. Usage & Endpoints

Endpoint Note
/ Display HTML menu of available routers
/api/ Tests responsiveness of hub router
/api/transfer Tests responsiveness of internal router
/api/user Tests responsiveness of user-facing router
/api/openAI Tests responsiveness of openAI router
/api/spotify Tests responsiveness of spotify router

5. Documents & Notes

Path Change Reason
./docs/DATAFLOW.md New Visualise where data goes

6. Project Structure

  • ./src/controllers/${apiName}/index.ts refactored as modular function calls
  • ./src/controllers/server renamed to ./src/controllers/user
  • ./models created as a placeholder for later architecture

7. Issues

Related to #23, #25, #26, #41, #51, #52, #53
Closes #6, #7, #9, #10, #12, #13, #14, #15, #17, #18, #19, #21, #33, #34, #35, #37, #38, #40, #44, #45, #46, #47, #48, #49, #50, #55, #70

- configure itty-router
- simplify `./routes` due to controlled number of flows
- routes & controllers MVP structure completed & clean
- function calls working within some routes
- some work has begun on separation of concerns between controllers, routes & models
- controllers now have descriptive names
- routers call sequentially & successfully
- routers point towards controllers in anticipation of calling them

BREAKING CHANGE:
- Routers mounted correctly
- Test messages within each router
Opening localhost in the browser returns a linklist
**Instructions**
- `npm install`
- `npm run dev` will:
   - run the project directly without compiling
   - restart if you make any changes to the code, allowing you to see changes in realtime

**Packages**
- New Installs
   - `@types/prompt-sync`
- Updates
   - `@types/node`: `22.5.5 --> 22.7.4`
   - `tsx`: `dependencies --> devDependencies`

**Configuration Changes**
- `tsconfig.json`
   - target: `es2016 --> es2020`
   - module: `NodeNext --> ESNext`
   - strict: `false --> true`
- `nodemon.json`
   - exec: `"ts-node --esm -r tsconfig-paths/register ./src/app.ts" --> "tsx src/app.ts"`

BREAKING CHANGE:
@maxitect maxitect merged commit bb22c59 into main Sep 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Install Prettier & define rules
2 participants