Skip to content

fac20/CEYEBER-backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

67 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CEYEBER-backend

image

Intro

Link to hosted backend Backend for CEYEBER critical thinking game. Front-end

Team Roles

  • Product Owner: Aqsa
  • Scrum Facilitator: Jessica
  • Quality: Jennifer
  • UX/UI: My Hoa
  • DevOps: Rihards

Built with

  • NodeJS
  • Express
  • PostgreSQL
  • Heroku (deployment of database)

Schema

DB diagram

image

Set Up Locally

  • Clone this repo to your machine
  • Run npm install
  • Set up local database
    • run psql in your terminal
    • CREATE USER myuser SUPERUSER PASSWORD mypassword
    • CREATE DATABASE ceyeber WITH OWNER myuser
    • \c ceyeber or if you are in the terminal psql -d ceyeber -U myuser and insert password when prompted
    • \i src/database/init.sql
  • Create a .env file in the root folder with DATABASE_URL=postgres://myuser:mypassword@localhost:5432/ceyeber
  • Run npm run dev to start the server

Server Routes

Base URL is either your local host or https://ceyeber.herokuapp.com/

  1. POST /user - requires a JSON object like example below. Once a user has signed up, the server will send back and store the user id into the session storage
{
  "agent": "BrownFox",
  "age": "8",
  "location": "United Kingdom"
}
  1. POST /skills - requires a JSON object like example below - user id will automatically be taken from users session storage
{
  "user_id": "2",
  "facebook" : "2",
  "instagram" : "2",
  "snapchat" : "2",
  "tiktok" : "2",
  "twitter" : "2",
  "whatsapp": "2",
  "youtube" : "2"
}
  1. POST /answers - requires a JSON object like example below - user id will automatically be taken from users session storage
{
  "user_id": "2",
  "q1a1": "1",
  "q1a2": "1",
  "q2a1": "1",
  "q2a2": "1",
  "q3a1": "1",
  "q3a2": "1"
}

About

backend for CEYEBER critical thinking game

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •