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

https://github.com/madspaaskesen/sacred-backend-starter

๐Ÿ•Š๏ธ Sacred Backend Starter A clean and secure Node.js + Express backend starter with JWT auth, Prisma, and full test coverage โ€” made to grow sacred projects. Perfect for starting new API projects or cloning into sacred ecosystems like Sacred-AI or MySiteChart.
https://github.com/madspaaskesen/sacred-backend-starter

eslint expressjs javascript jest jwt jwt-authentication nodejs prettier prisma

Last synced: 3 months ago
JSON representation

๐Ÿ•Š๏ธ Sacred Backend Starter A clean and secure Node.js + Express backend starter with JWT auth, Prisma, and full test coverage โ€” made to grow sacred projects. Perfect for starting new API projects or cloning into sacred ecosystems like Sacred-AI or MySiteChart.

Awesome Lists containing this project

README

          

# ๐Ÿ•Š๏ธ Sacred Backend Starter

A clean and secure Node.js + Express backend starter with JWT auth, Prisma, and full test coverage โ€” made to grow sacred projects.

Perfect for starting new API projects or cloning into sacred ecosystems like **Sacred-AI** or **MySiteChart**.

---

![Node.js](https://img.shields.io/badge/Node.js-18.x-green)
![License](https://img.shields.io/github/license/madspaaskesen/sacred-backend-starter)
![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)
![Tests](https://img.shields.io/badge/tests-passing-brightgreen)

---

## โœจ Features

- Express.js + Prisma
- JWT authentication (`id` + `name` only in payload)
- Secure password handling with bcrypt
- Auth routes: `/auth/register`, `/auth/login`
- Protected user update: `PATCH /user/:id`
- `.env`-based config
- Prettier + ESLint formatting
- Jest + Supertest tests
- No migrations included (clean start)

---

## ๐Ÿš€ Getting Started

```bash
git clone https://github.com/sacred-ai/sacred-backend-starter.git
cd sacred-backend-starter
npm install
```

### ๐Ÿ”ง Configure environment

Create a `.env` file from `.env.example`:

```env
DATABASE_URL=postgresql://...
JWT_SECRET=your-secret
CORS_ORIGIN=http://localhost:5173
```

### ๐Ÿงฑ Setup DB

```bash
npx prisma generate
npx prisma migrate dev --name init
```

### โ–ถ๏ธ Start the server

```bash
npm run dev
```

---

## ๐Ÿงช Running Tests

```bash
npm run test
```

Tests are located in `/tests` and include full auth + user update coverage.

---

## ๐Ÿ“ฆ Scripts

| Script | Description |
|--------------------|----------------------------------------|
| `npm run dev` | Dev server with nodemon |
| `npm run start` | Run production server |
| `npm run lint` | Lint the code |
| `npm run format` | Prettier format the project |
| `npm run test` | Run all Jest + Supertest tests |
| `npx prisma studio`| Visual DB browser |

---

## ๐ŸŒ Related Projects

- ๐Ÿ•Š๏ธ [Sacred-AI](https://sacred-ai.com)
- ๐Ÿ“ˆ [MySiteChart](https://mysitechart.com)
- ๐Ÿ› ๏ธ [MP-IT](https://mp-it.dk)
- ๐Ÿงต [DDD Favoritter](https://ddd-favoritter.dk)

---

Made with clarity and care by [@mads](https://github.com/madspaaskesen) @ [@sacred-ai](https://github.com/Sacred-AI) ๐Ÿ’›