An open API service indexing awesome lists of open source software.

https://github.com/lajule/rac

REST API in C
https://github.com/lajule/rac

c libuv rest

Last synced: 5 months ago
JSON representation

REST API in C

Awesome Lists containing this project

README

          

# rac

๐Ÿš€ High-Performance REST API in C

> **Bye Golang, Ciao Rust, Thank you AI, Welcome back C!**

A REST API built entirely in C with: async I/O, connection pooling, and thread-based request handling.

## โœจ Features

- โšก **Asynchronous I/O** - Built on libuv event loop for maximum performance
- ๐Ÿ“Š **PostgreSQL Pool** - Thread-safe connection pooling
- ๐Ÿงต **Thread Pool** - Multi-threaded request processing
- ๐Ÿ”„ **HTTP Parser** - Modern llhttp parser for efficient request handling
- ๐Ÿ“ฆ **JSON Support** - Request/response serialization with cJSON

## ๐Ÿ“‹ Prerequisites

```bash
sudo apt-get update
sudo apt-get install -y \
libuv1-dev \
libllhttp-dev \
libpq-dev \
build-essential
```

## Environment

```bash
UV_THREADPOOL_SIZE=4
LOG_LEVEL=1
DB_POOL_SIZE=4
DB_CONNINFO="host=postgres dbname=mydb user=mydb password=p@ssw0rd"
HTTP_PORT=8080
HTTP_BACKLOG=128
```

## ๐Ÿ™ Acknowledgments

- [libuv](https://libuv.org/) - Cross-platform async I/O
- [llhttp](https://github.com/nodejs/llhttp) - Fast HTTP parser
- [cJSON](https://github.com/DaveGamble/cJSON) - Lightweight JSON parser
- [PostgreSQL](https://www.postgresql.org/) - Powerful database
- [libpq](https://www.postgresql.org/docs/current/libpq.html) - PostgreSQL C API

---

**Built with โค๏ธ and C** - Because sometimes, less is more.