diff --git a/docs/API.md b/API.md similarity index 100% rename from docs/API.md rename to API.md diff --git a/Makefile b/Makefile index d000e6e..b02047b 100644 --- a/Makefile +++ b/Makefile @@ -3,12 +3,12 @@ all: backend database frontend .PHONY: backend backend: - docker build -t pixelgram/backend src/backend + docker build -t localhost:5000/pixelgram/backend src/backend .PHONY: database database: - docker build -t pixelgram/database src/database + docker build -t localhost:5000/pixelgram/database src/database .PHONY: frontend frontend: - docker build -t pixelgram/frontend src/frontend + docker build -t localhost:5000/pixelgram/frontend src/frontend diff --git a/README.md b/README.md index 294d25c..c28010e 100644 --- a/README.md +++ b/README.md @@ -1,19 +1,13 @@ # Pixelgram -**Pixelgram** is an image-sharing application where users can create, +**Pixelgram** is an image-sharing application where users can create, browse and like images. -## Screenshots - -Feed | Profile ---- | --- -[![Screenshot of feed screen](/docs/img/01_feed.png)](/docs/img/01_feed.png) | [![Screenshot of profile screen](/docs/img/02_profile.png)](/docs/img/02_profile.png) - ## Architecture Service | Language | Description --- | --- | --- -[backend](/src/backend) | Python | Backend of the app, responsible for users, posts and authentication. +[backend](/src/backend) | JavaScript | Backend of the app, responsible for users, posts and authentication. [database](/src/database) | SQL | PostgreSQL database with tables, relationships and functions. [frontend](/src/frontend) | TypeScript | Angular frontend of the app. @@ -24,8 +18,8 @@ Service | Language | Description Clone the repository to your filesystem ```sh -$ git clone git@github.com:robbdimitrov/pixelgram.git -$ cd pixelgram +git clone git@github.com:robbdimitrov/pixelgram.git +cd pixelgram ``` ### Build the images @@ -33,15 +27,15 @@ $ cd pixelgram Build all the images ```sh -$ make +make ``` Or build specific images ```sh -$ make backend -$ make database -$ make frontend +make backend +make database +make frontend ``` ### Create namespace @@ -49,7 +43,7 @@ $ make frontend Create namespace for the k8s resources ```sh -$ kubectl create namespace pixelgram +kubectl create namespace pixelgram ``` ### Create deployments @@ -57,7 +51,7 @@ $ kubectl create namespace pixelgram Create deployments and volumes ```sh -$ kubectl apply -f ./k8s -n pixelgram +kubectl apply -f ./k8s -n pixelgram ``` ## Access the frontend @@ -65,7 +59,7 @@ $ kubectl apply -f ./k8s -n pixelgram Enable port forwarding ```sh -$ kubectl port-forward service/frontend 8080 -n pixelgram +kubectl port-forward service/frontend 8080 -n pixelgram ``` Open the frontend [here](http://localhost:8080/). @@ -75,18 +69,18 @@ Open the frontend [here](http://localhost:8080/). Delete all resources ```sh -$ kubectl delete -f ./k8s -n pixelgram +kubectl delete -f ./k8s -n pixelgram ``` Delete the namespace ```sh -$ kubectl delete namespace pixelgram +kubectl delete namespace pixelgram ``` ## API -The API documentation is available [here](/docs/API.md). +The API documentation is available [here](/API.md). ## License diff --git a/docs/img/01_feed.png b/docs/img/01_feed.png deleted file mode 100644 index 132bd09..0000000 Binary files a/docs/img/01_feed.png and /dev/null differ diff --git a/docs/img/02_profile.png b/docs/img/02_profile.png deleted file mode 100644 index 949f1c2..0000000 Binary files a/docs/img/02_profile.png and /dev/null differ diff --git a/k8s/backend.yaml b/k8s/backend.yaml index bf6d9c5..b8356a9 100644 --- a/k8s/backend.yaml +++ b/k8s/backend.yaml @@ -29,8 +29,7 @@ spec: spec: containers: - name: backend - image: pixelgram/backend - imagePullPolicy: Never + image: localhost:5000/pixelgram/backend ports: - containerPort: 8080 resources: diff --git a/k8s/database.yaml b/k8s/database.yaml index d566fa0..00fd004 100644 --- a/k8s/database.yaml +++ b/k8s/database.yaml @@ -29,8 +29,7 @@ spec: spec: containers: - name: database - image: pixelgram/database - imagePullPolicy: IfNotPresent + image: localhost:5000/pixelgram/database ports: - containerPort: 5432 env: diff --git a/k8s/frontend.yaml b/k8s/frontend.yaml index 81030d9..c0faf9d 100644 --- a/k8s/frontend.yaml +++ b/k8s/frontend.yaml @@ -29,8 +29,7 @@ spec: spec: containers: - name: frontend - image: pixelgram/frontend - imagePullPolicy: Never + image: localhost:5000/pixelgram/frontend ports: - containerPort: 8080 resources: diff --git a/src/frontend/Dockerfile b/src/frontend/Dockerfile index b3b84c5..21ac768 100644 --- a/src/frontend/Dockerfile +++ b/src/frontend/Dockerfile @@ -8,4 +8,3 @@ RUN npm run build FROM nginx:1.23-alpine COPY ./nginx.conf /etc/nginx/conf.d/default.conf COPY --from=builder /usr/src/app/dist /usr/share/nginx/html -CMD ["nginx", "-g", "daemon off;"] diff --git a/src/frontend/angular.json b/src/frontend/angular.json index c53d9b4..03794b4 100644 --- a/src/frontend/angular.json +++ b/src/frontend/angular.json @@ -3,7 +3,7 @@ "version": 1, "newProjectRoot": "projects", "projects": { - "frontend": { + "pixelgram": { "projectType": "application", "schematics": { "@schematics/angular:component": { @@ -20,7 +20,7 @@ "build": { "builder": "@angular-devkit/build-angular:browser", "options": { - "outputPath": "dist/frontend", + "outputPath": "dist", "index": "src/index.html", "main": "src/main.ts", "polyfills": "src/polyfills.ts", @@ -72,10 +72,10 @@ "builder": "@angular-devkit/build-angular:dev-server", "configurations": { "production": { - "browserTarget": "frontend:build:production" + "browserTarget": "pixelgram:build:production" }, "development": { - "browserTarget": "frontend:build:development" + "browserTarget": "pixelgram:build:development" } }, "options": { @@ -86,7 +86,7 @@ "extract-i18n": { "builder": "@angular-devkit/build-angular:extract-i18n", "options": { - "browserTarget": "frontend:build" + "browserTarget": "pixelgram:build" } }, "test": { diff --git a/src/frontend/package.json b/src/frontend/package.json index 965f5cf..929379d 100644 --- a/src/frontend/package.json +++ b/src/frontend/package.json @@ -7,7 +7,7 @@ "scripts": { "ng": "ng", "start": "ng serve", - "build": "ng build --prod", + "build": "ng build", "lint": "ng lint" }, "dependencies": { diff --git a/src/frontend/src/app/screens/feed/image/image.component.html b/src/frontend/src/app/screens/feed/image/image.component.html index 0045a15..439c8af 100644 --- a/src/frontend/src/app/screens/feed/image/image.component.html +++ b/src/frontend/src/app/screens/feed/image/image.component.html @@ -35,7 +35,7 @@ - {{image.likes}} {{image.likes == 1 ? "like" : "likes"}} + {{image.likes}} {{image.likes === 1 ? "like" : "likes"}}