Commit d6785f94 authored by Maxim Starikov's avatar Maxim Starikov
Browse files

Merge branch 'ui_setup' into 'master'

Ui setup

Closes #6

See merge request !7
1 merge request!7Ui setup
Pipeline #407 passed with stages
in 15 seconds
......@@ -76,9 +76,3 @@ Thumbs.db
.env
### autogenerated things
/public/*.html
/public/*.js
/public/*.css
/public/3rdpartylicenses.txt
/public/favicon.ico
\ No newline at end of file
#
# SaGITarius - Code challenge project
- PHP Symfony
- Angular
- Bulma CSS
## how start
run in docker compose:
`docker-compose up`
load commits
`docker-compose exec web php /var/www/bin/console app:load-commits`
open the browser:
- http://localhost:8090/commit/ - list of commits (non angular)
- http://localhost:8090/author/ - list of authors (non angular)
- http://localhost:8090/index.html - Angular application
## How were you debugging this mini-project? Which tools?
php part is being debugged with xdebug
javascript part was debugged using nodejs debugger and chrome tools
## How were you testing the mini-project?
there is gilabci pipeline which is being run every commit
the following tools used for testing
- phpunit
- karma
- phpcs
- eslint
## Imagine this mini-project needs microservices with one single database, how would you draft an architecture?
This miniproject can be deployed anywhere as soon as database is available from it is not a problem to access it using mysqli or mysql_pdo driver.
## How would your solution differ when all over the sudden instead of saving to a Database you would have to call another external API to store and receive the commits.
The database layer can be replaced with the service which will be calling remote api to store data.
## Repository
The project is being hosted on private selfhosted repository here
......@@ -7,5 +42,8 @@ Here is list of issues that I have not done yet, due of lack of time only basic
## Demo server
The project deployed to demo server here: http://sagitarius.maxistar.me/index.html
open the browser:
- http://sagitarius.maxistar.me/commit/ - list of commits (non angular)
- http://sagitarius.maxistar.me/author/ - list of authors (non angular)
- http://sagitarius.maxistar.me/index.html - Angular application
CREATE DATABASE sagitarius CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
grant all privileges on sagitarius.* to 'sagitarius'@'%';
\ No newline at end of file
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: db
-- Generation Time: Jun 07, 2021 at 06:05 AM
-- Server version: 8.0.25
-- PHP Version: 7.4.4
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `sagitarius`
--
-- --------------------------------------------------------
--
-- Table structure for table `author`
--
CREATE TABLE `author` (
`id` int NOT NULL,
`platform` varchar(8) COLLATE utf8mb4_general_ci NOT NULL,
`email` varchar(100) COLLATE utf8mb4_general_ci NOT NULL,
`login` varchar(50) COLLATE utf8mb4_general_ci NOT NULL,
`avatar_url` varchar(255) COLLATE utf8mb4_general_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
CREATE TABLE `commit` (
`id` int NOT NULL,
`platform` varchar(8) COLLATE utf8mb4_general_ci NOT NULL,
`sha` varchar(40) COLLATE utf8mb4_general_ci NOT NULL,
`commit_date` datetime NOT NULL,
`author_id` int NOT NULL,
`message` text COLLATE utf8mb4_general_ci NOT NULL,
`url` varchar(255) COLLATE utf8mb4_general_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
--
-- Indexes for dumped tables
--
--
-- Indexes for table `author`
--
ALTER TABLE `author`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `commit`
--
ALTER TABLE `commit`
ADD PRIMARY KEY (`id`),
ADD KEY `author_id` (`author_id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `author`
--
ALTER TABLE `author`
MODIFY `id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=26;
--
-- AUTO_INCREMENT for table `commit`
--
ALTER TABLE `commit`
MODIFY `id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=26;
--
-- Constraints for dumped tables
--
--
-- Constraints for table `commit`
--
ALTER TABLE `commit`
ADD CONSTRAINT `commit_ibfk_1` FOREIGN KEY (`author_id`) REFERENCES `author` (`id`);
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
version: "2.0"
services:
setup:
build: docker/php74
container_name: php74_setup
links:
- db
volumes:
- .:/var/www
command: /var/www/docker/php-start.sh
dbsetup:
build: docker/mysql
container_name: database_sagitarius_setup
environment:
MYSQL_DATABASE: mysql_server
MYSQL_USER: sagitarius
MYSQL_PASSWORD: Sagitarius435!
MYSQL_ROOT_PASSWORD: Sagitarius435!
command: /var/www/docker/mysql-start.sh
links:
- db
volumes:
- .:/var/www
web:
build: docker/php74
container_name: php74_sagitarius
ports:
- "80:80"
- "443:443"
- "8090:80"
links:
- db
- phpmyadmin
......
#!/bin/bash
cd /var/www
while ! nc -z db 3306;
do
echo "waiting for mysql server"
sleep 1;
done;
mysql -uroot -hdb -pSagitarius435! < db/createdb.sql
mysql -usagitarius -hdb -pSagitarius435! sagitarius < db/sagitarius.sql
\ No newline at end of file
FROM mysql:8
MAINTAINER Max Starikov <maxim.starikov@gmail.com>
#install gd
RUN apt-get update && apt-get install -y \
netcat
\ No newline at end of file
#!/bin/bash
cd /var/www
while ! nc -z db 3306;
do
echo "waiting for mysql server"
sleep 1;
done;
cp .env.example .env
composer install
ln -s public html
\ No newline at end of file
......@@ -13,7 +13,7 @@ RUN docker-php-ext-install -j$(nproc) mysqli
RUN apt-get update && apt-get install -y \
libfreetype6-dev \
libjpeg62-turbo-dev \
libpng-dev git mc nano \
libpng-dev git mc nano netcat \
&& docker-php-ext-install -j$(nproc) iconv \
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
&& docker-php-ext-install -j$(nproc) gd
......
bulma
MIT
The MIT License (MIT)
Copyright (c) 2020 Jeremy Thomas
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
zone.js
MIT
The MIT License
Copyright (c) 2010-2020 Google LLC. https://angular.io/license
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
public/favicon.ico

948 Bytes

<!DOCTYPE html><html lang="en"><head>
<meta charset="utf-8">
<title>Frontend</title>
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico">
<style>body,html{margin:0;padding:0;}html{box-sizing:border-box;}*,:after,:before{box-sizing:inherit;}html{background-color:#fff;font-size:16px;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;min-width:300px;overflow-x:hidden;overflow-y:scroll;text-rendering:optimizeLegibility;-webkit-text-size-adjust:100%;text-size-adjust:100%;}body{font-family:BlinkMacSystemFont,-apple-system,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,Helvetica,Arial,sans-serif;}body{color:#4a4a4a;font-size:1em;font-weight:400;line-height:1.5;}</style><link rel="stylesheet" href="styles.a8d006a120cc74d2d4c8.css" media="print" onload="this.media='all'"><noscript><link rel="stylesheet" href="styles.a8d006a120cc74d2d4c8.css"></noscript></head>
<body>
<app-root></app-root>
<script src="runtime.ce2afe238265c8b3d829.js" defer></script><script src="polyfills.45e2d48ca819850e62fb.js" defer></script><script src="main.d9c5b8a77a8f961e2e93.js" defer></script>
</body></html>
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
(()=>{"use strict";var r,e={},n={};function t(r){var o=n[r];if(void 0!==o)return o.exports;var a=n[r]={exports:{}};return e[r](a,a.exports,t),a.exports}t.m=e,r=[],t.O=(e,n,o,a)=>{if(!n){var f=1/0;for(s=0;s<r.length;s++){for(var[n,o,a]=r[s],l=!0,u=0;u<n.length;u++)(!1&a||f>=a)&&Object.keys(t.O).every(r=>t.O[r](n[u]))?n.splice(u--,1):(l=!1,a<f&&(f=a));l&&(r.splice(s--,1),e=o())}return e}a=a||0;for(var s=r.length;s>0&&r[s-1][2]>a;s--)r[s]=r[s-1];r[s]=[n,o,a]},t.n=r=>{var e=r&&r.__esModule?()=>r.default:()=>r;return t.d(e,{a:e}),e},t.d=(r,e)=>{for(var n in e)t.o(e,n)&&!t.o(r,n)&&Object.defineProperty(r,n,{enumerable:!0,get:e[n]})},t.o=(r,e)=>Object.prototype.hasOwnProperty.call(r,e),(()=>{var r={666:0};t.O.j=e=>0===r[e];var e=(e,n)=>{var o,a,[f,l,u]=n,s=0;for(o in l)t.o(l,o)&&(t.m[o]=l[o]);if(u)var i=u(t);for(e&&e(n);s<f.length;s++)t.o(r,a=f[s])&&r[a]&&r[a][0](),r[f[s]]=0;return t.O(i)},n=self.webpackChunkfrontend=self.webpackChunkfrontend||[];n.forEach(e.bind(null,0)),n.push=e.bind(null,n.push.bind(n))})()})();
\ No newline at end of file
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment