https://github.com/appeltje-c/rant
Rest Api on NodeJS with Typescript - A Boilerplate to get you started
https://github.com/appeltje-c/rant
boilerplate node node-js nodejs rest rest-api restful restful-api starter typescript
Last synced: 24 days ago
JSON representation
Rest Api on NodeJS with Typescript - A Boilerplate to get you started
- Host: GitHub
- URL: https://github.com/appeltje-c/rant
- Owner: appeltje-c
- License: mit
- Created: 2025-01-16T09:57:52.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-01-16T10:16:44.000Z (over 1 year ago)
- Last Synced: 2025-03-15T23:13:33.739Z (over 1 year ago)
- Topics: boilerplate, node, node-js, nodejs, rest, rest-api, restful, restful-api, starter, typescript
- Language: TypeScript
- Homepage:
- Size: 83 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: COPYING
Awesome Lists containing this project
README
# Rant
Rest API on NodeJS with Typescript - A Boiletplate
## Get started
Running locally:
```bash
yarn dev
```
Running in production:
```bash
yarn start
```
Testing:
```bash
# run all tests
yarn test
# run all tests in watch mode
yarn test:watch
# run test coverage
yarn coverage
```
Docker:
```bash
# run docker container in development mode
yarn docker:dev
# run docker container in production mode
yarn docker:prod
# run all tests in a docker container
yarn docker:test
```
## Environment Variables
The environment variables can be found and modified in the `.env` file. They come with these default values:
```bash
# Port number
PORT=3000
# URL of the Mongo DB
MONGODB_URL=mongodb://127.0.0.1:27017/rant
# JWT
# JWT secret key
JWT_SECRET=thisisasamplesecret
# Number of minutes after which an access token expires
JWT_ACCESS_EXPIRATION_MINUTES=30
# Number of days after which a refresh token expires
JWT_REFRESH_EXPIRATION_DAYS=30
# SMTP configuration options for the email service
# For testing, you can use a fake SMTP service like Ethereal: https://ethereal.email/create
SMTP_HOST=email-server
SMTP_PORT=587
SMTP_USERNAME=email-server-username
SMTP_PASSWORD=email-server-password
EMAIL_FROM=support@yourapp.com
```