https://github.com/barelyhuman/thestack
Blocks of backend libraries/tech squashed together
https://github.com/barelyhuman/thestack
Last synced: 2 months ago
JSON representation
Blocks of backend libraries/tech squashed together
- Host: GitHub
- URL: https://github.com/barelyhuman/thestack
- Owner: barelyhuman
- License: mit
- Created: 2023-06-17T21:53:48.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-09-30T19:16:42.000Z (over 1 year ago)
- Last Synced: 2025-04-15T02:13:13.905Z (2 months ago)
- Language: TypeScript
- Homepage: https://barelyhuman.github.io/thestack/
- Size: 346 KB
- Stars: 19
- Watchers: 2
- Forks: 3
- Open Issues: 3
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# thestack
I spent the time making the decisions so you don't have to.
## Documentation
You can read the [docs](/docs/) folder or the
[web version](https://barelyhuman.github.io/thestack/)## What comes bundled
- Simpler Express based server
- Decorators + Classes for Routing```ts
class Auth {
@post('/auth/signup')
async signup(req, res) {
// handler
}
}
```- Typed (Mostly...)
- Basic Security (Helmet, Rate Limiting, CORS)
- API testing (Vitest + Mock Server)
- ORM (prisma)
- Migrations (prisma)
- Queue (bull + redis)
- Decorators for Queue Handling based on Worker execution
- View Engine ([Nunjucks](https://mozilla.github.io/nunjucks/))```ts
class User {
@post('/user/invite')
sendInvite(req, res) {
const email = req.body.email
req.pushToQueue('email', {
email,
type: 'invite',
})
}
}
// jobs/email.queue.ts
class EmailQueueHandler {
@listen('email', 'invite')
handleInviteJob(job) {
// Called from the worker
// process the job
}
}
```- Compose (Self host services for dev / k8s)
- Fully Docker compatible
- Testing Mocks (Redis)
- Swagger Doc generation using JSDoc -
[Documentation](https://brikev.github.io/express-jsdoc-swagger-docs/#/)```js
/**
*
* GET /api/ping
* @summary quickly check if the server is running or not
* @returns 200 - success - application/json
*/
@get('/api/ping')
ping(req: Request, res: Response) {
req.pushToQueue('test', {
type: '',
})
return res.send({
success: true,
now: new Date().toISOString(),
})
}
```## Why?
Various reasons....,
[this might be relevant](https://reaper.is/writing/20230516-ignoring-backend-productivity)## License
[MIT](/LICENSE)