Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gothinkster/node-express-realworld-example-app
https://github.com/gothinkster/node-express-realworld-example-app
Last synced: 2 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/gothinkster/node-express-realworld-example-app
- Owner: gothinkster
- Created: 2016-07-15T09:41:40.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2024-05-01T21:56:04.000Z (8 months ago)
- Last Synced: 2024-12-05T13:02:44.966Z (16 days ago)
- Language: TypeScript
- Homepage:
- Size: 337 KB
- Stars: 3,640
- Watchers: 90
- Forks: 1,616
- Open Issues: 59
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-starred-test - gothinkster/node-express-realworld-example-app - (TypeScript)
README
# ![Node/Express/Prisma Example App](project-logo.png)
[![Build Status](https://travis-ci.org/anishkny/node-express-realworld-example-app.svg?branch=master)](https://travis-ci.org/anishkny/node-express-realworld-example-app)
> ### Example Node (Express + Prisma) codebase containing real world examples (CRUD, auth, advanced patterns, etc) that adheres to the [RealWorld](https://github.com/gothinkster/realworld-example-apps) API spec.
## Getting Started
### Prerequisites
Run the following command to install dependencies:
```shell
npm install
```### Environment variables
This project depends on some environment variables.
If you are running this project locally, create a `.env` file at the root for these variables.
Your host provider should included a feature to set them there directly to avoid exposing them.Here are the required ones:
```
DATABASE_URL=
JWT_SECRET=
NODE_ENV=production
```### Generate your Prisma client
Run the following command to generate the Prisma Client which will include types based on your database schema:
```shell
npx prisma generate
```### Apply any SQL migration script
Run the following command to create/update your database based on existing sql migration scripts:
```shell
npx prisma migrate deploy
```### Run the project
Run the following command to run the project:
```shell
npx nx serve api
```### Seed the database
The project includes a seed script to populate the database:
```shell
npx prisma db seed
```## Deploy on a remote server
Run the following command to:
- install dependencies
- apply any new migration sql scripts
- run the server```shell
npm ci && npx prisma migrate deploy && node dist/api/main.js
```