Skip to content

1byte-yoda/gs-news-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GS News Fullstack Application

Build Status


GS News Fullstack Application

Stay updated with GS News!
Explore the docs »

View Demo · Report Bug · Request Feature

Table of Contents

About The Project

GS News Login GS News GQL GS News Topic

Built With

Getting Started

To get a local copy up and running follow these simple steps.

Prerequisites

Make sure you have the following software installed and running on your computer:

Check docker version

$ docker -v
Docker version 19.03.13, build 4484c46d9d

Check docker-compose version

$ docker-compose -v
docker-compose version 1.27.4, build 40524192

Check docker-machine version

$ docker-machine -v
docker-machine version 0.16.0, build 702c267f

Installation

  1. Clone the repo
$ git clone https://github.com/PHmark/gs-news-app.git
  1. Create a docker machine inside a virtualbox
$ docker-machine create -d virtualbox gs-news-app
  1. Run the docker-machine (Linux):
$ eval "$(docker-machine env gs-news-app)"
  • For Windows users, use the command
$ @FOR /f "tokens=*" %i IN ('docker-machine env gs-news-app') DO @%i
  • Make sure you Docker client is pointed to gs-news-app virtualbox
$ docker-machine ls

NAME             ACTIVE   DRIVER       STATE     URL                         SWARM   DOCKER      ERRORS   
gs-news-app      *        virtualbox   Running   tcp://192.168.99.107:2376           v19.03.12
  1. Install using docker-compose
$ docker-compose build

Workflow

0. Get the IP Address of the virtualbox and set React App's URL environment variable:

$ docker-machine ip gs-news-app
192.168.99.107

# For Linux
$ export REACT_APP_API_SERVICE_URL=http://192.168.99.107

# For windows
$ set REACT_APP_API_SERVICE_URL=http://192.168.99.107

1. Running the web application:

$ docker-compose up -d

2. Seed the database:

$ docker-compose run api python manage.py seed_db

3. Running unit tests:

$ docker-compose run api python manage.py test

4. Verify flake8 code compliance:

$ docker-compose run api flake8 app

5. Show test coverage summary:

$ docker-compose run api python manage.py cov

6. Open your virtualbox's IP Address on web browser, on the example above the IP Address was 192.168.99.107. (Might take some time for the React App to load.)

Quick snapshot of the Application's API endpoints.

  • [POST] /user/register_ - User account registration
  • [POST] /user/login - User account login
  • [POST] /topic - Creation of a topic
  • [PATCH] /topic - Update a topic
  • [DELETE] /topic - Delete a topic
  • [POST] /topic/{id}/message - Create a message on a topic.
  • [GET] /topics - Retrieve all topics.
  • [GET] /topic/{id}/messages - Retrieve all messages in a topic.

Contact

Mark - dmc.markr@gmail.com

Project Link: https://github.com/PHmark/gs-news-app

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published