https://github.com/mhdcodes/bun-react-ssr
Bun serving a React application that displays 10k tweets from an SQLite database
https://github.com/mhdcodes/bun-react-ssr
Last synced: 3 months ago
JSON representation
Bun serving a React application that displays 10k tweets from an SQLite database
- Host: GitHub
- URL: https://github.com/mhdcodes/bun-react-ssr
- Owner: mhdcodes
- Created: 2024-09-15T12:33:27.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-09-15T12:33:49.000Z (almost 2 years ago)
- Last Synced: 2025-01-27T13:12:32.400Z (over 1 year ago)
- Language: TypeScript
- Size: 7.81 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Bun 10K Tweets
This project sets up a server that utilizes clustering for multi-core processing, serving a React application that displays tweets from an SQLite database.
## Setup and Installation
### Setting up Bun
To run the Bun server, you need to have Bun installed on your system. You can download and install Bun from the official Bun website: https://bun.sh/docs/installation
Alternatively, you can run the following script to install Bun:
```bash
curl -fsSL https://bun.sh/install | bash
```
### Installing Project Dependencies
Before running any script, ensure you have installed the project dependencies using the following command:
```bash
bun install
```
## Usage
### Create Database
Before running the Bun server, ensure you have created the database file using the following command:
```bash
bun db
```
This command will create an SQLite database file `database.sqlite` and seed it with 10,000 tweets.
### Run Server
To run a server, navigate to the project directory in your terminal and execute:
```bash
bun start
```
### Workload Test
To perform a workload test using wrk, run the following command: `wrk -t12 -c400 -d15s http://localhost:3000`