0.0.1 • Published 5 years ago

commie-service v0.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
5 years ago

Commie Service

Backend for the Klosser Nettbutikk project. It reads and write data to a MongoDB database. There are three different kinds of servers in this backend: REST, GraphQL and GraphQL Websocket. This also means that there are three different kinds of endpoints to the backend.

Content

Default Local Endpoints
Installation
Getting Started
Deploy
Release

Default Local Endpoints

REST: http://localhost:1337
GraphQL: http://localhost:4000/graphql
GraphQL Websocket: ws://localhost:4000/graphql

Installation

In this project we use Node and yarn so head to these sites to download and follow their respective instructions:
Node: https://nodejs.org/en/
Yarn: https://yarnpkg.com/lang/en/docs/install/

Local MongoDB database:
https://docs.mongodb.com/manual/administration/install-community/

You can download Compass to get a view for the database:
https://www.mongodb.com/download-center/compass

Also you will need to use either Postman or Insomnia to execute requests to the backend
Insomnia: https://insomnia.rest/download/
Postman: https://www.getpostman.com/downloads/

Getting Started

Database

Start up a local database by running mongod in a terminal. The database should start up with a default port number 27017.

Downloading Dependencies

This project fetches some dependencies from our private NPM repository. Therefore, you need to link your NPM client to your NPM account that has access to the private repositories. Do this by running npm login and the following command

npm config set registry "https://registry.npmjs.org/"

Note that Yarn does have its own configuration that simply extends the NPM configurations.

Run yarn in a terminal to download all dependencies including the ones from the private repository.

Configuring Environment

Make a copy of the .env.example file in this repository and name it .env. Then you need to fill the variables with the correct configurations. The secret credentials are not available anywhere, so you will need to ask the team.

Running the project

Now that you're done configuring the project, you can simply run yarn dev to start the servers.

Deploy

Add this when ready to deploy

Release

Add this when ready to release