- Express
- Apollo Server
- TypeORM
- GraphQL
- PostgreSQL
- Redis
- Sentry
- Clone this repo:
git clone https://github.com/marcelovicentegc/typescript-graphql-api.git
- Change directory:
cd typescript-graphql-api
- Install dependencies:
npm i
- Create a Postgres database and set your credentials on a
.env
file, similar to.env.example
(you can start a Postgres db with Docker by runningnpm run get:pg
followed bynpm run start:pg
) - Create a Redis database and set your credentials on a
.env
file, similar to.env.example
(you can start Redis with Docker by runningnpm run get:redis
followed bynpm run start:redis
) - Run the application:
npm start
- Navigate to
http://localhost:8080/api
- Make sure the app is up and running before generating the client types (
npm run gen
)
Environment variable | Default value |
---|---|
SESSION_SECRET | random uuid |
PORT | 8080 |
APOLLO_ENDPOINT | /api |
DB_HOST | localhost |
DB_NAME | postgres |
DB_USERNAME | postgres |
DB_PASSWORD | postgres |
REDIS_HOST | localhost |
REDIS_PORT | 6379 |
REDIS_PASSWORD | undefined |
SENTRY_DNS | undefined |
ENVIRONMENT | local |