Skip to content

Commit

Permalink
Merge pull request #7 from iNewLegend/setup-and-docs
Browse files Browse the repository at this point in the history
Setup and docs
  • Loading branch information
iNewLegend authored Sep 2, 2023
2 parents e5fca25 + 3c5aeb6 commit 4c5570c
Show file tree
Hide file tree
Showing 9 changed files with 114 additions and 42 deletions.
36 changes: 35 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,39 @@
![image](https://github.com/iNewLegend/web-crawler/assets/10234691/830714f3-c0ec-4b51-add7-d44b0598cc98)
![image](https://github.com/iNewLegend/web-crawler/assets/10234691/279734f9-88ae-4729-9175-742be5b38b7c)

# Requirements
- PHP Version: `8.2`
- MongoDB
- PHP
- Min Version: `8.2`
- MongoDB extension
- Composer
- Node
- NPM
- Angular CLI

# Installation
- Clone the repository
- $ `git clone https://github.com/iNewLegend/web-crawler.git`
- $ `cd web-crawler`
- $ `composer install`


- Setup mongodb connection
- $ `cd crawler-backend`
- $ `cp .env.example .env`
- $ `vim .env`
- Set `MONGODB_URI` to your mongodb connection string
- Set `MONGODB_DB` to your mongodb database name
- Save and exit
- $ Create database collections
- $ `php artisan migrate`
- $ `cd ..`


- Run backend server
- $ `composer dev-start-backend`
- Run frontend server (in another terminal)
- $ `composer dev-start-frontend`

# Major commits
- 2023-08-31 08:00:00 ~ 14:30:00 `New: CrawlerLib - Initial Commit`
Expand Down
10 changes: 10 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,16 @@
"dev-start-frontend": [
"Composer\\Config::disableProcessTimeout",
"cd crawler-frontend && ng serve"
],
"clean-vendor": [
"rm -rf crawler-lib/vendor",
"rm -rf crawler-backend/vendor",
"rm -rf crawler-frontend/node_modules"
],
"pre-install-cmd": [
"cd crawler-lib && composer install",
"cd crawler-backend && composer install",
"cd crawler-frontend && npm install"
]
}
}
18 changes: 18 additions & 0 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 2 additions & 5 deletions crawler-backend/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,9 @@ LOG_CHANNEL=stack
LOG_DEPRECATIONS_CHANNEL=null
LOG_LEVEL=debug

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_CONNECTION=mongodb
DB_DSN=mongodb://127.0.0.1:27017/?directConnection=true
DB_DATABASE=laravel
DB_USERNAME=root
DB_PASSWORD=

BROADCAST_DRIVER=log
CACHE_DRIVER=file
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +0,0 @@
// Submit button
button[type="submit"] {
max-width: 379px;
}
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
<table class="table">
<thead>
<tr>
<th scope="col">#</th>
<th scope="col">URL</th>
<th scope="col">Text associated</th>
<th scope="col">Depth</th>
<th scope="col">Links count</th>
<th scope="col">Created at</th>
<th scope="col">Updated at</th>
<th scope="col">Actions</th>
</tr>
</thead>
<div class="table-responsive">
<table class="table">
<thead>
<tr>
<th scope="col">#</th>
<th scope="col">URL</th>
<th scope="col">Text associated</th>
<th scope="col">Depth</th>
<th scope="col">Links count</th>
<th scope="col">Created at</th>
<th scope="col">Updated at</th>
<th scope="col">Actions</th>
</tr>
</thead>

<tbody>
<tbody>
<tr *ngFor="let item of items" class="cursor-pointer" (click)="onClick(item)">
<th scope="row" >{{ items.indexOf( item ) + 1 }}</th>
<td class="text-start">{{ item.url }}</td>
Expand All @@ -26,5 +27,6 @@
<span class="mx-2" title="Delete" (click)="onDeleteClick(item); $event.stopPropagation()"></span>
</th>
</tr>
</tbody>
</table>
</tbody>
</table>
</div>
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
<table class="table">
<thead>
<tr>
<th scope="col">#</th>
<th scope="col">URL</th>
<th scope="col">Text associated</th>
<th scope="col">Created at</th>
<th scope="col">Updated at</th>
</tr>
</thead>
<div class="table-responsive">
<table class="table">
<thead>
<tr>
<th scope="col">#</th>
<th scope="col">URL</th>
<th scope="col">Text associated</th>
<th scope="col">Created at</th>
<th scope="col">Updated at</th>
</tr>
</thead>

<tbody>
<tbody>
<tr *ngFor="let item of items" class="cursor-pointer" (click)="onClick(item)">
<th scope="row" >{{ items.indexOf( item ) + 1 }}</th>
<th scope="row">{{ items.indexOf(item) + 1 }}</th>
<td class="text-start">{{ item.url }}</td>
<td>{{ item.text }}</td>
<td>{{ item.createdAt | date:'yyyy-mm-dd HH:mm' }}</td>
<td>{{ item.updatedAt | date:'yyyy-mm-dd HH:mm' }}</td>
</tr>
</tbody>
</table>
</tbody>
</table>
</div>
4 changes: 2 additions & 2 deletions crawler-frontend/src/app/crawler/crawler.component.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div class="container mt-5">
<div class="container-fluid mt-5">
<div class="row justify-content-center text-center">
<div class="col-md-8 shadow-sm mb-5 pt-3 pb-2">
<div id="crawler-control-holder" class="col-md-8 shadow-sm mb-5 pt-3 pb-2">
<crawler-control
[selectedCrawler]="selectedCrawler"
[shouldDisableCrawlerControl]="shouldDisableCrawlerControl"
Expand Down
13 changes: 13 additions & 0 deletions crawler-frontend/src/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,23 @@
cursor: pointer;
}

#crawler-control-holder {
max-width: 900px;

// Submit button
button[type="submit"] {
max-width: 379px;
}
}

crawler-display, crawler-display-index {
tr:hover {
td, th {
background-color: var(--bs-gray-100);
}
}
}

.container-fluid {
max-width: 2000px;
}

0 comments on commit 4c5570c

Please sign in to comment.