https://github.com/kasutu/personal-trainer-server
https://github.com/kasutu/personal-trainer-server
Last synced: 9 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/kasutu/personal-trainer-server
- Owner: kasutu
- Created: 2025-06-12T14:11:47.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-06-28T08:17:47.000Z (12 months ago)
- Last Synced: 2025-06-28T09:29:51.386Z (12 months ago)
- Language: TypeScript
- Size: 104 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# personal-trainer-server
To install dependencies:
```bash
bun install
```
To run:
```bash
bun run index.ts
```
This project was created using `bun init` in bun v1.2.0. [Bun](https://bun.sh) is a fast all-in-one JavaScript runtime.
## Creating New Endpoint Flow
1. `services` (interacts with drivers, no try catch)
1.1. `workflows` (contains complex logic, interact with services)
2. `controllers` (interacts with services/workflows, has try catch, errors are forwarded to express)
3. `routes` (interacts with controllers, manages request, calls the correct controllers)
## Remarks
- Ensure that each route file correctly exports a route class using the `export default` syntax.
- If the module fails to export a default class (for example, if named exports are used), an error will occur.
### Example
```javascript
// Correct export of a route class
export default class MyRoute extends Routes {
// Route implementation...
}
```
## Notes on hard deletes
hopefully we dont use this normally will use this when data is not needed for auditing
Next steps:
- require token when calling this funtion