···11+FROM oven/bun:1-alpine AS builder
22+WORKDIR /app
33+COPY package.json bun.lock ./
44+RUN bun install --frozen-lockfile
55+COPY . .
66+RUN bun run build
77+88+FROM oven/bun:1-alpine
99+WORKDIR /app
1010+COPY --from=builder /app/dist ./dist
1111+COPY --from=builder /app/package.json ./
1212+COPY --from=builder /app/bun.lock ./
1313+RUN bun install --production --frozen-lockfile
1414+1515+ENV NODE_ENV=production
1616+EXPOSE 3000
1717+CMD ["bun", "run", "start"]
+68
README.md
···11+# Spark Feed Generator
22+33+This repository is a feed generator for the Spark atproto app. It is a simple feed generator that fetches posts from a database and returns them in a format that can be used by the Spark client.
44+55+The whole structure is heavily based on the Bluesky [feed-generator](https://github.com/bluesky-social/feed-generator) repository, most of the things said there apply here as well.
66+77+## Setup
88+99+### Option 1: Docker Compose (Recommended)
1010+1111+The easiest way to get started is using Docker Compose, which will automatically build the application and set up the MongoDB database.
1212+1313+1. Start the services (this will automatically build the image):
1414+1515+```sh
1616+docker-compose up -d
1717+```
1818+1919+2. The application will be available at http://localhost:3000
2020+2121+3. To stop the services:
2222+2323+```sh
2424+docker-compose down
2525+```
2626+2727+### Option 2: Manual Setup
2828+2929+If you prefer to run the application manually or use an existing MongoDB instance:
3030+3131+#### Prerequisites
3232+3333+- [Bun](https://bun.sh/) runtime
3434+- MongoDB instance (local or remote)
3535+3636+#### Steps
3737+3838+1. Create a `.env` file in the root of the repository and add the following variables:
3939+4040+```
4141+DB_NAME=feed-gen
4242+DB_HOST=localhost
4343+DB_PORT=27017
4444+DB_USER=mongo
4545+DB_PASSWORD=mongo
4646+FEEDGEN_DOMAIN=localhost:3000
4747+NODE_ENV=development
4848+```
4949+5050+2. Install dependencies:
5151+5252+```sh
5353+bun install
5454+```
5555+5656+3. Make sure MongoDB is running. If you don't have MongoDB installed locally, you can run it with Docker:
5757+5858+```sh
5959+docker run -d --name mongodb -p 27017:27017 -e MONGO_INITDB_ROOT_USERNAME=mongo -e MONGO_INITDB_ROOT_PASSWORD=mongo mongo:8
6060+```
6161+6262+4. Start the development server:
6363+6464+```sh
6565+bun run start
6666+```
6767+6868+5. The application will be available at http://localhost:3000