Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/natelindev/shuttle-backend
Shuttle REST/GraphQL backend
https://github.com/natelindev/shuttle-backend
api api-server graphql graphql-server javascript mongodb nodejs rest-api shuttle typescript
Last synced: 3 days ago
JSON representation
Shuttle REST/GraphQL backend
- Host: GitHub
- URL: https://github.com/natelindev/shuttle-backend
- Owner: natelindev
- Created: 2019-08-29T15:33:04.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2022-06-26T08:36:54.000Z (over 2 years ago)
- Last Synced: 2023-02-28T22:42:02.824Z (over 1 year ago)
- Topics: api, api-server, graphql, graphql-server, javascript, mongodb, nodejs, rest-api, shuttle, typescript
- Language: TypeScript
- Homepage:
- Size: 310 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
## Shuttle JS
#### Introduction
Built with `Express`, `Node.JS`, using `Typescript`
#### Setup
Install latest `Node.js` from [here](https://nodejs.org/en/download/)
Install latest `MongoDB` from [here](https://www.mongodb.com/download-center/community)
Start the `MongoDB` using command
```bash
mongod
```##### macOS
On macOS, you can install a mongdb GUI client using
```bash
brew cask install mongodb
```##### Linux
On linux, you should run `MongoDB` as a service
```bash
vi /etc/systemd/system/mongo.service
```Then enter the following:
```plaintext
[Unit]
Description=Mongo DB
After=network.target[Service]
Type=simple
User=your_user_name
ExecStart=/usr/bin/mongod
Restart=on-failure[Install]
WantedBy=multi-user.target
```##### Windows
On windows
##### Add dotenv file
create a `.env` file in project directory, with content like this:
you can change it to whatever port you prefer
```plaintext
PORT = 7777
SECRET = 'SOME_RANDOM_STRING'
JWT_EXPIRATION_MS = 259200000
MONGODB_CONNECT_STRING = 'mongodb://127.0.0.1:27017/shuttle'
```##### Install dependencies
Install the dependencies using:
```bash
yarn install
```or
```bash
npm install
```#### Run
Enter the project directory and
```shell
yarn dev
```or
```bash
npm start
```or
```bash
npm run dev
```#### Compile Typescrit and run the JS
Enter the project directory and
```shell
yarn prod
```or
```bash
npm run prod
```#### Lint
You need eslint installed globally
```bash
yarn lint
```or
```bash
npm run lint
```#### Debug
if you are using `Visual Studio Code`
Go to `Settings-> Debug: Node: Auto Attach`, Set it to be `On`
And then
```bash
yarn debug
```or
```bash
npm debug
```#### Run tests
You need jest installed globally
```bash
yarn test
```or
```bash
npm test
```