https://github.com/typical-developers/public-experience-api
A public API to get data in Typical Developer experiences.
https://github.com/typical-developers/public-experience-api
Last synced: 3 months ago
JSON representation
A public API to get data in Typical Developer experiences.
- Host: GitHub
- URL: https://github.com/typical-developers/public-experience-api
- Owner: typical-developers
- Created: 2024-09-25T03:56:19.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-07-27T22:18:54.000Z (9 months ago)
- Last Synced: 2025-07-27T23:28:39.248Z (9 months ago)
- Language: TypeScript
- Homepage: http://public-api.typicaldevelopers.com
- Size: 3.67 MB
- Stars: 2
- Watchers: 0
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Public Experience API
A public API to get data in Typical Developer experiences.
# Prerequisites
- Bun
- Redis
- Postgres
# Deploying
For development, use `bun deploy:dev`. For production, use `bun deploy:prod` or `bun .` The server will be accessible on `127.0.0.1:3000`.
# Using Container
The container, which is accessible by `@/setup/container`, is implemented to make usability easier. The purpose of the container is to implement methods on startup so they can be accessible across the whole project without any weird importing.
### Accessing a Database Client
```ts
import container from `@/lib/container`;
const client = await container.database.connect();
// .. do stuff here
await client.release(); // Make sure you release the client back into the pool.
```
### Accessing the Redis instance
```ts
import container from `@/lib/container`;
const cache = await container.redis.get('key');
// .. do stuff here
```
### Extending the Container
Inside of `/src/setup`, you will notice a `container` folder. This is where all of the pieces reside. Inside of `/lib/types/types.d.ts`, you will notice a container type, this is where you where specify what can be in the container.
To extend off of the container, you *must* provide the types inside of the types file. Afterwards, you can make your container file, then add its import inside of `/src/setup/initalize.ts`.