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.
- Host: GitHub
- URL: https://github.com/madspaaskesen/sacred-backend-starter
- Owner: madspaaskesen
- License: other
- Created: 2025-05-13T21:22:55.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-05-14T16:25:35.000Z (about 1 year ago)
- Last Synced: 2025-06-15T08:47:43.141Z (about 1 year ago)
- Topics: eslint, expressjs, javascript, jest, jwt, jwt-authentication, nodejs, prettier, prisma
- Language: JavaScript
- Homepage: https://sacred-ai.com
- Size: 10.7 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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**.
---




---
## โจ 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) ๐