You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A generic Express.js back-end service that supports multiple front-end projects. Includes RESTful API endpoints, authentication/authorization logic, and maybe some scheduled background jobs for database maintenance.
3
+
A generic Express.js back-end service designed to support multiple front-end apps that I am managing to build in parallel with this app. It includes RESTful API endpoints and user authentication and utilizes PostgreSQL for data persistence.
4
+
5
+
## Features
6
+
7
+
- RESTful API with various endpoints serving different purposes
8
+
- User management and authentication endpoints
9
+
- Local PostgreSQL integration via Docker Compose
10
+
- TypeScript support with `tsx` for development
11
+
- Environment-based configuration
12
+
- Tested using Vitest and Supertest
13
+
- Ready for integration with front-end applications
14
+
15
+
## Getting Started
16
+
17
+
### Prerequisites
18
+
19
+
-[Node.js](https://nodejs.org/) (tested on v22 but v20 should be fine too)
20
+
-[Docker](https://www.docker.com/) and [Docker Compose](https://docs.docker.com/compose/)
The API will be available at `http://localhost:8080`.
63
+
64
+
## Running all tests
65
+
66
+
```bash
67
+
npm run test -- --run
68
+
```
69
+
70
+
## Deployment
71
+
72
+
Every _push_ or _pull request (PR)_ on main branch, the app will be deployed to production automatically _if it passes all tests and checks performed by [a GitHub action for deployment preparation](./.github/workflows/deployment-prep.yml)_.
73
+
74
+
## Notes
75
+
76
+
- This service is intended to support multiple front-end projects that I build.
77
+
- CORS is configured to allow only specific front-end origins under my control.
78
+
- JWT-based authentication is implemented and required by some endpoint.
79
+
- The `Bearer` schema is included in the authentication response, so _send your token as it is_ via an `Authorization` header.
80
+
- All error responses has the proper status code, but not all of them has a body. If an error response has a body it will have _at least_ the following:
81
+
82
+
```json
83
+
{
84
+
"error": {
85
+
"message": "An example error"
86
+
}
87
+
}
88
+
```
89
+
90
+
- A validation error response body will have the form of _[ZodError.issues](https://zod.dev/?id=error-handling)._
0 commit comments