Skip to content

SolsticeAR/solsticeAR-server

Repository files navigation

About

SolsticeAR is an open source AR media sharing platform. Please learn more at www.solsticear.com

This repo is hosting the source code for the Node.js/GraphQL/PostgreSQL backend. For access to the landing page, the React/Redux web dashboard or the the React Native mobile app please visit https://github.com/SolsticeAR.

Tech Used

  • Apollo Server / GraphQL
  • PostgreSQL
  • Sequelize

Requirements

First make sure you have the following installed on your machine:

  • Node.js
  • PostgreSQL

And then open up PostgreSQL and create a database called solstice

In terminal:

psql
create database solstice;

Development

OBS: Please make sure postgres is running.

  • First, install all package dependencies. In the terminal type:
yarn

Run all migrations:

yarn migrate

To undo migrations you can run yarn migrate:undo

And then seed the DB:

yarn seed

To undo seeds you can run yarn seed:undo

Run the server:

yarn start

Open browser at: http://localhost:4000 to checkout the API's docs.

For more info on how to use the API, please consult GraphQL's docs

Usage

  1. Send GraphQL query to localhost:4000/
  2. Customize the query so that you only get the data you need

Query examples

  • getAdmin(email: String!): Admin
{
  getAdmin(email: String) {
    id
    name
    email
    industry
  }
}

Mutation examples

  • register(adminData: NewAdmin): Admin
mutation {
  register(adminData:{
    name: String!
    email: String!
    password: String!
    industry: String
  }) {
    name
    email
    industry
  }
}
  • login(email: String, password: String): LoginResponse
mutation {
  login(email:String, password: String) {
    token
    admin {
      name
      email
      industry
    }
  }
}

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •