Skip to content

Commit

Permalink
Merge pull request #8 from snemmani/issue/5
Browse files Browse the repository at this point in the history
Issue/5
  • Loading branch information
snemmani authored Aug 8, 2020
2 parents 652c90f + c593aeb commit 8451791
Show file tree
Hide file tree
Showing 18 changed files with 471 additions and 111 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/trello.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Attach to Trello
on:
pull_request:
types: [opened, reopened, edited]
jobs:
attach-trello:
runs-on: ubuntu-latest
name: Find trello link and attach to card
steps:
- uses: delivered/attach-to-trello-card-action@master
with:
trello-key: ${{ secrets.TRELLO_KEY }}
trello-token: ${{ secrets.TRELLO_TOKEN }}
3 changes: 1 addition & 2 deletions confessions-client/angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
"src/assets"
],
"styles": [
"./node_modules/@angular/material/prebuilt-themes/purple-green.css",
"src/styles.scss"
],
"scripts": []
Expand Down Expand Up @@ -128,4 +127,4 @@
}
},
"defaultProject": "confessions-client"
}
}
3 changes: 3 additions & 0 deletions confessions-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,13 @@
"@angular/compiler": "~10.0.6",
"@angular/core": "~10.0.6",
"@angular/forms": "~10.0.6",
"@angular/localize": "~10.0.6",
"@angular/material": "^10.1.2",
"@angular/platform-browser": "~10.0.6",
"@angular/platform-browser-dynamic": "~10.0.6",
"@angular/router": "~10.0.6",
"@ng-bootstrap/ng-bootstrap": "^7.0.0",
"bootstrap": "^4.5.0",
"rxjs": "~6.5.5",
"tslib": "^2.0.0",
"zone.js": "~0.10.3"
Expand Down
4 changes: 3 additions & 1 deletion confessions-client/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,16 @@ import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import {MatSliderModule} from "@angular/material/slider";
import {MatIconModule} from "@angular/material/icon";
import {MatToolbarModule} from "@angular/material/toolbar";
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';

@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
AppRoutingModule
AppRoutingModule,
NgbModule
],
providers: [],
bootstrap: [AppComponent]
Expand Down
4 changes: 4 additions & 0 deletions confessions-client/src/polyfills.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/***************************************************************************************************
* Load `$localize` onto the global scope - used if i18n tags appear in Angular templates.
*/
import '@angular/localize/init';
/**
* This file includes polyfills needed by Angular and is loaded before the app.
* You can add your own extra polyfills to this file.
Expand Down
4 changes: 2 additions & 2 deletions confessions-client/src/styles.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* You can add global styles to this file, and also import other style files */

html, body { height: 100%; }
body { margin: 0; font-family: Roboto, "Helvetica Neue", sans-serif; }
/* Importing Bootstrap SCSS file. */
@import '~bootstrap/scss/bootstrap';
191 changes: 176 additions & 15 deletions confessions-rest/confessions.postman_collection.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,45 +12,59 @@
"name": "Comment",
"item": [
{
"name": "/api/confession/{id}/comment/",
"name": "/api/confession/{id}/comment",
"request": {
"auth": {
"type": "basic",
"basic": [
{
"key": "password",
"value": "M49d4@Sri",
"type": "string"
},
{
"key": "username",
"value": "snemmani",
"type": "string"
}
]
},
"method": "POST",
"header": [
{
"key": "Content-Type",
"name": "Content-Type",
"value": "application/json",
"type": "text"
"type": "text",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{\n\t\"text\": \"This is a successfull comment? Is it successfull?\"\n}",
"raw": "{\n\t\"text\": \"This is a successfull comment? Is it first\"\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "localhost:8000/api/confession/3/comment/",
"raw": "localhost:8000/api/confession/1/comment",
"host": [
"localhost"
],
"port": "8000",
"path": [
"api",
"confession",
"3",
"comment",
""
"1",
"comment"
]
}
},
"response": []
},
{
"name": "/api/confession/{id}/comment",
"name": "/api/comment/{id}",
"request": {
"auth": {
"type": "basic",
Expand All @@ -72,13 +86,13 @@
{
"key": "Content-Type",
"name": "Content-Type",
"value": "application/json",
"type": "text"
"type": "text",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"id\": 1,\n \"user\": \"snemmani\",\n \"text\": \"This is a successfull comment? Is it successfull?\",\n \"upvote_count\": 1,\n \"downvote_count\": 0,\n \"created\": \"2020-08-07T11:45:06.688348+05:30\"\n}",
"raw": "{\n \"text\": \"This is a successfull comment? Is it updated?\"\n}",
"options": {
"raw": {
"language": "json"
Expand All @@ -99,6 +113,114 @@
}
},
"response": []
},
{
"name": "/api/comment/{id}/vote",
"request": {
"auth": {
"type": "basic",
"basic": [
{
"key": "password",
"value": "M49d4@Sri",
"type": "string"
},
{
"key": "username",
"value": "snemmani",
"type": "string"
}
]
},
"method": "POST",
"header": [
{
"key": "Content-Type",
"name": "Content-Type",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\n\t\"vote_type\": 1\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "localhost:8000/api/comment/2/vote",
"host": [
"localhost"
],
"port": "8000",
"path": [
"api",
"comment",
"2",
"vote"
]
}
},
"response": []
},
{
"name": "/api/confession/{id}/comment",
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "localhost:8000/api/confession/1/comment",
"host": [
"localhost"
],
"port": "8000",
"path": [
"api",
"confession",
"1",
"comment"
]
}
},
"response": []
},
{
"name": "/api/comment/{id}",
"request": {
"auth": {
"type": "basic",
"basic": [
{
"key": "password",
"value": "M49d4@Sri",
"type": "string"
},
{
"key": "username",
"value": "snemmani",
"type": "string"
}
]
},
"method": "DELETE",
"header": [],
"url": {
"raw": "localhost:8000/api/comment/2",
"host": [
"localhost"
],
"port": "8000",
"path": [
"api",
"comment",
"2"
]
}
},
"response": []
}
],
"protocolProfileBehavior": {},
Expand Down Expand Up @@ -165,16 +287,15 @@
"method": "GET",
"header": [],
"url": {
"raw": "localhost:8000/api/confession/3/",
"raw": "localhost:8000/api/confession/1",
"host": [
"localhost"
],
"port": "8000",
"path": [
"api",
"confession",
"3",
""
"1"
]
}
},
Expand Down Expand Up @@ -219,6 +340,46 @@
}
},
"response": []
},
{
"name": "/api/confession/{id}/vote",
"request": {
"auth": {
"type": "noauth"
},
"method": "POST",
"header": [
{
"key": "Content-Type",
"name": "Content-Type",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\n\t\"vote_type\": -1\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "localhost:8000/api/confession/1/vote",
"host": [
"localhost"
],
"port": "8000",
"path": [
"api",
"confession",
"1",
"vote"
]
}
},
"response": []
}
],
"protocolProfileBehavior": {}
Expand Down
Binary file removed confessions-rest/db.sqlite3
Binary file not shown.
15 changes: 15 additions & 0 deletions confessions-rest/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Confessions REST API

This api implements a RESTful service for the confessions web app

The app has 2 components
* Confession
* * This does not need authentication
* Comment
* * Needs authentication

# License
This app and its components can be reused without changing the source code

## Author: snemmani

Loading

0 comments on commit 8451791

Please sign in to comment.