Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/damingerdai/express-postgres-ts-starter
express postgres typescript starter
https://github.com/damingerdai/express-postgres-ts-starter
docker express graphql knex knexjs nodejs postgres postgresql typescript
Last synced: 19 days ago
JSON representation
express postgres typescript starter
- Host: GitHub
- URL: https://github.com/damingerdai/express-postgres-ts-starter
- Owner: damingerdai
- License: apache-2.0
- Created: 2020-04-25T16:34:33.000Z (over 4 years ago)
- Default Branch: develop
- Last Pushed: 2024-12-02T12:20:50.000Z (25 days ago)
- Last Synced: 2024-12-02T13:29:06.132Z (25 days ago)
- Topics: docker, express, graphql, knex, knexjs, nodejs, postgres, postgresql, typescript
- Language: TypeScript
- Homepage:
- Size: 2.92 MB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 18
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# express-postgres-ts-starter
a starter project based on [express](https://expressjs.com/) and [postgres](https://www.postgresql.org/).
## Init
This project needs to install the following software:
1. [Docker](https://www.docker.com/)和[Docker Compose](https://docs.docker.com/engine/reference/commandline/compose/)
2. [Node](https://nodejs.org/)
3. [Yarn](https://classic.yarnpkg.com/lang/en/)> Note: node >= 18.0.0
### Set up
use Docker create a postgres database
```
docker network create daming-epts-network
docker volume create --name=daming-epts-volume
docker volume create --name=daming-minio-volume
docker volume create --name=daming-redis-volume
docker compose up db
```use yarn install 3rd dependencies
```
yarn
```run db migrations and seed script
```
yarn migrate:up:local
yarn seed:run:local
```run server in develop mode
```
yarn start:dev
```Now open the link [http://127.0.0.1:3000/graphql](http://127.0.0.1:3000/graphql) with your browser.
### Set up (with docker compose)
```shell
## set up Docker environment
docker network create daming-epts-network
docker volume create --name=daming-epts-volume
docker volume create --name=daming-minio-volume
docker volume create --name=daming-redis-volume# pull docker images
docker-compose pull# build docker containers
docker-compose build## yarn dependency
docker-compose run backend yarn## databases
docker-compose run backend sh -c "yarn migrate:up && yarn seed:run"## run server
docker-compose up```
Now open the link [http://127.0.0.1:3000/graphql](http://127.0.0.1:3000/graphql) with your browser.