REST API for Material Forms, a form-builder application. Built with ElysiaJS, Prisma, and PostgreSQL, running on the Bun runtime.
- JWT authentication (register, login, session)
- Form CRUD with publish/close lifecycle
- Public form submission with required-field validation
- Per-form analytics and CSV export
- Rate limiting on submissions
- OpenAPI documentation (Scalar UI at
/openapi)
- Bun v1.0+
- PostgreSQL database
- Clone and install dependencies
git clone https://github.com/Frsxk/material-backend.git
cd material-backend
bun install- Configure environment variables
Create a .env file in the project root:
DATABASE_URL="postgresql://user:password@localhost:5432/material_forms"
JWT_SECRET="your-secret-key"- Run database migrations
bunx prisma migrate deploy- Start the development server
bun run devThe API will be available at http://localhost:5000.
| Command | Description |
|---|---|
bun run dev |
Start dev server with watch mode |
bun test |
Run integration tests |
bunx prisma migrate dev |
Create a new migration |
bunx prisma migrate deploy |
Apply pending migrations |