Skip to content

Commit

Permalink
Merge pull request #135 from Kovah/dev
Browse files Browse the repository at this point in the history
v0.0.39
  • Loading branch information
Kovah committed Jul 2, 2020
2 parents 7d270b9 + 4eab088 commit 9fbabc3
Show file tree
Hide file tree
Showing 103 changed files with 11,084 additions and 8,560 deletions.
4 changes: 2 additions & 2 deletions .github/FUNDING.yml
@@ -1,8 +1,8 @@
# These are supported funding model platforms

github: kovah # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
patreon: Kovah # Replace with a single Patreon username
open_collective: linkace # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
@@ -1,9 +1,11 @@
/node_modules
/logs
/public/hot
/public/storage
/public/mix-manifest.json
/resources/lang/vendor
/storage/*.key
/tests/Controller/logs
/vendor
/.idea
/.tmp
Expand Down
46 changes: 22 additions & 24 deletions README.md
Expand Up @@ -20,7 +20,7 @@
### Contents

* [About LinkAce](#about-linkace)
* [Support Disclaimer](#warning-support-for-linkace)
* [Support Disclaimer](#bulb-support-for-linkace)
* [Setup](#gear-setup)
* [Setup with Docker](#setup-with-docker)
* [Setup without Docker](#setup-without-docker)
Expand All @@ -40,17 +40,17 @@ actual needs which other bookmark managers couldn't solve, even if most features

#### Features

* Bookmark links with automatic title and description generation
* Automated link checks to make sure your bookmarks stay available
* Automated “backups” of your bookmarks via the Waybackmachine
* Organize bookmarks in lists and tags
* A bookmarklet to quickly save links from any browser
* Private or public links, so friends or internet strangers can see your collection
* Add notes to links to add thoughts
* Advanced search including different filters and ordering
* Import existing bookmarks from HTML exports (other methods planned)
* Support for complete database and app backups to Amazon AWS S3
* A built-in light and dark color scheme
* Save links with automatic title and description generation.
* Automated link checks to make sure your bookmarks stay available.
* Automated “backups” of your bookmarks via the Waybackmachine.
* Organize bookmarks in lists and tags.
* A bookmarklet to quickly save links from any browser.
* Private or public links, so friends or internet strangers can see your collection.
* Add notes to links to add thoughts or other information.
* Advanced search including different filters and ordering.
* Import existing bookmarks from HTML exports (other methods planned).
* Support for complete database and app backups to Amazon AWS S3.
* A built-in light and dark color scheme.

More features are already planned. Take a look at the [project board](https://github.com/Kovah/LinkAce/projects/1)
for more information.
Expand All @@ -65,27 +65,25 @@ to share your ideas, talk with other users or find help for specific problems.
---


### :warning: Support for LinkAce
### :bulb: Support for LinkAce

LinkAce is my personal freetime project. I do not offer any sort of granted support for it. I do not offer any paid
support or customization. I do not assist with installing it on your server. If I answer your questions in the
community forum or on Github, it's my free time I spend on your issue. Be respectful.
Free support is highly limited for all my free tools, including LinkAce. If you need help please visit the
[community forum](https://spectrum.chat/linkace/) and post your issue there. I do not offer free personal
support via chat or email.
Please notice that LinkAce has specific requirements to run correctly.

If you need an app with extensive support please consider using a commercial solution.

If you need help or want to report a bug within the application, please open a new [issue](https://github.com/Kovah/LinkAce/issues)
and describe:

* which version you are using,
* what your exact problem is,
* and what you already did to solve the problem.
If you need prioritized support you can **become a [Patreon](https://www.patreon.com/Kovah)**
or **[Github Sponsor](https://github.com/sponsors/Kovah)**. :star:


---


### :gear: Setup

Please check if your server supports the [requirements](https://www.linkace.org/docs/v1/setup/) before starting the
setup.

#### Setup with Docker

Working with Docker is pretty straight forward. The image available on Docker Hub contains the application code, any
Expand Down
32 changes: 32 additions & 0 deletions app/Http/Controllers/API/LinkCheckController.php
@@ -0,0 +1,32 @@
<?php

namespace App\Http\Controllers\API;

use App\Http\Controllers\Controller;
use App\Models\Link;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;

class LinkCheckController extends Controller
{
/**
* Search for a link based on a given url.
*
* @param Request $request
* @return JsonResponse
*/
public function __invoke(Request $request): JsonResponse
{
$searchedUrl = $request->input('url', false);

if (!$searchedUrl) {
return response()->json(['linksFound' => false]);
}

$linkCount = Link::byUser($request->user()->id)
->where('url', trim($searchedUrl))
->count();

return response()->json(['linksFound' => $linkCount > 0]);
}
}
96 changes: 96 additions & 0 deletions app/Http/Controllers/API/LinkController.php
@@ -0,0 +1,96 @@
<?php

namespace App\Http\Controllers\API;

use App\Http\Controllers\Controller;
use App\Http\Requests\Models\LinkDeleteRequest;
use App\Http\Requests\Models\LinkStoreRequest;
use App\Http\Requests\Models\LinkUpdateRequest;
use App\Models\Link;
use App\Repositories\LinkRepository;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Illuminate\Http\Response;

class LinkController extends Controller
{
/**
* Display a listing of the resource.
*
* @param Request $request
* @return JsonResponse
*/
public function index(Request $request): JsonResponse
{
$links = Link::byUser(auth()->id())
->orderBy(
$request->input('order_by', 'created_at'),
$request->input('order_dir', 'DESC')
)
->paginate(getPaginationLimit());

return response()->json($links);
}

/**
* Store a newly created resource in storage.
*
* @param LinkStoreRequest $request
* @return JsonResponse
*/
public function store(LinkStoreRequest $request): JsonResponse
{
$link = LinkRepository::create($request->all());

return response()->json($link);
}

/**
* Display the specified resource.
*
* @param int $id
* @return JsonResponse
*/
public function show($id): JsonResponse
{
$link = Link::with(['lists', 'tags'])->findOrFail($id);

return response()->json($link);
}

/**
* Update the specified resource in storage.
*
* @param LinkUpdateRequest $request
* @param int $id
* @return JsonResponse
*/
public function update(LinkUpdateRequest $request, $id): JsonResponse
{
$link = Link::findOrFail($id);

$updatedLink = LinkRepository::update($link, $request->all());

return response()->json($updatedLink);
}

/**
* Remove the specified resource from storage.
*
* @param LinkDeleteRequest $request
* @param int $id
* @return JsonResponse
*/
public function destroy(LinkDeleteRequest $request, $id): JsonResponse
{
$link = Link::findOrFail($id);

$deletionSuccessfull = LinkRepository::delete($link);

if ($deletionSuccessfull) {
return response()->json(null, Response::HTTP_OK);
}

return response()->json(null, Response::HTTP_INTERNAL_SERVER_ERROR);
}
}
25 changes: 25 additions & 0 deletions app/Http/Controllers/API/LinkNotesController.php
@@ -0,0 +1,25 @@
<?php

namespace App\Http\Controllers\API;

use App\Http\Controllers\Controller;
use App\Models\Link;
use Illuminate\Http\JsonResponse;

class LinkNotesController extends Controller
{
/**
* Get the notes for a specific link.
*
* @param $linkID
* @return JsonResponse
*/
public function __invoke($linkID): JsonResponse
{
$link = Link::findOrFail($linkID);

$notes = $link->notes()->paginate(getPaginationLimit());

return response()->json($notes);
}
}
98 changes: 98 additions & 0 deletions app/Http/Controllers/API/ListController.php
@@ -0,0 +1,98 @@
<?php

namespace App\Http\Controllers\API;

use App\Http\Controllers\Controller;
use App\Http\Requests\Models\ListDeleteRequest;
use App\Http\Requests\Models\ListStoreRequest;
use App\Http\Requests\Models\ListUpdateRequest;
use App\Models\LinkList;
use App\Repositories\ListRepository;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Illuminate\Http\Response;

class ListController extends Controller
{
/**
* Display a listing of the resource.
*
* @param Request $request
* @return JsonResponse
*/
public function index(Request $request): JsonResponse
{
$lists = LinkList::byUser(auth()->id())
->orderBy(
$request->input('order_by', 'created_at'),
$request->input('order_dir', 'DESC')
)
->paginate(getPaginationLimit());

return response()->json($lists);
}

/**
* Store a newly created resource in storage.
*
* @param ListStoreRequest $request
* @return JsonResponse
*/
public function store(ListStoreRequest $request): JsonResponse
{
$link = ListRepository::create($request->all());

return response()->json($link);
}

/**
* Display the specified resource.
*
* @param int $id
* @return JsonResponse
*/
public function show($id): JsonResponse
{
$list = LinkList::findOrFail($id);

$list->links = route('api.lists.links', [$id], true);

return response()->json($list);
}

/**
* Update the specified resource in storage.
*
* @param ListUpdateRequest $request
* @param int $id
* @return JsonResponse
*/
public function update(ListUpdateRequest $request, $id): JsonResponse
{
$list = LinkList::findOrFail($id);

$updatedList = ListRepository::update($list, $request->all());

return response()->json($updatedList);
}

/**
* Remove the specified resource from storage.
*
* @param ListDeleteRequest $request
* @param int $id
* @return JsonResponse
*/
public function destroy(ListDeleteRequest $request, $id): JsonResponse
{
$list = LinkList::findOrFail($id);

$deletionSuccessfull = ListRepository::delete($list);

if ($deletionSuccessfull) {
return response()->json(null, Response::HTTP_OK);
}

return response()->json(null, Response::HTTP_INTERNAL_SERVER_ERROR);
}
}
25 changes: 25 additions & 0 deletions app/Http/Controllers/API/ListLinksController.php
@@ -0,0 +1,25 @@
<?php

namespace App\Http\Controllers\API;

use App\Http\Controllers\Controller;
use App\Models\LinkList;
use Illuminate\Http\JsonResponse;

class ListLinksController extends Controller
{
/**
* Get the links for a specific list.
*
* @param $listID
* @return JsonResponse
*/
public function __invoke($listID): JsonResponse
{
$list = LinkList::findOrFail($listID);

$links = $list->links()->paginate(getPaginationLimit());

return response()->json($links);
}
}

0 comments on commit 9fbabc3

Please sign in to comment.