Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/0xmukesh/hacky-node-template-v2
🏄♂️ A node.js template to quickly get started building with Fastify and Prisma
https://github.com/0xmukesh/hacky-node-template-v2
fastify nodejs prisma
Last synced: 7 days ago
JSON representation
🏄♂️ A node.js template to quickly get started building with Fastify and Prisma
- Host: GitHub
- URL: https://github.com/0xmukesh/hacky-node-template-v2
- Owner: 0xMukesh
- Created: 2022-08-29T15:19:38.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-08-29T15:27:34.000Z (over 2 years ago)
- Last Synced: 2024-12-20T17:28:43.651Z (22 days ago)
- Topics: fastify, nodejs, prisma
- Language: TypeScript
- Homepage:
- Size: 21.5 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# hacky-node-template v2
🏄♂️ A type-safe Node.js template to quickly get started building with [Fastify](https://fastify.io).
## Tech-stack
- [Fastify](https://fastify.io) - Fast and low overhead web framework, for Node.js.
- [Prisma](https://prisma.io) - Type-safe ORM to ship code which doesn't break during production.
- [MongoDB](https://mongodb.com) - A NoSQL database.
- [pnpm](https://pnpm.io/) - Fast, disk space efficient package manager## Getting started
1. If you haven't installed pnpm yet then go ahead and install it via npm/yarn.
```bash
yarn add -g pnpm # yarn
npm install -g pnpm # npm
```2. Click on "Use this template" and you are ready to ship 🏄♂️
3. Install all the dependencies via `pnpm i` command.
4. Create `.env` file and add in your MongoDB connection URI```
DATABASE_URL=your-mongodb-connection-uri
```5. Open a new terminal window and run `pnpm watch`, this would re-build all the files on any kind of file changes under the `src` folder.
6. Open a new terminal window and run `pnpm dev`, this would spin up a local development server at http://localhost:3000
7. The database schema is stored within the [`prisma/schema.prisma`](./prisma/schema.prisma) file. If you want to have cross-file model relations, then you would need to use something like [Prismix](https://github.com/jamiepine/prismix).
8. Deploy your Node.js application to [Railway](https://railway.app) within seconds[![Deploy on Railway](https://railway.app/button.svg)](https://railway.app/new/template/hAVE3a?referralCode=hhzWkP)
Made by [@0xMukesh](https://twitter.com/0xMukesh)