init gitbiome
This commit is contained in:
@@ -0,0 +1,39 @@
|
|||||||
|
module.exports = {
|
||||||
|
parser: '@typescript-eslint/parser',
|
||||||
|
parserOptions: {
|
||||||
|
project: true,
|
||||||
|
},
|
||||||
|
plugins: ['@typescript-eslint'],
|
||||||
|
extends: [
|
||||||
|
'plugin:@next/next/recommended',
|
||||||
|
'plugin:@typescript-eslint/recommended-type-checked',
|
||||||
|
'plugin:@typescript-eslint/stylistic-type-checked',
|
||||||
|
],
|
||||||
|
ignorePatterns: ['.eslintrc.js'],
|
||||||
|
rules: {
|
||||||
|
'@typescript@typescript-eslint/array-type': 'off',
|
||||||
|
'@typescript-eslint/no-namespace': 'off',
|
||||||
|
'@typescript-eslint/no-empty-interface': 'off',
|
||||||
|
'@typescript-eslint/consistent-type-definitions': 'off',
|
||||||
|
'@typescript-eslint/consistent-type-imports': [
|
||||||
|
'warn',
|
||||||
|
{
|
||||||
|
prefer: 'type-imports',
|
||||||
|
fixStyle: 'inline-type-imports',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
'@typescript-eslint/no-unused-vars': [
|
||||||
|
'warn',
|
||||||
|
{
|
||||||
|
argsIgnorePattern: '^_',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
'@typescript-eslint/require-await': 'off',
|
||||||
|
'@typescript-eslint/no-misused-promises': [
|
||||||
|
'error',
|
||||||
|
{
|
||||||
|
checksVoidReturn: { attributes: false },
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
}
|
||||||
+38
@@ -0,0 +1,38 @@
|
|||||||
|
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
|
||||||
|
|
||||||
|
# dependencies
|
||||||
|
/node_modules
|
||||||
|
/.pnp
|
||||||
|
.pnp.js
|
||||||
|
.yarn/install-state.gz
|
||||||
|
pnpm-lock.yaml
|
||||||
|
bun.lockb
|
||||||
|
|
||||||
|
# testing
|
||||||
|
/coverage
|
||||||
|
|
||||||
|
# next.js
|
||||||
|
/.next/
|
||||||
|
/out/
|
||||||
|
|
||||||
|
# production
|
||||||
|
/build
|
||||||
|
|
||||||
|
# misc
|
||||||
|
.DS_Store
|
||||||
|
*.pem
|
||||||
|
|
||||||
|
# debug
|
||||||
|
npm-debug.log*
|
||||||
|
yarn-debug.log*
|
||||||
|
yarn-error.log*
|
||||||
|
|
||||||
|
# local env files
|
||||||
|
.env**
|
||||||
|
|
||||||
|
# vercel
|
||||||
|
.vercel
|
||||||
|
|
||||||
|
# typescript
|
||||||
|
*.tsbuildinfo
|
||||||
|
next-env.d.ts
|
||||||
@@ -0,0 +1,674 @@
|
|||||||
|
GNU GENERAL PUBLIC LICENSE
|
||||||
|
Version 3, 29 June 2007
|
||||||
|
|
||||||
|
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
||||||
|
Everyone is permitted to copy and distribute verbatim copies
|
||||||
|
of this license document, but changing it is not allowed.
|
||||||
|
|
||||||
|
Preamble
|
||||||
|
|
||||||
|
The GNU General Public License is a free, copyleft license for
|
||||||
|
software and other kinds of works.
|
||||||
|
|
||||||
|
The licenses for most software and other practical works are designed
|
||||||
|
to take away your freedom to share and change the works. By contrast,
|
||||||
|
the GNU General Public License is intended to guarantee your freedom to
|
||||||
|
share and change all versions of a program--to make sure it remains free
|
||||||
|
software for all its users. We, the Free Software Foundation, use the
|
||||||
|
GNU General Public License for most of our software; it applies also to
|
||||||
|
any other work released this way by its authors. You can apply it to
|
||||||
|
your programs, too.
|
||||||
|
|
||||||
|
When we speak of free software, we are referring to freedom, not
|
||||||
|
price. Our General Public Licenses are designed to make sure that you
|
||||||
|
have the freedom to distribute copies of free software (and charge for
|
||||||
|
them if you wish), that you receive source code or can get it if you
|
||||||
|
want it, that you can change the software or use pieces of it in new
|
||||||
|
free programs, and that you know you can do these things.
|
||||||
|
|
||||||
|
To protect your rights, we need to prevent others from denying you
|
||||||
|
these rights or asking you to surrender the rights. Therefore, you have
|
||||||
|
certain responsibilities if you distribute copies of the software, or if
|
||||||
|
you modify it: responsibilities to respect the freedom of others.
|
||||||
|
|
||||||
|
For example, if you distribute copies of such a program, whether
|
||||||
|
gratis or for a fee, you must pass on to the recipients the same
|
||||||
|
freedoms that you received. You must make sure that they, too, receive
|
||||||
|
or can get the source code. And you must show them these terms so they
|
||||||
|
know their rights.
|
||||||
|
|
||||||
|
Developers that use the GNU GPL protect your rights with two steps:
|
||||||
|
(1) assert copyright on the software, and (2) offer you this License
|
||||||
|
giving you legal permission to copy, distribute and/or modify it.
|
||||||
|
|
||||||
|
For the developers' and authors' protection, the GPL clearly explains
|
||||||
|
that there is no warranty for this free software. For both users' and
|
||||||
|
authors' sake, the GPL requires that modified versions be marked as
|
||||||
|
changed, so that their problems will not be attributed erroneously to
|
||||||
|
authors of previous versions.
|
||||||
|
|
||||||
|
Some devices are designed to deny users access to install or run
|
||||||
|
modified versions of the software inside them, although the manufacturer
|
||||||
|
can do so. This is fundamentally incompatible with the aim of
|
||||||
|
protecting users' freedom to change the software. The systematic
|
||||||
|
pattern of such abuse occurs in the area of products for individuals to
|
||||||
|
use, which is precisely where it is most unacceptable. Therefore, we
|
||||||
|
have designed this version of the GPL to prohibit the practice for those
|
||||||
|
products. If such problems arise substantially in other domains, we
|
||||||
|
stand ready to extend this provision to those domains in future versions
|
||||||
|
of the GPL, as needed to protect the freedom of users.
|
||||||
|
|
||||||
|
Finally, every program is threatened constantly by software patents.
|
||||||
|
States should not allow patents to restrict development and use of
|
||||||
|
software on general-purpose computers, but in those that do, we wish to
|
||||||
|
avoid the special danger that patents applied to a free program could
|
||||||
|
make it effectively proprietary. To prevent this, the GPL assures that
|
||||||
|
patents cannot be used to render the program non-free.
|
||||||
|
|
||||||
|
The precise terms and conditions for copying, distribution and
|
||||||
|
modification follow.
|
||||||
|
|
||||||
|
TERMS AND CONDITIONS
|
||||||
|
|
||||||
|
0. Definitions.
|
||||||
|
|
||||||
|
"This License" refers to version 3 of the GNU General Public License.
|
||||||
|
|
||||||
|
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||||
|
works, such as semiconductor masks.
|
||||||
|
|
||||||
|
"The Program" refers to any copyrightable work licensed under this
|
||||||
|
License. Each licensee is addressed as "you". "Licensees" and
|
||||||
|
"recipients" may be individuals or organizations.
|
||||||
|
|
||||||
|
To "modify" a work means to copy from or adapt all or part of the work
|
||||||
|
in a fashion requiring copyright permission, other than the making of an
|
||||||
|
exact copy. The resulting work is called a "modified version" of the
|
||||||
|
earlier work or a work "based on" the earlier work.
|
||||||
|
|
||||||
|
A "covered work" means either the unmodified Program or a work based
|
||||||
|
on the Program.
|
||||||
|
|
||||||
|
To "propagate" a work means to do anything with it that, without
|
||||||
|
permission, would make you directly or secondarily liable for
|
||||||
|
infringement under applicable copyright law, except executing it on a
|
||||||
|
computer or modifying a private copy. Propagation includes copying,
|
||||||
|
distribution (with or without modification), making available to the
|
||||||
|
public, and in some countries other activities as well.
|
||||||
|
|
||||||
|
To "convey" a work means any kind of propagation that enables other
|
||||||
|
parties to make or receive copies. Mere interaction with a user through
|
||||||
|
a computer network, with no transfer of a copy, is not conveying.
|
||||||
|
|
||||||
|
An interactive user interface displays "Appropriate Legal Notices"
|
||||||
|
to the extent that it includes a convenient and prominently visible
|
||||||
|
feature that (1) displays an appropriate copyright notice, and (2)
|
||||||
|
tells the user that there is no warranty for the work (except to the
|
||||||
|
extent that warranties are provided), that licensees may convey the
|
||||||
|
work under this License, and how to view a copy of this License. If
|
||||||
|
the interface presents a list of user commands or options, such as a
|
||||||
|
menu, a prominent item in the list meets this criterion.
|
||||||
|
|
||||||
|
1. Source Code.
|
||||||
|
|
||||||
|
The "source code" for a work means the preferred form of the work
|
||||||
|
for making modifications to it. "Object code" means any non-source
|
||||||
|
form of a work.
|
||||||
|
|
||||||
|
A "Standard Interface" means an interface that either is an official
|
||||||
|
standard defined by a recognized standards body, or, in the case of
|
||||||
|
interfaces specified for a particular programming language, one that
|
||||||
|
is widely used among developers working in that language.
|
||||||
|
|
||||||
|
The "System Libraries" of an executable work include anything, other
|
||||||
|
than the work as a whole, that (a) is included in the normal form of
|
||||||
|
packaging a Major Component, but which is not part of that Major
|
||||||
|
Component, and (b) serves only to enable use of the work with that
|
||||||
|
Major Component, or to implement a Standard Interface for which an
|
||||||
|
implementation is available to the public in source code form. A
|
||||||
|
"Major Component", in this context, means a major essential component
|
||||||
|
(kernel, window system, and so on) of the specific operating system
|
||||||
|
(if any) on which the executable work runs, or a compiler used to
|
||||||
|
produce the work, or an object code interpreter used to run it.
|
||||||
|
|
||||||
|
The "Corresponding Source" for a work in object code form means all
|
||||||
|
the source code needed to generate, install, and (for an executable
|
||||||
|
work) run the object code and to modify the work, including scripts to
|
||||||
|
control those activities. However, it does not include the work's
|
||||||
|
System Libraries, or general-purpose tools or generally available free
|
||||||
|
programs which are used unmodified in performing those activities but
|
||||||
|
which are not part of the work. For example, Corresponding Source
|
||||||
|
includes interface definition files associated with source files for
|
||||||
|
the work, and the source code for shared libraries and dynamically
|
||||||
|
linked subprograms that the work is specifically designed to require,
|
||||||
|
such as by intimate data communication or control flow between those
|
||||||
|
subprograms and other parts of the work.
|
||||||
|
|
||||||
|
The Corresponding Source need not include anything that users
|
||||||
|
can regenerate automatically from other parts of the Corresponding
|
||||||
|
Source.
|
||||||
|
|
||||||
|
The Corresponding Source for a work in source code form is that
|
||||||
|
same work.
|
||||||
|
|
||||||
|
2. Basic Permissions.
|
||||||
|
|
||||||
|
All rights granted under this License are granted for the term of
|
||||||
|
copyright on the Program, and are irrevocable provided the stated
|
||||||
|
conditions are met. This License explicitly affirms your unlimited
|
||||||
|
permission to run the unmodified Program. The output from running a
|
||||||
|
covered work is covered by this License only if the output, given its
|
||||||
|
content, constitutes a covered work. This License acknowledges your
|
||||||
|
rights of fair use or other equivalent, as provided by copyright law.
|
||||||
|
|
||||||
|
You may make, run and propagate covered works that you do not
|
||||||
|
convey, without conditions so long as your license otherwise remains
|
||||||
|
in force. You may convey covered works to others for the sole purpose
|
||||||
|
of having them make modifications exclusively for you, or provide you
|
||||||
|
with facilities for running those works, provided that you comply with
|
||||||
|
the terms of this License in conveying all material for which you do
|
||||||
|
not control copyright. Those thus making or running the covered works
|
||||||
|
for you must do so exclusively on your behalf, under your direction
|
||||||
|
and control, on terms that prohibit them from making any copies of
|
||||||
|
your copyrighted material outside their relationship with you.
|
||||||
|
|
||||||
|
Conveying under any other circumstances is permitted solely under
|
||||||
|
the conditions stated below. Sublicensing is not allowed; section 10
|
||||||
|
makes it unnecessary.
|
||||||
|
|
||||||
|
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||||
|
|
||||||
|
No covered work shall be deemed part of an effective technological
|
||||||
|
measure under any applicable law fulfilling obligations under article
|
||||||
|
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||||
|
similar laws prohibiting or restricting circumvention of such
|
||||||
|
measures.
|
||||||
|
|
||||||
|
When you convey a covered work, you waive any legal power to forbid
|
||||||
|
circumvention of technological measures to the extent such circumvention
|
||||||
|
is effected by exercising rights under this License with respect to
|
||||||
|
the covered work, and you disclaim any intention to limit operation or
|
||||||
|
modification of the work as a means of enforcing, against the work's
|
||||||
|
users, your or third parties' legal rights to forbid circumvention of
|
||||||
|
technological measures.
|
||||||
|
|
||||||
|
4. Conveying Verbatim Copies.
|
||||||
|
|
||||||
|
You may convey verbatim copies of the Program's source code as you
|
||||||
|
receive it, in any medium, provided that you conspicuously and
|
||||||
|
appropriately publish on each copy an appropriate copyright notice;
|
||||||
|
keep intact all notices stating that this License and any
|
||||||
|
non-permissive terms added in accord with section 7 apply to the code;
|
||||||
|
keep intact all notices of the absence of any warranty; and give all
|
||||||
|
recipients a copy of this License along with the Program.
|
||||||
|
|
||||||
|
You may charge any price or no price for each copy that you convey,
|
||||||
|
and you may offer support or warranty protection for a fee.
|
||||||
|
|
||||||
|
5. Conveying Modified Source Versions.
|
||||||
|
|
||||||
|
You may convey a work based on the Program, or the modifications to
|
||||||
|
produce it from the Program, in the form of source code under the
|
||||||
|
terms of section 4, provided that you also meet all of these conditions:
|
||||||
|
|
||||||
|
a) The work must carry prominent notices stating that you modified
|
||||||
|
it, and giving a relevant date.
|
||||||
|
|
||||||
|
b) The work must carry prominent notices stating that it is
|
||||||
|
released under this License and any conditions added under section
|
||||||
|
7. This requirement modifies the requirement in section 4 to
|
||||||
|
"keep intact all notices".
|
||||||
|
|
||||||
|
c) You must license the entire work, as a whole, under this
|
||||||
|
License to anyone who comes into possession of a copy. This
|
||||||
|
License will therefore apply, along with any applicable section 7
|
||||||
|
additional terms, to the whole of the work, and all its parts,
|
||||||
|
regardless of how they are packaged. This License gives no
|
||||||
|
permission to license the work in any other way, but it does not
|
||||||
|
invalidate such permission if you have separately received it.
|
||||||
|
|
||||||
|
d) If the work has interactive user interfaces, each must display
|
||||||
|
Appropriate Legal Notices; however, if the Program has interactive
|
||||||
|
interfaces that do not display Appropriate Legal Notices, your
|
||||||
|
work need not make them do so.
|
||||||
|
|
||||||
|
A compilation of a covered work with other separate and independent
|
||||||
|
works, which are not by their nature extensions of the covered work,
|
||||||
|
and which are not combined with it such as to form a larger program,
|
||||||
|
in or on a volume of a storage or distribution medium, is called an
|
||||||
|
"aggregate" if the compilation and its resulting copyright are not
|
||||||
|
used to limit the access or legal rights of the compilation's users
|
||||||
|
beyond what the individual works permit. Inclusion of a covered work
|
||||||
|
in an aggregate does not cause this License to apply to the other
|
||||||
|
parts of the aggregate.
|
||||||
|
|
||||||
|
6. Conveying Non-Source Forms.
|
||||||
|
|
||||||
|
You may convey a covered work in object code form under the terms
|
||||||
|
of sections 4 and 5, provided that you also convey the
|
||||||
|
machine-readable Corresponding Source under the terms of this License,
|
||||||
|
in one of these ways:
|
||||||
|
|
||||||
|
a) Convey the object code in, or embodied in, a physical product
|
||||||
|
(including a physical distribution medium), accompanied by the
|
||||||
|
Corresponding Source fixed on a durable physical medium
|
||||||
|
customarily used for software interchange.
|
||||||
|
|
||||||
|
b) Convey the object code in, or embodied in, a physical product
|
||||||
|
(including a physical distribution medium), accompanied by a
|
||||||
|
written offer, valid for at least three years and valid for as
|
||||||
|
long as you offer spare parts or customer support for that product
|
||||||
|
model, to give anyone who possesses the object code either (1) a
|
||||||
|
copy of the Corresponding Source for all the software in the
|
||||||
|
product that is covered by this License, on a durable physical
|
||||||
|
medium customarily used for software interchange, for a price no
|
||||||
|
more than your reasonable cost of physically performing this
|
||||||
|
conveying of source, or (2) access to copy the
|
||||||
|
Corresponding Source from a network server at no charge.
|
||||||
|
|
||||||
|
c) Convey individual copies of the object code with a copy of the
|
||||||
|
written offer to provide the Corresponding Source. This
|
||||||
|
alternative is allowed only occasionally and noncommercially, and
|
||||||
|
only if you received the object code with such an offer, in accord
|
||||||
|
with subsection 6b.
|
||||||
|
|
||||||
|
d) Convey the object code by offering access from a designated
|
||||||
|
place (gratis or for a charge), and offer equivalent access to the
|
||||||
|
Corresponding Source in the same way through the same place at no
|
||||||
|
further charge. You need not require recipients to copy the
|
||||||
|
Corresponding Source along with the object code. If the place to
|
||||||
|
copy the object code is a network server, the Corresponding Source
|
||||||
|
may be on a different server (operated by you or a third party)
|
||||||
|
that supports equivalent copying facilities, provided you maintain
|
||||||
|
clear directions next to the object code saying where to find the
|
||||||
|
Corresponding Source. Regardless of what server hosts the
|
||||||
|
Corresponding Source, you remain obligated to ensure that it is
|
||||||
|
available for as long as needed to satisfy these requirements.
|
||||||
|
|
||||||
|
e) Convey the object code using peer-to-peer transmission, provided
|
||||||
|
you inform other peers where the object code and Corresponding
|
||||||
|
Source of the work are being offered to the general public at no
|
||||||
|
charge under subsection 6d.
|
||||||
|
|
||||||
|
A separable portion of the object code, whose source code is excluded
|
||||||
|
from the Corresponding Source as a System Library, need not be
|
||||||
|
included in conveying the object code work.
|
||||||
|
|
||||||
|
A "User Product" is either (1) a "consumer product", which means any
|
||||||
|
tangible personal property which is normally used for personal, family,
|
||||||
|
or household purposes, or (2) anything designed or sold for incorporation
|
||||||
|
into a dwelling. In determining whether a product is a consumer product,
|
||||||
|
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||||
|
product received by a particular user, "normally used" refers to a
|
||||||
|
typical or common use of that class of product, regardless of the status
|
||||||
|
of the particular user or of the way in which the particular user
|
||||||
|
actually uses, or expects or is expected to use, the product. A product
|
||||||
|
is a consumer product regardless of whether the product has substantial
|
||||||
|
commercial, industrial or non-consumer uses, unless such uses represent
|
||||||
|
the only significant mode of use of the product.
|
||||||
|
|
||||||
|
"Installation Information" for a User Product means any methods,
|
||||||
|
procedures, authorization keys, or other information required to install
|
||||||
|
and execute modified versions of a covered work in that User Product from
|
||||||
|
a modified version of its Corresponding Source. The information must
|
||||||
|
suffice to ensure that the continued functioning of the modified object
|
||||||
|
code is in no case prevented or interfered with solely because
|
||||||
|
modification has been made.
|
||||||
|
|
||||||
|
If you convey an object code work under this section in, or with, or
|
||||||
|
specifically for use in, a User Product, and the conveying occurs as
|
||||||
|
part of a transaction in which the right of possession and use of the
|
||||||
|
User Product is transferred to the recipient in perpetuity or for a
|
||||||
|
fixed term (regardless of how the transaction is characterized), the
|
||||||
|
Corresponding Source conveyed under this section must be accompanied
|
||||||
|
by the Installation Information. But this requirement does not apply
|
||||||
|
if neither you nor any third party retains the ability to install
|
||||||
|
modified object code on the User Product (for example, the work has
|
||||||
|
been installed in ROM).
|
||||||
|
|
||||||
|
The requirement to provide Installation Information does not include a
|
||||||
|
requirement to continue to provide support service, warranty, or updates
|
||||||
|
for a work that has been modified or installed by the recipient, or for
|
||||||
|
the User Product in which it has been modified or installed. Access to a
|
||||||
|
network may be denied when the modification itself materially and
|
||||||
|
adversely affects the operation of the network or violates the rules and
|
||||||
|
protocols for communication across the network.
|
||||||
|
|
||||||
|
Corresponding Source conveyed, and Installation Information provided,
|
||||||
|
in accord with this section must be in a format that is publicly
|
||||||
|
documented (and with an implementation available to the public in
|
||||||
|
source code form), and must require no special password or key for
|
||||||
|
unpacking, reading or copying.
|
||||||
|
|
||||||
|
7. Additional Terms.
|
||||||
|
|
||||||
|
"Additional permissions" are terms that supplement the terms of this
|
||||||
|
License by making exceptions from one or more of its conditions.
|
||||||
|
Additional permissions that are applicable to the entire Program shall
|
||||||
|
be treated as though they were included in this License, to the extent
|
||||||
|
that they are valid under applicable law. If additional permissions
|
||||||
|
apply only to part of the Program, that part may be used separately
|
||||||
|
under those permissions, but the entire Program remains governed by
|
||||||
|
this License without regard to the additional permissions.
|
||||||
|
|
||||||
|
When you convey a copy of a covered work, you may at your option
|
||||||
|
remove any additional permissions from that copy, or from any part of
|
||||||
|
it. (Additional permissions may be written to require their own
|
||||||
|
removal in certain cases when you modify the work.) You may place
|
||||||
|
additional permissions on material, added by you to a covered work,
|
||||||
|
for which you have or can give appropriate copyright permission.
|
||||||
|
|
||||||
|
Notwithstanding any other provision of this License, for material you
|
||||||
|
add to a covered work, you may (if authorized by the copyright holders of
|
||||||
|
that material) supplement the terms of this License with terms:
|
||||||
|
|
||||||
|
a) Disclaiming warranty or limiting liability differently from the
|
||||||
|
terms of sections 15 and 16 of this License; or
|
||||||
|
|
||||||
|
b) Requiring preservation of specified reasonable legal notices or
|
||||||
|
author attributions in that material or in the Appropriate Legal
|
||||||
|
Notices displayed by works containing it; or
|
||||||
|
|
||||||
|
c) Prohibiting misrepresentation of the origin of that material, or
|
||||||
|
requiring that modified versions of such material be marked in
|
||||||
|
reasonable ways as different from the original version; or
|
||||||
|
|
||||||
|
d) Limiting the use for publicity purposes of names of licensors or
|
||||||
|
authors of the material; or
|
||||||
|
|
||||||
|
e) Declining to grant rights under trademark law for use of some
|
||||||
|
trade names, trademarks, or service marks; or
|
||||||
|
|
||||||
|
f) Requiring indemnification of licensors and authors of that
|
||||||
|
material by anyone who conveys the material (or modified versions of
|
||||||
|
it) with contractual assumptions of liability to the recipient, for
|
||||||
|
any liability that these contractual assumptions directly impose on
|
||||||
|
those licensors and authors.
|
||||||
|
|
||||||
|
All other non-permissive additional terms are considered "further
|
||||||
|
restrictions" within the meaning of section 10. If the Program as you
|
||||||
|
received it, or any part of it, contains a notice stating that it is
|
||||||
|
governed by this License along with a term that is a further
|
||||||
|
restriction, you may remove that term. If a license document contains
|
||||||
|
a further restriction but permits relicensing or conveying under this
|
||||||
|
License, you may add to a covered work material governed by the terms
|
||||||
|
of that license document, provided that the further restriction does
|
||||||
|
not survive such relicensing or conveying.
|
||||||
|
|
||||||
|
If you add terms to a covered work in accord with this section, you
|
||||||
|
must place, in the relevant source files, a statement of the
|
||||||
|
additional terms that apply to those files, or a notice indicating
|
||||||
|
where to find the applicable terms.
|
||||||
|
|
||||||
|
Additional terms, permissive or non-permissive, may be stated in the
|
||||||
|
form of a separately written license, or stated as exceptions;
|
||||||
|
the above requirements apply either way.
|
||||||
|
|
||||||
|
8. Termination.
|
||||||
|
|
||||||
|
You may not propagate or modify a covered work except as expressly
|
||||||
|
provided under this License. Any attempt otherwise to propagate or
|
||||||
|
modify it is void, and will automatically terminate your rights under
|
||||||
|
this License (including any patent licenses granted under the third
|
||||||
|
paragraph of section 11).
|
||||||
|
|
||||||
|
However, if you cease all violation of this License, then your
|
||||||
|
license from a particular copyright holder is reinstated (a)
|
||||||
|
provisionally, unless and until the copyright holder explicitly and
|
||||||
|
finally terminates your license, and (b) permanently, if the copyright
|
||||||
|
holder fails to notify you of the violation by some reasonable means
|
||||||
|
prior to 60 days after the cessation.
|
||||||
|
|
||||||
|
Moreover, your license from a particular copyright holder is
|
||||||
|
reinstated permanently if the copyright holder notifies you of the
|
||||||
|
violation by some reasonable means, this is the first time you have
|
||||||
|
received notice of violation of this License (for any work) from that
|
||||||
|
copyright holder, and you cure the violation prior to 30 days after
|
||||||
|
your receipt of the notice.
|
||||||
|
|
||||||
|
Termination of your rights under this section does not terminate the
|
||||||
|
licenses of parties who have received copies or rights from you under
|
||||||
|
this License. If your rights have been terminated and not permanently
|
||||||
|
reinstated, you do not qualify to receive new licenses for the same
|
||||||
|
material under section 10.
|
||||||
|
|
||||||
|
9. Acceptance Not Required for Having Copies.
|
||||||
|
|
||||||
|
You are not required to accept this License in order to receive or
|
||||||
|
run a copy of the Program. Ancillary propagation of a covered work
|
||||||
|
occurring solely as a consequence of using peer-to-peer transmission
|
||||||
|
to receive a copy likewise does not require acceptance. However,
|
||||||
|
nothing other than this License grants you permission to propagate or
|
||||||
|
modify any covered work. These actions infringe copyright if you do
|
||||||
|
not accept this License. Therefore, by modifying or propagating a
|
||||||
|
covered work, you indicate your acceptance of this License to do so.
|
||||||
|
|
||||||
|
10. Automatic Licensing of Downstream Recipients.
|
||||||
|
|
||||||
|
Each time you convey a covered work, the recipient automatically
|
||||||
|
receives a license from the original licensors, to run, modify and
|
||||||
|
propagate that work, subject to this License. You are not responsible
|
||||||
|
for enforcing compliance by third parties with this License.
|
||||||
|
|
||||||
|
An "entity transaction" is a transaction transferring control of an
|
||||||
|
organization, or substantially all assets of one, or subdividing an
|
||||||
|
organization, or merging organizations. If propagation of a covered
|
||||||
|
work results from an entity transaction, each party to that
|
||||||
|
transaction who receives a copy of the work also receives whatever
|
||||||
|
licenses to the work the party's predecessor in interest had or could
|
||||||
|
give under the previous paragraph, plus a right to possession of the
|
||||||
|
Corresponding Source of the work from the predecessor in interest, if
|
||||||
|
the predecessor has it or can get it with reasonable efforts.
|
||||||
|
|
||||||
|
You may not impose any further restrictions on the exercise of the
|
||||||
|
rights granted or affirmed under this License. For example, you may
|
||||||
|
not impose a license fee, royalty, or other charge for exercise of
|
||||||
|
rights granted under this License, and you may not initiate litigation
|
||||||
|
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||||
|
any patent claim is infringed by making, using, selling, offering for
|
||||||
|
sale, or importing the Program or any portion of it.
|
||||||
|
|
||||||
|
11. Patents.
|
||||||
|
|
||||||
|
A "contributor" is a copyright holder who authorizes use under this
|
||||||
|
License of the Program or a work on which the Program is based. The
|
||||||
|
work thus licensed is called the contributor's "contributor version".
|
||||||
|
|
||||||
|
A contributor's "essential patent claims" are all patent claims
|
||||||
|
owned or controlled by the contributor, whether already acquired or
|
||||||
|
hereafter acquired, that would be infringed by some manner, permitted
|
||||||
|
by this License, of making, using, or selling its contributor version,
|
||||||
|
but do not include claims that would be infringed only as a
|
||||||
|
consequence of further modification of the contributor version. For
|
||||||
|
purposes of this definition, "control" includes the right to grant
|
||||||
|
patent sublicenses in a manner consistent with the requirements of
|
||||||
|
this License.
|
||||||
|
|
||||||
|
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||||
|
patent license under the contributor's essential patent claims, to
|
||||||
|
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||||
|
propagate the contents of its contributor version.
|
||||||
|
|
||||||
|
In the following three paragraphs, a "patent license" is any express
|
||||||
|
agreement or commitment, however denominated, not to enforce a patent
|
||||||
|
(such as an express permission to practice a patent or covenant not to
|
||||||
|
sue for patent infringement). To "grant" such a patent license to a
|
||||||
|
party means to make such an agreement or commitment not to enforce a
|
||||||
|
patent against the party.
|
||||||
|
|
||||||
|
If you convey a covered work, knowingly relying on a patent license,
|
||||||
|
and the Corresponding Source of the work is not available for anyone
|
||||||
|
to copy, free of charge and under the terms of this License, through a
|
||||||
|
publicly available network server or other readily accessible means,
|
||||||
|
then you must either (1) cause the Corresponding Source to be so
|
||||||
|
available, or (2) arrange to deprive yourself of the benefit of the
|
||||||
|
patent license for this particular work, or (3) arrange, in a manner
|
||||||
|
consistent with the requirements of this License, to extend the patent
|
||||||
|
license to downstream recipients. "Knowingly relying" means you have
|
||||||
|
actual knowledge that, but for the patent license, your conveying the
|
||||||
|
covered work in a country, or your recipient's use of the covered work
|
||||||
|
in a country, would infringe one or more identifiable patents in that
|
||||||
|
country that you have reason to believe are valid.
|
||||||
|
|
||||||
|
If, pursuant to or in connection with a single transaction or
|
||||||
|
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||||
|
covered work, and grant a patent license to some of the parties
|
||||||
|
receiving the covered work authorizing them to use, propagate, modify
|
||||||
|
or convey a specific copy of the covered work, then the patent license
|
||||||
|
you grant is automatically extended to all recipients of the covered
|
||||||
|
work and works based on it.
|
||||||
|
|
||||||
|
A patent license is "discriminatory" if it does not include within
|
||||||
|
the scope of its coverage, prohibits the exercise of, or is
|
||||||
|
conditioned on the non-exercise of one or more of the rights that are
|
||||||
|
specifically granted under this License. You may not convey a covered
|
||||||
|
work if you are a party to an arrangement with a third party that is
|
||||||
|
in the business of distributing software, under which you make payment
|
||||||
|
to the third party based on the extent of your activity of conveying
|
||||||
|
the work, and under which the third party grants, to any of the
|
||||||
|
parties who would receive the covered work from you, a discriminatory
|
||||||
|
patent license (a) in connection with copies of the covered work
|
||||||
|
conveyed by you (or copies made from those copies), or (b) primarily
|
||||||
|
for and in connection with specific products or compilations that
|
||||||
|
contain the covered work, unless you entered into that arrangement,
|
||||||
|
or that patent license was granted, prior to 28 March 2007.
|
||||||
|
|
||||||
|
Nothing in this License shall be construed as excluding or limiting
|
||||||
|
any implied license or other defenses to infringement that may
|
||||||
|
otherwise be available to you under applicable patent law.
|
||||||
|
|
||||||
|
12. No Surrender of Others' Freedom.
|
||||||
|
|
||||||
|
If conditions are imposed on you (whether by court order, agreement or
|
||||||
|
otherwise) that contradict the conditions of this License, they do not
|
||||||
|
excuse you from the conditions of this License. If you cannot convey a
|
||||||
|
covered work so as to satisfy simultaneously your obligations under this
|
||||||
|
License and any other pertinent obligations, then as a consequence you may
|
||||||
|
not convey it at all. For example, if you agree to terms that obligate you
|
||||||
|
to collect a royalty for further conveying from those to whom you convey
|
||||||
|
the Program, the only way you could satisfy both those terms and this
|
||||||
|
License would be to refrain entirely from conveying the Program.
|
||||||
|
|
||||||
|
13. Use with the GNU Affero General Public License.
|
||||||
|
|
||||||
|
Notwithstanding any other provision of this License, you have
|
||||||
|
permission to link or combine any covered work with a work licensed
|
||||||
|
under version 3 of the GNU Affero General Public License into a single
|
||||||
|
combined work, and to convey the resulting work. The terms of this
|
||||||
|
License will continue to apply to the part which is the covered work,
|
||||||
|
but the special requirements of the GNU Affero General Public License,
|
||||||
|
section 13, concerning interaction through a network will apply to the
|
||||||
|
combination as such.
|
||||||
|
|
||||||
|
14. Revised Versions of this License.
|
||||||
|
|
||||||
|
The Free Software Foundation may publish revised and/or new versions of
|
||||||
|
the GNU General Public License from time to time. Such new versions will
|
||||||
|
be similar in spirit to the present version, but may differ in detail to
|
||||||
|
address new problems or concerns.
|
||||||
|
|
||||||
|
Each version is given a distinguishing version number. If the
|
||||||
|
Program specifies that a certain numbered version of the GNU General
|
||||||
|
Public License "or any later version" applies to it, you have the
|
||||||
|
option of following the terms and conditions either of that numbered
|
||||||
|
version or of any later version published by the Free Software
|
||||||
|
Foundation. If the Program does not specify a version number of the
|
||||||
|
GNU General Public License, you may choose any version ever published
|
||||||
|
by the Free Software Foundation.
|
||||||
|
|
||||||
|
If the Program specifies that a proxy can decide which future
|
||||||
|
versions of the GNU General Public License can be used, that proxy's
|
||||||
|
public statement of acceptance of a version permanently authorizes you
|
||||||
|
to choose that version for the Program.
|
||||||
|
|
||||||
|
Later license versions may give you additional or different
|
||||||
|
permissions. However, no additional obligations are imposed on any
|
||||||
|
author or copyright holder as a result of your choosing to follow a
|
||||||
|
later version.
|
||||||
|
|
||||||
|
15. Disclaimer of Warranty.
|
||||||
|
|
||||||
|
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||||
|
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||||
|
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||||
|
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||||
|
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||||
|
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||||
|
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||||
|
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||||
|
|
||||||
|
16. Limitation of Liability.
|
||||||
|
|
||||||
|
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||||
|
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||||
|
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||||
|
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||||
|
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||||
|
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||||
|
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||||
|
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||||
|
SUCH DAMAGES.
|
||||||
|
|
||||||
|
17. Interpretation of Sections 15 and 16.
|
||||||
|
|
||||||
|
If the disclaimer of warranty and limitation of liability provided
|
||||||
|
above cannot be given local legal effect according to their terms,
|
||||||
|
reviewing courts shall apply local law that most closely approximates
|
||||||
|
an absolute waiver of all civil liability in connection with the
|
||||||
|
Program, unless a warranty or assumption of liability accompanies a
|
||||||
|
copy of the Program in return for a fee.
|
||||||
|
|
||||||
|
END OF TERMS AND CONDITIONS
|
||||||
|
|
||||||
|
How to Apply These Terms to Your New Programs
|
||||||
|
|
||||||
|
If you develop a new program, and you want it to be of the greatest
|
||||||
|
possible use to the public, the best way to achieve this is to make it
|
||||||
|
free software which everyone can redistribute and change under these terms.
|
||||||
|
|
||||||
|
To do so, attach the following notices to the program. It is safest
|
||||||
|
to attach them to the start of each source file to most effectively
|
||||||
|
state the exclusion of warranty; and each file should have at least
|
||||||
|
the "copyright" line and a pointer to where the full notice is found.
|
||||||
|
|
||||||
|
<one line to give the program's name and a brief idea of what it does.>
|
||||||
|
Copyright (C) <year> <name of author>
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
Also add information on how to contact you by electronic and paper mail.
|
||||||
|
|
||||||
|
If the program does terminal interaction, make it output a short
|
||||||
|
notice like this when it starts in an interactive mode:
|
||||||
|
|
||||||
|
<program> Copyright (C) <year> <name of author>
|
||||||
|
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||||
|
This is free software, and you are welcome to redistribute it
|
||||||
|
under certain conditions; type `show c' for details.
|
||||||
|
|
||||||
|
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||||
|
parts of the General Public License. Of course, your program's commands
|
||||||
|
might be different; for a GUI interface, you would use an "about box".
|
||||||
|
|
||||||
|
You should also get your employer (if you work as a programmer) or school,
|
||||||
|
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||||
|
For more information on this, and how to apply and follow the GNU GPL, see
|
||||||
|
<https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
The GNU General Public License does not permit incorporating your program
|
||||||
|
into proprietary programs. If your program is a subroutine library, you
|
||||||
|
may consider it more useful to permit linking proprietary applications with
|
||||||
|
the library. If this is what you want to do, use the GNU Lesser General
|
||||||
|
Public License instead of this License. But first, please read
|
||||||
|
<https://www.gnu.org/licenses/why-not-lgpl.html>.
|
||||||
@@ -0,0 +1,62 @@
|
|||||||
|
// @ts-check
|
||||||
|
|
||||||
|
const securityHeaders = [
|
||||||
|
{
|
||||||
|
key: 'X-DNS-Prefetch-Control',
|
||||||
|
value: 'on'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'X-XSS-Protection',
|
||||||
|
value: '1; mode=block'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'X-Content-Type-Options',
|
||||||
|
value: 'nosniff'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'Referrer-Policy',
|
||||||
|
value: 'strict-origin'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'Content-Security-Policy',
|
||||||
|
value: `frame-ancestors 'self';`
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'X-Frame-Options',
|
||||||
|
value: 'SAMEORIGIN'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'Strict-Transport-Security',
|
||||||
|
value: 'max-age=31536000; includeSubDomains; preload'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'Permissions-Policy',
|
||||||
|
value: 'camera=(), microphone=(), geolocation=()'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
|
/** @type {import('next').NextConfig} */
|
||||||
|
const nextConfig = {
|
||||||
|
async headers() {
|
||||||
|
return [{
|
||||||
|
source: '/:path*',
|
||||||
|
headers: securityHeaders
|
||||||
|
}
|
||||||
|
]},
|
||||||
|
images: {
|
||||||
|
remotePatterns: [
|
||||||
|
{
|
||||||
|
protocol: 'https',
|
||||||
|
hostname: 'i.scdn.co'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
protocol: 'https',
|
||||||
|
hostname: 'placehold.co'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
reactStrictMode: true,
|
||||||
|
swcMinify: true
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = nextConfig
|
||||||
@@ -0,0 +1,50 @@
|
|||||||
|
{
|
||||||
|
"name": "gitbiome",
|
||||||
|
"version": "0.1.0",
|
||||||
|
"private": true,
|
||||||
|
"scripts": {
|
||||||
|
"dev": "next dev --turbo",
|
||||||
|
"build": "next build",
|
||||||
|
"start": "next start",
|
||||||
|
"lint": "next lint"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"next": "14.2.2",
|
||||||
|
"react": "^18",
|
||||||
|
"react-dom": "^18"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@radix-ui/react-avatar": "^1.0.4",
|
||||||
|
"@radix-ui/react-progress": "^1.0.3",
|
||||||
|
"@radix-ui/react-separator": "^1.0.3",
|
||||||
|
"@radix-ui/react-slot": "^1.0.2",
|
||||||
|
"@radix-ui/react-tooltip": "^1.0.7",
|
||||||
|
"@types/node": "^20",
|
||||||
|
"@types/react": "^18",
|
||||||
|
"@types/react-dom": "^18",
|
||||||
|
"@typescript-eslint/eslint-plugin": "^7.7.1",
|
||||||
|
"@typescript-eslint/parser": "^7.7.1",
|
||||||
|
"@upstash/redis": "^1.31.5",
|
||||||
|
"class-variance-authority": "^0.7.0",
|
||||||
|
"clsx": "^2.1.1",
|
||||||
|
"eslint": "^8",
|
||||||
|
"eslint-config-next": "14.2.2",
|
||||||
|
"eslint-plugin-react": "^7.34.1",
|
||||||
|
"jose": "^5.3.0",
|
||||||
|
"lucide-react": "^0.378.0",
|
||||||
|
"next-themes": "^0.3.0",
|
||||||
|
"postcss": "^8",
|
||||||
|
"react-icons": "^5.1.0",
|
||||||
|
"rehype-pretty-code": "^0.13.2",
|
||||||
|
"rehype-sanitize": "^6.0.0",
|
||||||
|
"rehype-stringify": "^10.0.0",
|
||||||
|
"remark-parse": "^11.0.0",
|
||||||
|
"remark-rehype": "^11.1.0",
|
||||||
|
"swr": "^2.2.5",
|
||||||
|
"tailwind-merge": "^2.3.0",
|
||||||
|
"tailwindcss": "^3.4.1",
|
||||||
|
"tailwindcss-animate": "^1.0.7",
|
||||||
|
"typescript": "^5",
|
||||||
|
"unified": "^11.0.4"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
const config = {
|
||||||
|
plugins: {
|
||||||
|
tailwindcss: {},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
export default config
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 1011 B |
@@ -0,0 +1,105 @@
|
|||||||
|
|
||||||
|
# gitbiome
|
||||||
|
|
||||||
|
Aggregate your online presences with the help of GitHub!
|
||||||
|
|
||||||
|
- ✅ **Customization**: Choose how your profile is displayed with various theming options
|
||||||
|
- ✅ **Responsivity**: Your landing page will look great on any device
|
||||||
|
- ✅ **Easy setup**: Signing up has never been easier as it is unnecessary with our service
|
||||||
|
- ✅ **Auto-updated data**: Data is dynamically pulled from your GitHub profile
|
||||||
|
|
||||||
|
Check out [our website](https://gitbio.me) to see it yourself.
|
||||||
|
|
||||||
|
## Creating your profile
|
||||||
|
|
||||||
|
### Prerequisites
|
||||||
|
You must publish a GitHub repository named **`gitbio`**, that contains the following files:
|
||||||
|
- `page.json`
|
||||||
|
- `readme.md` (optional)
|
||||||
|
|
||||||
|
|
||||||
|
Structurally should look like this:
|
||||||
|
```bash
|
||||||
|
├── gitbio (repository)
|
||||||
|
│ ├── page.json
|
||||||
|
│ ├── readme.md # optional
|
||||||
|
```
|
||||||
|
|
||||||
|
**⚠️ The file names are case-sensitive!**
|
||||||
|
|
||||||
|
|
||||||
|
### page.json
|
||||||
|
This file holds your page configuration, but it must follow a defined convention
|
||||||
|
|
||||||
|
- **`display_name (string)`**: Displayed above your GitHub username
|
||||||
|
- **`bio (string)`**
|
||||||
|
- **`platforms (url[])`**: A collection of your social media
|
||||||
|
- **`showcased_repos (string[])`**: Max. 3 of your repositories to be displayed
|
||||||
|
- **`show views (boolean)`**: Whether or not to display the views on your gitbio profile. Default is `true`
|
||||||
|
- **`theme ('light' | 'dark')`**: Theme of your landing profile. Default value is `dark`
|
||||||
|
- **`background_color (css color)`**: A blurred circle in the background, colored of your choosing
|
||||||
|
- **`spotify_ws (url)`**: A websocket application endpoint for providing real-time Spotify data. Learn more [here](https://github.com/csehviktor/now-playing?tab=readme-ov-file#now-playing)
|
||||||
|
|
||||||
|
|
||||||
|
An example:
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"display_name": "john doe",
|
||||||
|
"bio": "use gitbio.me 😍😘",
|
||||||
|
"platforms": [
|
||||||
|
"https://instagram.com/therock",
|
||||||
|
"https://yoursit.ee/",
|
||||||
|
"https://twitter.com/elonmusk",
|
||||||
|
"random string" // (will not be shown)
|
||||||
|
],
|
||||||
|
"showcased_repos": [
|
||||||
|
"gitbio",
|
||||||
|
"my-repository",
|
||||||
|
"hello world", // (invalid repo name, therefore will not be shown)
|
||||||
|
],
|
||||||
|
"show_views": true,
|
||||||
|
"theme": "dark",
|
||||||
|
"background_color": "#8040ee"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
**Keep in mind!** All of the config keys shown above are optional. Customize your page to your liking.
|
||||||
|
|
||||||
|
### readme.md
|
||||||
|
No strict convention, other than file's name being case-sensitive.
|
||||||
|
|
||||||
|
- `README.md` ❌
|
||||||
|
- `rEaDmE.md` ❌
|
||||||
|
- `readme.MD` ❌
|
||||||
|
- `readme.md` ✅
|
||||||
|
|
||||||
|
### Your profile
|
||||||
|
|
||||||
|
After creating the repository with the corresponding file(s), your profile will be accessible on `gitbio.me/[username]` or `[username].gitbio.me`
|
||||||
|
|
||||||
|
**Your gitbio username is equivalent to the one on Github**
|
||||||
|
|
||||||
|
## FAQ
|
||||||
|
|
||||||
|
### How do I set an avatar and username?
|
||||||
|
|
||||||
|
>You can't. Your avatar and username will be equivalent to the ones on GitHub.
|
||||||
|
|
||||||
|
### How can I set an icon for my social platform?
|
||||||
|
|
||||||
|
>You can't. Icons are automatically loaded from a preset, according to the origin of your url. External urls are provided with an "external website" icon.
|
||||||
|
|
||||||
|
### I updated my profile but it won't change on the website. Why?
|
||||||
|
|
||||||
|
>Our service uses cache on loaded values in order to improve load time. It might take a minute or two for changes to take place. In case an error occurs while reading data, it will be shown on your profile page.
|
||||||
|
|
||||||
|
### How do I delete my profile?
|
||||||
|
|
||||||
|
>You simply delete the repository.
|
||||||
|
|
||||||
|
### My profile is not working properly in terms of functionality or responsivity.
|
||||||
|
|
||||||
|
>Our service might not be 100%. Issues, pull requests, or even ideas are welcome!
|
||||||
|
|
||||||
|
## License
|
||||||
|
[GPL-3.0](https://github.com/csehviktor/gitbiome/blob/main/license)
|
||||||
@@ -0,0 +1,131 @@
|
|||||||
|
import type { GithubProfileModel, RepositoryModel } from '@/lib/services/github'
|
||||||
|
import type { ProfileModelDraft } from '@/app/page'
|
||||||
|
import { type JsonProfileModel, Service } from '@/lib/services/content'
|
||||||
|
import { AlertContainer } from '@/components/mixed/alert-container'
|
||||||
|
import { RepositoryCard } from '@/components/mixed/repository-card'
|
||||||
|
import { ProfileCard } from '@/components/mixed/profile-card'
|
||||||
|
import { Spotify } from '@/components/mixed/spotify'
|
||||||
|
import { Markdown } from '@/components/mixed/markdown'
|
||||||
|
import { Background } from '@/components/ui/background'
|
||||||
|
import { Constants } from '@/lib/constants'
|
||||||
|
import { randomize, truncate } from '@/lib/utils'
|
||||||
|
import { headers } from 'next/headers'
|
||||||
|
import { ThemeProvider } from 'next-themes'
|
||||||
|
import { DatabaseService } from '@/lib/services/database'
|
||||||
|
|
||||||
|
export interface ProfileModel extends ProfileModelDraft {
|
||||||
|
ok: boolean
|
||||||
|
views: number
|
||||||
|
profile: GithubProfileModel
|
||||||
|
repository: RepositoryModel
|
||||||
|
json: JsonProfileModel
|
||||||
|
readme: string
|
||||||
|
}
|
||||||
|
|
||||||
|
interface ErrorResponse {
|
||||||
|
ok: boolean
|
||||||
|
error: string
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
async function getProfileData(username: string): Promise<ProfileModel | ErrorResponse> {
|
||||||
|
const repoName = Constants.WANTED_REPO_NAME
|
||||||
|
const jsonFile = Constants.PAGE_FILE
|
||||||
|
|
||||||
|
const service = new Service(username, repoName)
|
||||||
|
|
||||||
|
try {
|
||||||
|
const views = await DatabaseService.getViews(username)
|
||||||
|
|
||||||
|
const repository = await service.getRepository(repoName)
|
||||||
|
const profile = await service.getGithubProfile()
|
||||||
|
const readme = await service.readFileByModel<string>('readme.md', false)
|
||||||
|
const json = await service.readFileByModel<JsonProfileModel>(jsonFile, true) as JsonProfileModel
|
||||||
|
|
||||||
|
if(json.showcased_repos)
|
||||||
|
json.showcased_repos = await Promise.all(json.showcased_repos.slice(0, 3)
|
||||||
|
.map(async repo =>
|
||||||
|
await service.getRepository(repo as string)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
await DatabaseService.incrementViews(
|
||||||
|
username,
|
||||||
|
(headers().get('x-forwarded-for') ?? '127.0.0.1').split(',')[0]!
|
||||||
|
)
|
||||||
|
|
||||||
|
return { ok: true, views, profile, repository, json, readme }
|
||||||
|
} catch(error: unknown) {
|
||||||
|
return { ok: false, error: (error as Error).message }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default async function ProfilePage({ params }: { params: { username: string }}) {
|
||||||
|
const { username } = params
|
||||||
|
|
||||||
|
const data = await getProfileData(username)
|
||||||
|
|
||||||
|
const errorData = data as ErrorResponse || { }
|
||||||
|
const profileData = data as ProfileModel || { }
|
||||||
|
|
||||||
|
const {
|
||||||
|
repository: {
|
||||||
|
latest_commit = '?'
|
||||||
|
} = { },
|
||||||
|
json: {
|
||||||
|
theme = 'dark',
|
||||||
|
background_color = '',
|
||||||
|
showcased_repos: repos = [],
|
||||||
|
spotify_ws = ''
|
||||||
|
} = {},
|
||||||
|
readme
|
||||||
|
} = profileData || { }
|
||||||
|
|
||||||
|
return(
|
||||||
|
<ThemeProvider attribute='class' forcedTheme={theme}>
|
||||||
|
<Background backgroundColor={background_color} theme={theme} />
|
||||||
|
<div className='flex flex-col h-screen justify-between'>
|
||||||
|
{ (!data?.ok) && <AlertContainer error={ errorData.error } /> }
|
||||||
|
|
||||||
|
<div className='flex justify-center my-32 transition-all duration-300'>
|
||||||
|
<div className={`w-11/12 max-w-[60rem] flex flex-col ${repos.length > 0 && 'lg:flex-row lg:space-x-10'}`}>
|
||||||
|
<div className='w-full flex flex-col'>
|
||||||
|
<ProfileCard
|
||||||
|
profileData={profileData}
|
||||||
|
theme={theme}
|
||||||
|
/>
|
||||||
|
{ spotify_ws && <Spotify wsUrl={spotify_ws} theme={background_color} /> }
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className='w-full space-y-2'>
|
||||||
|
{ readme &&
|
||||||
|
<Markdown
|
||||||
|
fileName='readme.md'
|
||||||
|
owner={username}
|
||||||
|
content={readme}
|
||||||
|
/>
|
||||||
|
}
|
||||||
|
{ (repos as RepositoryModel[]).map(repo => {
|
||||||
|
return (
|
||||||
|
<RepositoryCard
|
||||||
|
key={randomize(repo.name)}
|
||||||
|
owner={username}
|
||||||
|
repository={repo}
|
||||||
|
/>
|
||||||
|
)
|
||||||
|
})}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<p className='text-sm p-1 text-gray-700'>
|
||||||
|
{'build id: '}
|
||||||
|
<span className='w-fit font-semibold'>
|
||||||
|
{ truncate(latest_commit, 8, false) }
|
||||||
|
</span>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</ThemeProvider>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export const revalidate = 0
|
||||||
@@ -0,0 +1,68 @@
|
|||||||
|
@tailwind base;
|
||||||
|
@tailwind components;
|
||||||
|
@tailwind utilities;
|
||||||
|
|
||||||
|
:root {
|
||||||
|
--border: 240 6% 8%;
|
||||||
|
|
||||||
|
--background: 136 0% 0%;
|
||||||
|
--foreground: 213 31% 92%;
|
||||||
|
|
||||||
|
--card: 240 20% 2%;
|
||||||
|
--card-foreground: 213 31% 91%;
|
||||||
|
|
||||||
|
--muted: 240 20% 6%;
|
||||||
|
--muted-foreground: 215.4 16.3% 56.9%;
|
||||||
|
|
||||||
|
--destructive: 0 100% 50%;
|
||||||
|
--destructive-foreground: 0 86% 51%;
|
||||||
|
|
||||||
|
--badge: 261 100% 74%;
|
||||||
|
--badge-foreground: 0 0% 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.light {
|
||||||
|
--border: 240 1% 90%;
|
||||||
|
|
||||||
|
--background: 0 0% 100%;;
|
||||||
|
--foreground: 240 10% 3.9%;
|
||||||
|
|
||||||
|
--card: 0 0% 100%;
|
||||||
|
--card-foreground: 240 10% 3.9%;
|
||||||
|
|
||||||
|
--muted: 240 4.8% 95.9%;
|
||||||
|
--muted-foreground: 240 3.8% 46.1%;
|
||||||
|
|
||||||
|
--destructive: 0 84.2% 60.2%;
|
||||||
|
--destructive-foreground: 0 0% 98%;
|
||||||
|
|
||||||
|
--badge: 261 100% 74%;
|
||||||
|
--badge-foreground: 0 0% 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
@layer base {
|
||||||
|
::-webkit-scrollbar {
|
||||||
|
width: 3px;
|
||||||
|
height: 3px;
|
||||||
|
}
|
||||||
|
|
||||||
|
::-webkit-scrollbar-thumb {
|
||||||
|
background-color: #5c5c5c;
|
||||||
|
border-radius: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
* {
|
||||||
|
@apply border-border;
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
@apply bg-background text-foreground;
|
||||||
|
font-feature-settings: "rlig" 1, "calt" 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
h1 { @apply font-semibold text-4xl lg:text-3xl }
|
||||||
|
|
||||||
|
h2 { @apply font-semibold text-3xl lg:text-2xl }
|
||||||
|
|
||||||
|
h3 { @apply text-lg }
|
||||||
|
}
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
import type { Metadata } from 'next'
|
||||||
|
import type { ReactNode } from 'react'
|
||||||
|
import { Inter } from 'next/font/google'
|
||||||
|
import '@/app/globals.css'
|
||||||
|
|
||||||
|
import { Constants } from '@/lib/constants'
|
||||||
|
|
||||||
|
const inter = Inter({ subsets: ['latin'], preload: false })
|
||||||
|
|
||||||
|
|
||||||
|
const { META_TITLE, META_DESC, META_LOGO } = Constants
|
||||||
|
|
||||||
|
export const metadata: Metadata = {
|
||||||
|
title: META_TITLE,
|
||||||
|
description: META_DESC,
|
||||||
|
openGraph: {
|
||||||
|
url: process.env.NEXT_BASE_URL,
|
||||||
|
title: META_TITLE,
|
||||||
|
description: META_DESC,
|
||||||
|
images: [ META_LOGO ]
|
||||||
|
},
|
||||||
|
twitter: {
|
||||||
|
card: 'summary',
|
||||||
|
title: META_TITLE,
|
||||||
|
description: META_DESC,
|
||||||
|
images: [ META_LOGO ]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default function RootLayout({ children }: Readonly<{children: ReactNode}>) {
|
||||||
|
return(
|
||||||
|
<html lang='en' suppressHydrationWarning>
|
||||||
|
<body className={ inter.className }>
|
||||||
|
{ children }
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
)
|
||||||
|
}
|
||||||
@@ -0,0 +1,82 @@
|
|||||||
|
import type { GithubProfileModel, RepositoryModel } from '@/lib/services/github'
|
||||||
|
import type { JsonProfileModel } from '@/lib/services/content'
|
||||||
|
import { ProfileCard } from '@/components/mixed/profile-card'
|
||||||
|
import { Markdown } from '@/components/mixed/markdown'
|
||||||
|
import { Background } from '@/components/ui/background'
|
||||||
|
import { Button } from '@/components/ui/button'
|
||||||
|
import { Constants } from '@/lib/constants'
|
||||||
|
import { Github } from 'lucide-react'
|
||||||
|
import Link from 'next/link'
|
||||||
|
|
||||||
|
export interface ProfileModelDraft {
|
||||||
|
views: number,
|
||||||
|
profile: Partial<GithubProfileModel>
|
||||||
|
repository: Partial<RepositoryModel>
|
||||||
|
json: Partial<JsonProfileModel>
|
||||||
|
}
|
||||||
|
|
||||||
|
const pageData: ProfileModelDraft = {
|
||||||
|
views: 1984,
|
||||||
|
profile: {
|
||||||
|
login: 'example',
|
||||||
|
avatar_url: 'https://i.pinimg.com/originals/ba/82/7c/ba827cdd57394d4d3eac9f8980a7a152.gif'
|
||||||
|
},
|
||||||
|
repository: {
|
||||||
|
stargazers_count: 23
|
||||||
|
},
|
||||||
|
json: {
|
||||||
|
display_name: 'satoko',
|
||||||
|
bio: 'your bio',
|
||||||
|
platforms: [
|
||||||
|
'https://instagram.com/yoursitee',
|
||||||
|
'https://github.com/yoursitee',
|
||||||
|
'https://x.com/yoursitee',
|
||||||
|
'https://yoursit.ee',
|
||||||
|
'https://t.me/yoursitee'
|
||||||
|
],
|
||||||
|
background_color: 'purple',
|
||||||
|
show_views: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default function HomePage() {
|
||||||
|
const { json } = pageData || { }
|
||||||
|
|
||||||
|
return(
|
||||||
|
<>
|
||||||
|
<Background backgroundColor={ json.background_color ?? '' } theme='dark' />
|
||||||
|
<div className='flex flex-col h-screen justify-between'>
|
||||||
|
<div className='flex justify-center my-32 transition-all duration-300'>
|
||||||
|
<div className='w-11/12 max-w-[75rem] flex flex-col justify-center items-center lg:items-start lg:flex-row lg:space-x-10'>
|
||||||
|
<div className='w-full max-w-[35rem]'>
|
||||||
|
<h1 className='w-full lg:w-3/4'>
|
||||||
|
Collect your socials like a
|
||||||
|
<span className='bg-gradient-to-r from-fuchsia-200 to-pink-300 text-transparent bg-clip-text'> developer</span>🎀
|
||||||
|
</h1>
|
||||||
|
<p className='text-muted-foreground text-md lg:text-lg mt-3 mb-7'>Customize your page on Github, watch the result real-time</p>
|
||||||
|
<Markdown draft owner='example' fileName={Constants.PAGE_FILE} content={'```json \n' + JSON.stringify(json, null, '\t') + '\n```'} />
|
||||||
|
</div>
|
||||||
|
<div className='w-full max-w-[35rem] text-center lg:text-left'>
|
||||||
|
<ProfileCard draft profileData={ pageData } theme={'dark'} />
|
||||||
|
<h2>Are you interested?</h2>
|
||||||
|
<p className='text-muted-foreground text-md lg:text-lg'>Read our docs to create your own profile!</p>
|
||||||
|
<Button asChild className='my-3 rounded-md bg-gradient-to-r from-pink-500 to-rose-500'>
|
||||||
|
<Link
|
||||||
|
href='https://github.com/csehviktor/gitbiome?tab=readme-ov-file#creating-your-profile'
|
||||||
|
target='_blank'
|
||||||
|
>
|
||||||
|
<Github className='h-4' />
|
||||||
|
Documentation
|
||||||
|
</Link>
|
||||||
|
</Button>
|
||||||
|
<p className='text-slate-500 text-lg font-bold animate-bounce my-3'>You don't even have to register 💯</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<p className='text-center text-sm p-1 text-slate-500 font-semibold'>
|
||||||
|
made by thesatoko team
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
)
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
'use client'
|
||||||
|
|
||||||
|
import { Alert, AlertDescription } from '@/components/ui/alert'
|
||||||
|
import { AlertCircle } from 'lucide-react'
|
||||||
|
|
||||||
|
const AlertContainer = ({ error }: { error?: string }) => {
|
||||||
|
const isLoading = error === undefined
|
||||||
|
|
||||||
|
return(
|
||||||
|
<div className='flex justify-center top-2'>
|
||||||
|
<Alert variant={ isLoading ? 'default' : 'destructive' } className='flex w-11/12 max-w-[40rem] opacity-75'>
|
||||||
|
<AlertCircle className='h-6 w-6' />
|
||||||
|
<AlertDescription>
|
||||||
|
{ isLoading ? 'Fetching profile...' : error }
|
||||||
|
</AlertDescription>
|
||||||
|
</Alert>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export { AlertContainer }
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
'use client'
|
||||||
|
|
||||||
|
import type { PlatformModel } from '@/lib/platform'
|
||||||
|
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@/components/ui/tooltip'
|
||||||
|
import { Icon } from '@/components/ui/icon'
|
||||||
|
import { PlatformIcon } from '@/lib/utils/icons'
|
||||||
|
import { randomize } from '@/lib/utils'
|
||||||
|
import Link from 'next/link'
|
||||||
|
|
||||||
|
const IconWrapper = ({ props }: { props: (PlatformModel | undefined)[] }) => {
|
||||||
|
return(
|
||||||
|
<div className='flex flex-wrap items-center justify-evenly w-11/12'>
|
||||||
|
{ props.map((prop: PlatformModel | undefined) => {
|
||||||
|
if(prop === undefined) return
|
||||||
|
|
||||||
|
return(
|
||||||
|
<TooltipProvider key={randomize(prop.name)} delayDuration={0}>
|
||||||
|
<Tooltip>
|
||||||
|
<TooltipTrigger>
|
||||||
|
<Link href={ prop.url[0]! } target='_blank'>
|
||||||
|
<Icon
|
||||||
|
color={ prop.color as string }
|
||||||
|
viewBox={ prop.icon === PlatformIcon.EXTERNAL ? 'big' : 'small'}
|
||||||
|
className='transition-all duration-200 hover:scale-110'>
|
||||||
|
{ prop.icon }
|
||||||
|
</Icon>
|
||||||
|
</Link>
|
||||||
|
</TooltipTrigger>
|
||||||
|
<TooltipContent sideOffset={1}>
|
||||||
|
<p className='text-sm'>{ prop.name }</p>
|
||||||
|
</TooltipContent>
|
||||||
|
</Tooltip>
|
||||||
|
</TooltipProvider>
|
||||||
|
)
|
||||||
|
})}
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export { IconWrapper }
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
import { unified } from 'unified'
|
||||||
|
|
||||||
|
//plugins
|
||||||
|
import remarkParse from 'remark-parse'
|
||||||
|
import remarkRehype from 'remark-rehype'
|
||||||
|
import rehypeSanitize from 'rehype-sanitize'
|
||||||
|
import rehypeStringify from 'rehype-stringify'
|
||||||
|
import rehypePrettyCode from 'rehype-pretty-code'
|
||||||
|
|
||||||
|
import { Card, CardContent, CardHeader } from '@/components/ui/card'
|
||||||
|
import { Constants } from '@/lib/constants'
|
||||||
|
import Link from 'next/link'
|
||||||
|
|
||||||
|
async function render(content: string): Promise<string> {
|
||||||
|
return String(await unified()
|
||||||
|
.use(remarkParse)
|
||||||
|
.use(remarkRehype)
|
||||||
|
.use(rehypeSanitize)
|
||||||
|
.use(rehypeStringify)
|
||||||
|
.use(rehypePrettyCode, {
|
||||||
|
keepBackground: false
|
||||||
|
})
|
||||||
|
.process(content)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
const Markdown = async ({ owner, fileName, content, draft }: { owner: string, fileName: string, content: string, draft?: boolean }) => {
|
||||||
|
let html_url = `https://github.com/${owner}/${Constants.WANTED_REPO_NAME}/blob/main/${fileName}`
|
||||||
|
|
||||||
|
if(draft) html_url = 'https://github.com/csehviktor/gitbiome?tab=readme-ov-file#page.json'
|
||||||
|
|
||||||
|
return(
|
||||||
|
<Card className='w-full h-fit max-w-[30rem] mb-7 mx-auto'>
|
||||||
|
<CardHeader className='text-sm py-3 px-5'>
|
||||||
|
<Link className='text-foreground font-semibold'
|
||||||
|
target='_blank'
|
||||||
|
href={ html_url }
|
||||||
|
>
|
||||||
|
{ owner } / <span className='font-normal text-muted-foreground'>{ fileName }</span>
|
||||||
|
</Link>
|
||||||
|
</CardHeader>
|
||||||
|
<CardContent className='px-5 py-4 text-sm sm:text-base overflow-x-scroll transition-all duration-300'>
|
||||||
|
<div dangerouslySetInnerHTML={{ __html: await render(content) }} />
|
||||||
|
</CardContent>
|
||||||
|
</Card>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export { Markdown }
|
||||||
@@ -0,0 +1,118 @@
|
|||||||
|
'use client'
|
||||||
|
|
||||||
|
import type { ProfileModelDraft } from '@/app/page'
|
||||||
|
import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from '@/components/ui/card'
|
||||||
|
import { Avatar, AvatarImage, AvatarFallback } from '@/components/ui/avatar'
|
||||||
|
import { Skeleton } from '@/components/ui/skeleton'
|
||||||
|
import { Separator } from '@/components/ui/separator'
|
||||||
|
import { Badge } from '@/components/ui/badge'
|
||||||
|
import { IconWrapper } from '@/components/mixed/icon-wrapper'
|
||||||
|
import { Tooltip, TooltipProvider, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip'
|
||||||
|
import { Constants } from '@/lib/constants'
|
||||||
|
import { getPlatformByUrl } from '@/lib/platform'
|
||||||
|
import { CodeXml, Eye, Github, Heart } from 'lucide-react'
|
||||||
|
import Link from 'next/link'
|
||||||
|
|
||||||
|
const ProfileCard = ({ profileData, theme, draft }: { profileData: ProfileModelDraft, theme: 'light' | 'dark', draft?: boolean }) => {
|
||||||
|
const { profile, repository, json, views } = profileData || { }
|
||||||
|
|
||||||
|
const { avatar_url, id, login } = profile || { }
|
||||||
|
const { stargazers_count, name } = repository || { }
|
||||||
|
const { display_name, bio, platforms, show_views = true } = json || { }
|
||||||
|
|
||||||
|
return(
|
||||||
|
<Card className='w-full h-fit max-w-[30rem] mb-7 mx-auto'>
|
||||||
|
<CardHeader className='flex'>
|
||||||
|
<Avatar className='w-32 h-32'>
|
||||||
|
<AvatarImage src={ avatar_url } />
|
||||||
|
<AvatarFallback>
|
||||||
|
<Skeleton className='w-32 h-32 rounded-full' />
|
||||||
|
</AvatarFallback>
|
||||||
|
</Avatar>
|
||||||
|
|
||||||
|
<div className='w-full'>
|
||||||
|
<CardTitle className='w-full mr-5 flex items-center'>
|
||||||
|
{ !display_name ? (login ? login : <Skeleton className='h-4 w-2/3 mt-2' />) : display_name }
|
||||||
|
|
||||||
|
{ Constants.STAFF_ID.includes(id ?? 0) &&
|
||||||
|
<TooltipProvider delayDuration={0}>
|
||||||
|
<Tooltip>
|
||||||
|
<TooltipTrigger>
|
||||||
|
<Badge variant='dev' className='ml-2'>
|
||||||
|
<CodeXml className='h-4' />
|
||||||
|
</Badge>
|
||||||
|
</TooltipTrigger>
|
||||||
|
<TooltipContent sideOffset={1}>
|
||||||
|
<p className='text-sm'>developer</p>
|
||||||
|
</TooltipContent>
|
||||||
|
</Tooltip>
|
||||||
|
</TooltipProvider>
|
||||||
|
}
|
||||||
|
</CardTitle>
|
||||||
|
<CardDescription className='leading-relaxed'>
|
||||||
|
<div className='text-md w-fit'>{ login ? `@${login}` : <Skeleton className='h-4 w-[100px] my-2' /> }</div>
|
||||||
|
|
||||||
|
{
|
||||||
|
stargazers_count !== undefined ?
|
||||||
|
<div className='text-sm mt-2 -mx-1 leading-6 w-fit'>
|
||||||
|
<p className='flex items-center'>
|
||||||
|
<Heart className='mr-1 h-4 text-red-400'/>
|
||||||
|
{ stargazers_count } likes
|
||||||
|
</p>
|
||||||
|
{
|
||||||
|
show_views && (
|
||||||
|
<p className='flex items-center'>
|
||||||
|
<Eye className='mr-1 h-4 text-cyan-400'/>
|
||||||
|
{ views } views
|
||||||
|
</p>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
</div> :
|
||||||
|
<div className='w-1/2 mt-5'>
|
||||||
|
<Skeleton className='h-4 my-2' />
|
||||||
|
<Skeleton className='h-4' />
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
</CardDescription>
|
||||||
|
</div>
|
||||||
|
</CardHeader>
|
||||||
|
<CardContent className='p-0'>
|
||||||
|
<Card className='bg-background/35 mb-6 mx-6'>
|
||||||
|
<CardContent className='flex px-6 py-3 justify-center'>
|
||||||
|
{ bio ?? <Skeleton className='h-4 w-full' /> }
|
||||||
|
</CardContent>
|
||||||
|
</Card>
|
||||||
|
<Separator />
|
||||||
|
<div className='my-5 text-sm flex flex-col items-center'>
|
||||||
|
{
|
||||||
|
platforms
|
||||||
|
? <IconWrapper props={ platforms.map(platform => getPlatformByUrl(platform, theme) )} />
|
||||||
|
: <Skeleton className='h-10 w-11/12' />
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
</CardContent>
|
||||||
|
<Separator />
|
||||||
|
<CardFooter className='my-2'>
|
||||||
|
{ !draft ?
|
||||||
|
<div className='flex w-full items-center justify-between mt-2 -mx-1'>
|
||||||
|
{ login ?
|
||||||
|
<div className='flex'>
|
||||||
|
<Github className='mr-1 mt-0.5 h-4 text-foreground/70'/>
|
||||||
|
<Link
|
||||||
|
target='_blank'
|
||||||
|
href={`https://github.com/${login}/${name ?? Constants.WANTED_REPO_NAME}`}
|
||||||
|
className='hover:text-foreground transition-all duration-300'
|
||||||
|
>
|
||||||
|
view this repository
|
||||||
|
</Link>
|
||||||
|
</div> :
|
||||||
|
<Skeleton className='h-4 w-[170px]' />
|
||||||
|
}
|
||||||
|
</div> : ''
|
||||||
|
}
|
||||||
|
</CardFooter>
|
||||||
|
</Card>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export { ProfileCard }
|
||||||
@@ -0,0 +1,59 @@
|
|||||||
|
'use client'
|
||||||
|
|
||||||
|
import type { RepositoryModel } from '@/lib/services/github'
|
||||||
|
import { TooltipProvider, TooltipTrigger, Tooltip, TooltipContent } from '@/components/ui/tooltip'
|
||||||
|
import { Card, CardDescription, CardFooter, CardHeader, CardTitle } from '@/components/ui/card'
|
||||||
|
import { truncate } from '@/lib/utils'
|
||||||
|
import { GitFork, Star, SquareArrowOutUpRight } from 'lucide-react'
|
||||||
|
import Link from 'next/link'
|
||||||
|
|
||||||
|
const RepositoryCard = ({ owner, repository }: { owner?: string, repository?: RepositoryModel }) => {
|
||||||
|
const { name, description, latest_commit, language, language_color, forks_count, stargazers_count, fork } = repository ?? { }
|
||||||
|
|
||||||
|
return(
|
||||||
|
<Card className='w-full h-fit max-w-[30rem] mx-auto transition-transform duration-300 hover:scale-105'>
|
||||||
|
<CardHeader>
|
||||||
|
<Link href={`https://github.com/${owner}/${name}`} target='_blank' className='w-full'>
|
||||||
|
<div className='w-full'>
|
||||||
|
<SquareArrowOutUpRight className='h-3 float-right text-gray-700' />
|
||||||
|
<CardTitle className='text-md flex items-center'>
|
||||||
|
{ name } { fork && <GitFork className='ml-2 h-5 -rotate-90 text-gray-500' /> }
|
||||||
|
</CardTitle>
|
||||||
|
<CardDescription className='text-sm break-words'>
|
||||||
|
{ truncate(description ?? '', 150, true) }
|
||||||
|
|
||||||
|
<div className='flex items-center text-sm font-semibold mt-2 -mx-1 space-x-3'>
|
||||||
|
<span className='flex items-center'>
|
||||||
|
<Star className='-mt-0.5 h-4 text-yellow-400'/>
|
||||||
|
{ stargazers_count }
|
||||||
|
</span>
|
||||||
|
<span className='flex items-center'>
|
||||||
|
<GitFork className='-mt-0.5 h-4 text-green-400'/>
|
||||||
|
{ forks_count }
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</CardDescription>
|
||||||
|
</div>
|
||||||
|
</Link>
|
||||||
|
</CardHeader>
|
||||||
|
<CardFooter className='text-xs text-gray-700'>
|
||||||
|
<p>{ truncate(latest_commit ?? '', 8, false) }</p>
|
||||||
|
|
||||||
|
<div className='ml-3'>
|
||||||
|
<TooltipProvider delayDuration={0}>
|
||||||
|
<Tooltip>
|
||||||
|
<TooltipTrigger className='cursor-auto'>
|
||||||
|
<div className='h-2 w-2 rounded-full' style={{ backgroundColor: language_color }}/>
|
||||||
|
</TooltipTrigger>
|
||||||
|
<TooltipContent sideOffset={1}>
|
||||||
|
<p className='text-sm font-semibold'>{ language }</p>
|
||||||
|
</TooltipContent>
|
||||||
|
</Tooltip>
|
||||||
|
</TooltipProvider>
|
||||||
|
</div>
|
||||||
|
</CardFooter>
|
||||||
|
</Card>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export { RepositoryCard }
|
||||||
@@ -0,0 +1,89 @@
|
|||||||
|
'use client'
|
||||||
|
|
||||||
|
import useSWRSubscription, { type SWRSubscriptionOptions } from 'swr/subscription'
|
||||||
|
import { Card, CardContent, CardHeader } from '@/components/ui/card'
|
||||||
|
import { Progress } from '@/components/ui/progress'
|
||||||
|
import { Icon } from '@/components/ui/icon'
|
||||||
|
import { PlatformIcon } from '@/lib/utils/icons'
|
||||||
|
import { timeformat, truncate } from '@/lib/utils'
|
||||||
|
import { useEffect, useState } from 'react'
|
||||||
|
import Link from 'next/link'
|
||||||
|
|
||||||
|
interface SpotifyModel {
|
||||||
|
item: {
|
||||||
|
name: string
|
||||||
|
album: {
|
||||||
|
images: [{ url: string }]
|
||||||
|
}
|
||||||
|
popularity: number
|
||||||
|
duration_ms: number
|
||||||
|
artists: [{ name: string }]
|
||||||
|
external_urls: { spotify: string }
|
||||||
|
}
|
||||||
|
progress_ms: number
|
||||||
|
is_playing: boolean
|
||||||
|
}
|
||||||
|
|
||||||
|
const Spotify = ({ wsUrl, theme }: { wsUrl: string, theme: string}) => {
|
||||||
|
const [ spotify, setSpotify ] = useState<SpotifyModel>()
|
||||||
|
const [ timestamp, setTimeStamp ] = useState<number>(0)
|
||||||
|
|
||||||
|
useSWRSubscription(wsUrl, (key: string | URL, { next }: SWRSubscriptionOptions) => {
|
||||||
|
const socket = new WebSocket(key)
|
||||||
|
|
||||||
|
socket.onopen = () => socket.send('HELP')
|
||||||
|
socket.onmessage = ({ data }: { data: string }) => next(null, () => {
|
||||||
|
const response = JSON.parse(data) as SpotifyModel
|
||||||
|
|
||||||
|
setSpotify(response)
|
||||||
|
setTimeStamp(response.progress_ms)
|
||||||
|
})
|
||||||
|
|
||||||
|
return () => socket.readyState === 1 && socket.close()
|
||||||
|
})
|
||||||
|
|
||||||
|
const { item } = spotify ?? { }
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
const id = setInterval(() => {
|
||||||
|
if(spotify?.is_playing && (timestamp + 1000) < spotify.item.duration_ms)
|
||||||
|
setTimeStamp((old) => old + 1000)
|
||||||
|
}, 1000)
|
||||||
|
|
||||||
|
return () => clearInterval(id)
|
||||||
|
}, [spotify])
|
||||||
|
|
||||||
|
return(
|
||||||
|
<Card className='w-full h-fit max-w-[30rem] mb-7 mx-auto transition-all duration-300 hover:scale-105 bg-center' style={{
|
||||||
|
backgroundImage: spotify?.item && `linear-gradient(rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.85)), url(${item?.album?.images[0].url})`,
|
||||||
|
backgroundSize: '80%',
|
||||||
|
}}>
|
||||||
|
<Link href={ item?.external_urls?.spotify ?? 'https://open.spotify.com' } target='_blank'>
|
||||||
|
<CardHeader className='flex items-center space-x-px p-3'>
|
||||||
|
<Icon color='#13ad4a' viewBox='small' className='h-4'>
|
||||||
|
{ PlatformIcon.SPOTIFY }
|
||||||
|
</Icon>
|
||||||
|
<p className='text-xs text-muted-foreground'>
|
||||||
|
{ spotify?.is_playing ? 'currently playing' : 'last played track'}
|
||||||
|
</p>
|
||||||
|
</CardHeader>
|
||||||
|
<CardContent className='flex flex-row items-center -mx-1'>
|
||||||
|
<div className='flex flex-col w-full h-full'>
|
||||||
|
<h1 className='text-lg truncate'>{ truncate(item?.name ?? 'unknown track', 35, true) }</h1>
|
||||||
|
<h2 className='text-sm font-light'>{ truncate(item?.artists?.map(artist => artist.name).join(', ') ?? 'unknown artist', 45, true) }</h2>
|
||||||
|
|
||||||
|
{ item &&
|
||||||
|
<div className='mt-4 text-[.6rem] text-card-foreground'>
|
||||||
|
<Progress value={ (timestamp / (item?.duration_ms ?? timestamp)) * 100 } color={ theme } className='w-full' />
|
||||||
|
<span className='float-left'>{ timeformat(timestamp) }</span>
|
||||||
|
<span className='float-right'>{ timeformat(item?.duration_ms ?? 0) }</span>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
</CardContent>
|
||||||
|
</Link>
|
||||||
|
</Card>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export { Spotify }
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
import * as React from 'react'
|
||||||
|
import { cva, type VariantProps } from 'class-variance-authority'
|
||||||
|
|
||||||
|
import { merge } from '@/lib/utils'
|
||||||
|
|
||||||
|
const alertVariants = cva('fixed z-10 top-2 w-full rounded-lg border p-4 flex items-center space-x-2', {
|
||||||
|
variants: {
|
||||||
|
variant: {
|
||||||
|
default: 'text-foreground',
|
||||||
|
destructive:
|
||||||
|
'border-destructive/50 text-destructive-foreground [&>svg]:text-destructive'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
defaultVariants: {
|
||||||
|
variant: 'default'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
const Alert = React.forwardRef<
|
||||||
|
HTMLDivElement,
|
||||||
|
React.HTMLAttributes<HTMLDivElement> & VariantProps<typeof alertVariants>
|
||||||
|
>(({ className, variant, ...props }, ref) => (
|
||||||
|
<div ref={ref} role='alert' className={merge(alertVariants({ variant }), className)}
|
||||||
|
{...props}
|
||||||
|
/>
|
||||||
|
))
|
||||||
|
Alert.displayName = 'Alert'
|
||||||
|
|
||||||
|
const AlertDescription = React.forwardRef<
|
||||||
|
HTMLParagraphElement,
|
||||||
|
React.HTMLAttributes<HTMLParagraphElement>
|
||||||
|
>(({ className, ...props }, ref) => (
|
||||||
|
<div ref={ref} className={merge('text-sm [&_p]:leading-relaxed', className)}
|
||||||
|
{...props}
|
||||||
|
/>
|
||||||
|
))
|
||||||
|
AlertDescription.displayName = 'AlertDescription'
|
||||||
|
|
||||||
|
export { Alert, AlertDescription }
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
'use client'
|
||||||
|
|
||||||
|
import * as React from 'react'
|
||||||
|
import * as AvatarPrimitive from '@radix-ui/react-avatar'
|
||||||
|
|
||||||
|
import { merge } from '@/lib/utils'
|
||||||
|
|
||||||
|
const Avatar = React.forwardRef<
|
||||||
|
React.ElementRef<typeof AvatarPrimitive.Root>,
|
||||||
|
React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Root>
|
||||||
|
>(({ className, ...props }, ref) => (
|
||||||
|
<AvatarPrimitive.Root ref={ref} className={merge('relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full', className)}
|
||||||
|
{...props}
|
||||||
|
/>
|
||||||
|
))
|
||||||
|
Avatar.displayName = AvatarPrimitive.Root.displayName
|
||||||
|
|
||||||
|
const AvatarImage = React.forwardRef<
|
||||||
|
React.ElementRef<typeof AvatarPrimitive.Image>,
|
||||||
|
React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Image>
|
||||||
|
>(({ className, ...props }, ref) => (
|
||||||
|
<AvatarPrimitive.Image ref={ref} className={merge('aspect-square h-full w-full', className)}
|
||||||
|
{...props}
|
||||||
|
/>
|
||||||
|
))
|
||||||
|
AvatarImage.displayName = AvatarPrimitive.Image.displayName
|
||||||
|
|
||||||
|
const AvatarFallback = React.forwardRef<
|
||||||
|
React.ElementRef<typeof AvatarPrimitive.Fallback>,
|
||||||
|
React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Fallback>
|
||||||
|
>(({ className, ...props }, ref) => (
|
||||||
|
<AvatarPrimitive.Fallback ref={ref} className={merge('flex h-full w-full items-center justify-center rounded-full bg-muted', className)}
|
||||||
|
{...props}
|
||||||
|
/>
|
||||||
|
))
|
||||||
|
AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName
|
||||||
|
|
||||||
|
export { Avatar, AvatarImage, AvatarFallback }
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
const Background = ({backgroundColor, theme }: { backgroundColor: string, theme: 'light' | 'dark' }) => {
|
||||||
|
return (
|
||||||
|
<div className='-z-10 absolute m-auto left-0 right-0 top-[7rem] rounded-full blur-3xl w-[66rem] max-w-full h-[33rem] max-h-screen' style={{
|
||||||
|
backgroundColor: backgroundColor,
|
||||||
|
opacity: theme === 'light' ? 0.5 : 0.15
|
||||||
|
}} />
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export { Background }
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
import * as React from 'react'
|
||||||
|
import { cva, type VariantProps } from 'class-variance-authority'
|
||||||
|
|
||||||
|
import { merge } from '@/lib/utils'
|
||||||
|
|
||||||
|
const badgeVariants = cva('inline-flex items-center rounded-full border px-1 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2', {
|
||||||
|
variants: {
|
||||||
|
variant: {
|
||||||
|
default: 'text-foreground',
|
||||||
|
dev: 'border-transparent bg-badge text-badge-foreground'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
defaultVariants: {
|
||||||
|
variant: 'default'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
export interface BadgeProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof badgeVariants> {}
|
||||||
|
|
||||||
|
const Badge = ({ className, variant, ...props }: BadgeProps) => {
|
||||||
|
return (
|
||||||
|
<div className={merge(badgeVariants({ variant }), className)} {...props} />
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export { Badge, badgeVariants }
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
import * as React from 'react'
|
||||||
|
import { Slot } from '@radix-ui/react-slot'
|
||||||
|
import { cva, type VariantProps } from 'class-variance-authority'
|
||||||
|
|
||||||
|
import { merge } from '@/lib/utils'
|
||||||
|
|
||||||
|
const buttonVariants = cva('inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50', {
|
||||||
|
variants: {
|
||||||
|
variant: {
|
||||||
|
default: 'bg-background/45 text-foreground',
|
||||||
|
destructive: 'bg-destructive text-foreground hover:bg-destructive/90'
|
||||||
|
},
|
||||||
|
size: {
|
||||||
|
default: 'rounded-xl px-4 py-2',
|
||||||
|
sm: 'rounded-xl py-2 px-3',
|
||||||
|
lg: 'rounded-xl py-4 px-12',
|
||||||
|
icon: 'h-10 w-10'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
defaultVariants: {
|
||||||
|
variant: 'default',
|
||||||
|
size: 'default'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
export interface ButtonProps
|
||||||
|
extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
|
||||||
|
asChild?: boolean
|
||||||
|
}
|
||||||
|
|
||||||
|
const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(({ className, variant, size, asChild = false, ...props }, ref) => {
|
||||||
|
const Comp = asChild ? Slot : 'button'
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Comp className={ merge(buttonVariants({ variant, size, className })) } ref={ref}
|
||||||
|
{...props}
|
||||||
|
/>
|
||||||
|
)
|
||||||
|
})
|
||||||
|
|
||||||
|
Button.displayName = 'Button'
|
||||||
|
|
||||||
|
export { Button, buttonVariants }
|
||||||
@@ -0,0 +1,65 @@
|
|||||||
|
import * as React from 'react'
|
||||||
|
|
||||||
|
import { merge } from '@/lib/utils'
|
||||||
|
|
||||||
|
const Card = React.forwardRef<
|
||||||
|
HTMLDivElement,
|
||||||
|
React.HTMLAttributes<HTMLDivElement>
|
||||||
|
>(({ className, ...props }, ref) => (
|
||||||
|
<div ref={ref} className={merge('rounded-xl border bg-card/40 text-card-foreground shadow', className)}
|
||||||
|
{...props}
|
||||||
|
/>
|
||||||
|
))
|
||||||
|
Card.displayName = 'Card'
|
||||||
|
|
||||||
|
const CardHeader = React.forwardRef<
|
||||||
|
HTMLDivElement,
|
||||||
|
React.HTMLAttributes<HTMLDivElement>
|
||||||
|
>(({ className, ...props }, ref) => (
|
||||||
|
<div ref={ref} className={merge('flex space-x-7 p-6', className)}
|
||||||
|
{...props}
|
||||||
|
/>
|
||||||
|
))
|
||||||
|
CardHeader.displayName = 'CardHeader'
|
||||||
|
|
||||||
|
const CardTitle = React.forwardRef<
|
||||||
|
HTMLParagraphElement,
|
||||||
|
React.HTMLAttributes<HTMLHeadingElement>
|
||||||
|
>(({ className, ...props }, ref) => (
|
||||||
|
<h3 ref={ref} className={merge('font-semibold leading-none tracking-tight text-2xl', className)}
|
||||||
|
{...props}
|
||||||
|
/>
|
||||||
|
))
|
||||||
|
CardTitle.displayName = 'CardTitle'
|
||||||
|
|
||||||
|
const CardDescription = React.forwardRef<
|
||||||
|
HTMLParagraphElement,
|
||||||
|
React.HTMLAttributes<HTMLParagraphElement>
|
||||||
|
>(({ className, ...props }, ref) => (
|
||||||
|
<div ref={ref} className={merge('text-sm text-muted-foreground', className)}
|
||||||
|
{...props}
|
||||||
|
/>
|
||||||
|
))
|
||||||
|
CardDescription.displayName = 'CardDescription'
|
||||||
|
|
||||||
|
const CardContent = React.forwardRef<
|
||||||
|
HTMLDivElement,
|
||||||
|
React.HTMLAttributes<HTMLDivElement>
|
||||||
|
>(({ className, ...props }, ref) => (
|
||||||
|
<div ref={ref} className={merge('p-6 pt-0', className)}
|
||||||
|
{...props}
|
||||||
|
/>
|
||||||
|
))
|
||||||
|
CardContent.displayName = 'CardContent'
|
||||||
|
|
||||||
|
const CardFooter = React.forwardRef<
|
||||||
|
HTMLDivElement,
|
||||||
|
React.HTMLAttributes<HTMLDivElement>
|
||||||
|
>(({ className, ...props }, ref) => (
|
||||||
|
<div ref={ref} className={merge('flex items-center text-sm text-muted-foreground/75 p-6 pt-0', className)}
|
||||||
|
{...props}
|
||||||
|
/>
|
||||||
|
))
|
||||||
|
CardFooter.displayName = 'CardFooter'
|
||||||
|
|
||||||
|
export { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent }
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
import { merge } from '@/lib/utils'
|
||||||
|
|
||||||
|
interface IconProps extends React.HtmlHTMLAttributes<HTMLDivElement> {
|
||||||
|
color: string
|
||||||
|
viewBox: 'small' | 'big'
|
||||||
|
}
|
||||||
|
|
||||||
|
const Icon = ({ color, viewBox, children, className }: IconProps) => {
|
||||||
|
return(
|
||||||
|
<svg xmlns='http://www.w3.org/2000/svg' viewBox={`0 0 ${viewBox === 'small' ? '24 24' : '120 120'}`}
|
||||||
|
className={merge(`h-8 w-8`, className )} style={{ fill: color }}
|
||||||
|
>
|
||||||
|
{ children }
|
||||||
|
</svg>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export { Icon }
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
'use client'
|
||||||
|
|
||||||
|
import * as React from 'react'
|
||||||
|
import * as ProgressPrimitive from '@radix-ui/react-progress'
|
||||||
|
|
||||||
|
import { merge } from '@/lib/utils'
|
||||||
|
|
||||||
|
const Progress = React.forwardRef<
|
||||||
|
React.ElementRef<typeof ProgressPrimitive.Root>,
|
||||||
|
React.ComponentPropsWithoutRef<typeof ProgressPrimitive.Root>
|
||||||
|
>(({ className, value, color, ...props }, ref) => (
|
||||||
|
<ProgressPrimitive.Root ref={ref} className={merge('relative h-1 w-full overflow-hidden rounded-full bg-slate-700', className)}
|
||||||
|
{...props}
|
||||||
|
>
|
||||||
|
<ProgressPrimitive.Indicator className='h-full w-full flex-1 transition-all duration-1000 bg-[#1ed760]' style={{
|
||||||
|
backgroundColor: color,
|
||||||
|
transform: `translateX(-${100 - (value ?? 0)}%)`
|
||||||
|
}} />
|
||||||
|
</ProgressPrimitive.Root>
|
||||||
|
))
|
||||||
|
Progress.displayName = ProgressPrimitive.Root.displayName
|
||||||
|
|
||||||
|
export { Progress }
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
'use client'
|
||||||
|
|
||||||
|
import * as React from 'react'
|
||||||
|
import * as SeparatorPrimitive from '@radix-ui/react-separator'
|
||||||
|
|
||||||
|
import { merge } from '@/lib/utils'
|
||||||
|
|
||||||
|
const Separator = React.forwardRef<
|
||||||
|
React.ElementRef<typeof SeparatorPrimitive.Root>,
|
||||||
|
React.ComponentPropsWithoutRef<typeof SeparatorPrimitive.Root>
|
||||||
|
>(({ className, ...props }, ref) => (
|
||||||
|
<div ref={ref} className={merge('mx-auto bg-border border-t w-11/12', className)}
|
||||||
|
{...props}
|
||||||
|
/>
|
||||||
|
))
|
||||||
|
Separator.displayName = SeparatorPrimitive.Root.displayName
|
||||||
|
|
||||||
|
export { Separator }
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
import { merge } from '@/lib/utils'
|
||||||
|
|
||||||
|
const Skeleton = ({className, ...props}: React.HTMLAttributes<HTMLDivElement>) => {
|
||||||
|
return (
|
||||||
|
<div className={merge('animate-pulse rounded-md bg-muted', className)}
|
||||||
|
{...props}
|
||||||
|
/>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export { Skeleton }
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
'use client'
|
||||||
|
|
||||||
|
import * as React from 'react'
|
||||||
|
import * as TooltipPrimitive from '@radix-ui/react-tooltip'
|
||||||
|
|
||||||
|
import { merge } from '@/lib/utils'
|
||||||
|
|
||||||
|
const TooltipProvider = TooltipPrimitive.Provider
|
||||||
|
const TooltipTrigger = TooltipPrimitive.Trigger
|
||||||
|
const Tooltip = TooltipPrimitive.Root
|
||||||
|
|
||||||
|
const TooltipContent = React.forwardRef<
|
||||||
|
React.ElementRef<typeof TooltipPrimitive.Content>,
|
||||||
|
React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content>
|
||||||
|
>(({ className, sideOffset = 4, ...props }, ref) => (
|
||||||
|
<TooltipPrimitive.Content ref={ref} sideOffset={sideOffset} className={merge('z-50 overflow-hidden rounded-xl bg-muted px-3 py-1 text-sm text-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2', className)}
|
||||||
|
{...props}
|
||||||
|
/>
|
||||||
|
))
|
||||||
|
TooltipContent.displayName = TooltipPrimitive.Content.displayName
|
||||||
|
|
||||||
|
export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider }
|
||||||
@@ -0,0 +1,115 @@
|
|||||||
|
import type { PlatformModel } from '@/lib/platform'
|
||||||
|
import { PlatformIcon } from '@/lib/utils/icons'
|
||||||
|
|
||||||
|
const { GITHUB_ACCESS_TOKEN, JWT_SECRET, NEXT_BASE_URL } = process.env
|
||||||
|
|
||||||
|
export class Constants {
|
||||||
|
// github constants
|
||||||
|
public static WANTED_REPO_NAME = 'gitbio'
|
||||||
|
public static PAGE_FILE = 'page.json'
|
||||||
|
|
||||||
|
// profile badge
|
||||||
|
public static STAFF_ID = [123418829, 53189968]
|
||||||
|
|
||||||
|
// fetcher
|
||||||
|
public static BASIC_ACCESS_TOKEN = GITHUB_ACCESS_TOKEN
|
||||||
|
|
||||||
|
// jwt
|
||||||
|
public static JWT_SIGNER = new TextEncoder().encode(JWT_SECRET)
|
||||||
|
|
||||||
|
// metadata
|
||||||
|
public static META_TITLE = 'gitbiome'
|
||||||
|
public static META_DESC = 'collect your socials like a developer 💯🔥'
|
||||||
|
public static META_LOGO = `${NEXT_BASE_URL}/favicon.ico`
|
||||||
|
|
||||||
|
// icons
|
||||||
|
public static PLATFORMS: PlatformModel[] = [
|
||||||
|
{
|
||||||
|
url: ['https://github.com/'],
|
||||||
|
color: {
|
||||||
|
light: '#171717',
|
||||||
|
dark: '#f9f9f9'
|
||||||
|
},
|
||||||
|
name: 'github',
|
||||||
|
icon: PlatformIcon.GITHUB
|
||||||
|
},
|
||||||
|
{
|
||||||
|
url: ['https://linkedin.com/in/'],
|
||||||
|
color: '#0077b5',
|
||||||
|
name: 'linkedin',
|
||||||
|
icon: PlatformIcon.LINKEDIN
|
||||||
|
},
|
||||||
|
{
|
||||||
|
url: ['https://instagram.com/'],
|
||||||
|
color: '#e1306c',
|
||||||
|
name: 'instagram',
|
||||||
|
icon: PlatformIcon.INSTAGRAM
|
||||||
|
},
|
||||||
|
{
|
||||||
|
url: ['https://open.spotify.com/user/'],
|
||||||
|
color: '#1db954',
|
||||||
|
name: 'spotify',
|
||||||
|
icon: PlatformIcon.SPOTIFY
|
||||||
|
},
|
||||||
|
{
|
||||||
|
url: ['https://youtube.com/@'],
|
||||||
|
color: '#ff0000',
|
||||||
|
name: 'youtube',
|
||||||
|
icon: PlatformIcon.YOUTUBE
|
||||||
|
},
|
||||||
|
{
|
||||||
|
url: [
|
||||||
|
'https://x.com/',
|
||||||
|
'https://twitter.com/'
|
||||||
|
],
|
||||||
|
color: {
|
||||||
|
light: '#000000',
|
||||||
|
dark: '#ffffff'
|
||||||
|
},
|
||||||
|
name: 'x',
|
||||||
|
icon: PlatformIcon.X
|
||||||
|
},
|
||||||
|
{
|
||||||
|
url: ['https://t.me/'],
|
||||||
|
color: '#0088cc',
|
||||||
|
name: 'telegram',
|
||||||
|
icon: PlatformIcon.TELEGRAM
|
||||||
|
},
|
||||||
|
{
|
||||||
|
url: ['https://pinterest.com/'],
|
||||||
|
color: '#e60023',
|
||||||
|
name: 'pinterest',
|
||||||
|
icon: PlatformIcon.PINTEREST
|
||||||
|
},
|
||||||
|
{
|
||||||
|
url: ['https://soundcloud.com'],
|
||||||
|
color: '#ff7700',
|
||||||
|
name: 'soundcloud',
|
||||||
|
icon: PlatformIcon.SOUNDCLOUD
|
||||||
|
},
|
||||||
|
{
|
||||||
|
url: ['https://paypal.me/'],
|
||||||
|
color: '#00457c',
|
||||||
|
name: 'paypal',
|
||||||
|
icon: PlatformIcon.PAYPAL
|
||||||
|
},
|
||||||
|
{
|
||||||
|
url: ['https://tiktok.com/'],
|
||||||
|
color: '#ff0050',
|
||||||
|
name: 'tiktok',
|
||||||
|
icon: PlatformIcon.TIKTOK
|
||||||
|
},
|
||||||
|
{
|
||||||
|
url: ['https://reddit.com/u/'],
|
||||||
|
color: '#ff5700',
|
||||||
|
name: 'reddit',
|
||||||
|
icon: PlatformIcon.REDDIT
|
||||||
|
},
|
||||||
|
{
|
||||||
|
url: ['https://facebook.com/'],
|
||||||
|
color: '#3b5998',
|
||||||
|
name: 'facebook',
|
||||||
|
icon: PlatformIcon.FACEBOOK
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
import { Constants } from '@/lib/constants'
|
||||||
|
|
||||||
|
export async function fetchWithToken(url: string): Promise<Response> {
|
||||||
|
const response = await fetch(url, {
|
||||||
|
method: 'GET',
|
||||||
|
headers: {
|
||||||
|
'Authorization': `Bearer ${Constants.BASIC_ACCESS_TOKEN}`,
|
||||||
|
},
|
||||||
|
next: { revalidate: 60 }
|
||||||
|
})
|
||||||
|
|
||||||
|
return response
|
||||||
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
import type { ReactElement } from 'react'
|
||||||
|
import { Constants } from '@/lib/constants'
|
||||||
|
import { PlatformIcon } from '@/lib/utils/icons'
|
||||||
|
|
||||||
|
export interface PlatformModel {
|
||||||
|
url: string[]
|
||||||
|
color: string | {
|
||||||
|
light: string
|
||||||
|
dark: string
|
||||||
|
}
|
||||||
|
name: string
|
||||||
|
icon: ReactElement
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getPlatformByUrl(value: string, theme?: 'light' | 'dark'): PlatformModel | undefined {
|
||||||
|
try {
|
||||||
|
const url_obj = new URL(value)
|
||||||
|
const origin = `${url_obj.origin.replace('www.', '')}/`
|
||||||
|
|
||||||
|
let name = value
|
||||||
|
let color = '#335df5'
|
||||||
|
let icon = PlatformIcon.EXTERNAL
|
||||||
|
|
||||||
|
const iconProp = Constants.PLATFORMS.find((platform: PlatformModel) => platform.url.includes(origin))
|
||||||
|
|
||||||
|
if(iconProp) {
|
||||||
|
name = value.split('/').pop()!
|
||||||
|
icon = iconProp.icon
|
||||||
|
color = (iconProp.color as { dark: string, light: string })[theme!] ?? iconProp.color as string
|
||||||
|
}
|
||||||
|
|
||||||
|
return { url: [ value ], name, color, icon } as PlatformModel
|
||||||
|
|
||||||
|
} catch (e: unknown) {
|
||||||
|
//ignored
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
import { GithubService, type RepositoryModel } from '@/lib/services/github'
|
||||||
|
import { fetchWithToken } from '@/lib/fetcher'
|
||||||
|
|
||||||
|
export interface JsonProfileModel {
|
||||||
|
display_name: string
|
||||||
|
bio: string
|
||||||
|
platforms: string[]
|
||||||
|
showcased_repos: RepositoryModel[] | string[]
|
||||||
|
show_views: boolean
|
||||||
|
theme: 'dark' | 'light'
|
||||||
|
background_color: string
|
||||||
|
spotify_ws: string
|
||||||
|
}
|
||||||
|
|
||||||
|
class ContentService extends GithubService {
|
||||||
|
constructor(username: string, private repository: string) {
|
||||||
|
super(username)
|
||||||
|
}
|
||||||
|
|
||||||
|
public async readFileByModel<T>(fileName: string, throwable: boolean): Promise<T | string> {
|
||||||
|
const response = await fetchWithToken(`https://raw.githubusercontent.com/${this.username}/${this.repository}/main/${fileName}`)
|
||||||
|
|
||||||
|
if(!response.ok && throwable)
|
||||||
|
throw new Error(`File (${fileName}) was not found`)
|
||||||
|
|
||||||
|
const extension = fileName.split('.').pop()
|
||||||
|
|
||||||
|
return response?.ok ? (extension === 'json' ? await response.json() as T : await response.text()) : ''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export { ContentService as Service }
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
import { sha256 } from '@/lib/utils'
|
||||||
|
import { Redis } from '@upstash/redis'
|
||||||
|
import { unstable_noStore } from 'next/cache'
|
||||||
|
|
||||||
|
export class DatabaseService {
|
||||||
|
private static redis = Redis.fromEnv()
|
||||||
|
|
||||||
|
public static async incrementViews(username: string, ip: string): Promise<void> {
|
||||||
|
unstable_noStore()
|
||||||
|
|
||||||
|
ip = sha256(ip)
|
||||||
|
|
||||||
|
if(!(await this.redis.sismember(username, ip)))
|
||||||
|
await this.redis.sadd(username, ip)
|
||||||
|
}
|
||||||
|
|
||||||
|
public static async getViews(username: string): Promise<number> {
|
||||||
|
unstable_noStore()
|
||||||
|
|
||||||
|
return await this.redis.scard(username) ?? 0
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,51 @@
|
|||||||
|
import { fetchWithToken } from '@/lib/fetcher'
|
||||||
|
import { colorize } from '@/lib/utils'
|
||||||
|
|
||||||
|
export interface GithubProfileModel {
|
||||||
|
login: string
|
||||||
|
id: number
|
||||||
|
avatar_url: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface RepositoryModel {
|
||||||
|
name: string
|
||||||
|
description: string
|
||||||
|
language: string
|
||||||
|
language_color: string
|
||||||
|
stargazers_count: number
|
||||||
|
forks_count: number
|
||||||
|
latest_commit: string
|
||||||
|
fork: boolean
|
||||||
|
}
|
||||||
|
|
||||||
|
export class GithubService {
|
||||||
|
constructor(protected username: string) { }
|
||||||
|
|
||||||
|
public async getGithubProfile(): Promise<GithubProfileModel> {
|
||||||
|
const response = await fetchWithToken(`https://api.github.com/users/${this.username}`)
|
||||||
|
|
||||||
|
if(!response.ok)
|
||||||
|
throw new Error(`Github profile (${this.username}) was not found`)
|
||||||
|
|
||||||
|
const { login, id, avatar_url } = await response.json() as GithubProfileModel
|
||||||
|
|
||||||
|
return { login, id, avatar_url }
|
||||||
|
}
|
||||||
|
|
||||||
|
public async getRepository(repository: string): Promise<RepositoryModel> {
|
||||||
|
const repoUrl = `https://api.github.com/repos/${this.username}/${repository}`
|
||||||
|
|
||||||
|
const repoResponse = await fetchWithToken(repoUrl)
|
||||||
|
const commitResponse = await fetchWithToken(`${repoUrl}/commits`)
|
||||||
|
|
||||||
|
if(!repoResponse.ok || !commitResponse.ok)
|
||||||
|
throw new Error(`Repository (${repository}) was not found`)
|
||||||
|
|
||||||
|
const { name, description, language, stargazers_count, forks_count, fork } = await repoResponse.json() as RepositoryModel
|
||||||
|
const { 0: { sha: latest_commit }} = await commitResponse.json() as { 0: { sha: string }}
|
||||||
|
|
||||||
|
const language_color = colorize(language)
|
||||||
|
|
||||||
|
return { name, description, language, language_color, stargazers_count, forks_count, latest_commit, fork }
|
||||||
|
}
|
||||||
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,25 @@
|
|||||||
|
export class PlatformIcon {
|
||||||
|
public static GITHUB = <path d='M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12' />
|
||||||
|
public static LINKEDIN = <path d='M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433a2.062 2.062 0 01-2.063-2.065 2.064 2.064 0 112.063 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z' />
|
||||||
|
public static INSTAGRAM = <path d='M7.03.084c-1.277.06-2.149.264-2.91.563a5.874 5.874 0 00-2.124 1.388 5.878 5.878 0 00-1.38 2.127C.321 4.926.12 5.8.064 7.076.008 8.354-.005 8.764.001 12.023c.007 3.259.021 3.667.083 4.947.061 1.277.264 2.149.563 2.911.308.789.72 1.457 1.388 2.123a5.872 5.872 0 002.129 1.38c.763.295 1.636.496 2.913.552 1.278.056 1.689.069 4.947.063 3.257-.007 3.668-.021 4.947-.082 1.28-.06 2.147-.265 2.91-.563a5.881 5.881 0 002.123-1.388 5.881 5.881 0 001.38-2.129c.295-.763.496-1.636.551-2.912.056-1.28.07-1.69.063-4.948-.006-3.258-.02-3.667-.081-4.947-.06-1.28-.264-2.148-.564-2.911a5.892 5.892 0 00-1.387-2.123 5.857 5.857 0 00-2.128-1.38C19.074.322 18.202.12 16.924.066 15.647.009 15.236-.006 11.977 0 8.718.008 8.31.021 7.03.084m.14 21.693c-1.17-.05-1.805-.245-2.228-.408a3.736 3.736 0 01-1.382-.895 3.695 3.695 0 01-.9-1.378c-.165-.423-.363-1.058-.417-2.228-.06-1.264-.072-1.644-.08-4.848-.006-3.204.006-3.583.061-4.848.05-1.169.246-1.805.408-2.228.216-.561.477-.96.895-1.382a3.705 3.705 0 011.379-.9c.423-.165 1.057-.361 2.227-.417 1.265-.06 1.644-.072 4.848-.08 3.203-.006 3.583.006 4.85.062 1.168.05 1.804.244 2.227.408.56.216.96.475 1.382.895.421.42.681.817.9 1.378.165.422.362 1.056.417 2.227.06 1.265.074 1.645.08 4.848.005 3.203-.006 3.583-.061 4.848-.051 1.17-.245 1.805-.408 2.23-.216.56-.477.96-.896 1.38a3.705 3.705 0 01-1.378.9c-.422.165-1.058.362-2.226.418-1.266.06-1.645.072-4.85.079-3.204.007-3.582-.006-4.848-.06m9.783-16.192a1.44 1.44 0 101.437-1.442 1.44 1.44 0 00-1.437 1.442M5.839 12.012a6.161 6.161 0 1012.323-.024 6.162 6.162 0 00-12.323.024M8 12.008A4 4 0 1112.008 16 4 4 0 018 12.008' />
|
||||||
|
public static SPOTIFY = <path d='M12 0C5.4 0 0 5.4 0 12s5.4 12 12 12 12-5.4 12-12S18.66 0 12 0zm5.521 17.34c-.24.359-.66.48-1.021.24-2.82-1.74-6.36-2.101-10.561-1.141-.418.122-.779-.179-.899-.539-.12-.421.18-.78.54-.9 4.56-1.021 8.52-.6 11.64 1.32.42.18.479.659.301 1.02zm1.44-3.3c-.301.42-.841.6-1.262.3-3.239-1.98-8.159-2.58-11.939-1.38-.479.12-1.02-.12-1.14-.6-.12-.48.12-1.021.6-1.141C9.6 9.9 15 10.561 18.72 12.84c.361.181.54.78.241 1.2zm.12-3.36C15.24 8.4 8.82 8.16 5.16 9.301c-.6.179-1.2-.181-1.38-.721-.18-.601.18-1.2.72-1.381 4.26-1.26 11.28-1.02 15.721 1.621.539.3.719 1.02.419 1.56-.299.421-1.02.599-1.559.3z' />
|
||||||
|
public static YOUTUBE = <path d='M23.498 6.186a3.016 3.016 0 00-2.122-2.136C19.505 3.545 12 3.545 12 3.545s-7.505 0-9.377.505A3.017 3.017 0 00.502 6.186C0 8.07 0 12 0 12s0 3.93.502 5.814a3.016 3.016 0 002.122 2.136c1.871.505 9.376.505 9.376.505s7.505 0 9.377-.505a3.015 3.015 0 002.122-2.136C24 15.93 24 12 24 12s0-3.93-.502-5.814zM9.545 15.568V8.432L15.818 12l-6.273 3.568z' />
|
||||||
|
public static X = <path d='M18.901 1.153h3.68l-8.04 9.19L24 22.846h-7.406l-5.8-7.584-6.638 7.584H.474l8.6-9.83L0 1.154h7.594l5.243 6.932zM17.61 20.644h2.039L6.486 3.24H4.298z' />
|
||||||
|
public static TELEGRAM = <path d='M11.944 0A12 12 0 000 12a12 12 0 0012 12 12 12 0 0012-12A12 12 0 0012 0a12 12 0 00-.056 0zm4.962 7.224c.1-.002.321.023.465.14a.506.506 0 01.171.325c.016.093.036.306.02.472-.18 1.898-.962 6.502-1.36 8.627-.168.9-.499 1.201-.82 1.23-.696.065-1.225-.46-1.9-.902-1.056-.693-1.653-1.124-2.678-1.8-1.185-.78-.417-1.21.258-1.91.177-.184 3.247-2.977 3.307-3.23.007-.032.014-.15-.056-.212s-.174-.041-.249-.024c-.106.024-1.793 1.14-5.061 3.345-.48.33-.913.49-1.302.48-.428-.008-1.252-.241-1.865-.44-.752-.245-1.349-.374-1.297-.789.027-.216.325-.437.893-.663 3.498-1.524 5.83-2.529 6.998-3.014 3.332-1.386 4.025-1.627 4.476-1.635z' />
|
||||||
|
public static PINTEREST = <path d='M12.017 0C5.396 0 .029 5.367.029 11.987c0 5.079 3.158 9.417 7.618 11.162-.105-.949-.199-2.403.041-3.439.219-.937 1.406-5.957 1.406-5.957s-.359-.72-.359-1.781c0-1.663.967-2.911 2.168-2.911 1.024 0 1.518.769 1.518 1.688 0 1.029-.653 2.567-.992 3.992-.285 1.193.6 2.165 1.775 2.165 2.128 0 3.768-2.245 3.768-5.487 0-2.861-2.063-4.869-5.008-4.869-3.41 0-5.409 2.562-5.409 5.199 0 1.033.394 2.143.889 2.741.099.12.112.225.085.345-.09.375-.293 1.199-.334 1.363-.053.225-.172.271-.401.165-1.495-.69-2.433-2.878-2.433-4.646 0-3.776 2.748-7.252 7.92-7.252 4.158 0 7.392 2.967 7.392 6.923 0 4.135-2.607 7.462-6.233 7.462-1.214 0-2.354-.629-2.758-1.379l-.749 2.848c-.269 1.045-1.004 2.352-1.498 3.146 1.123.345 2.306.535 3.55.535 6.607 0 11.985-5.365 11.985-11.987C23.97 5.39 18.592.026 11.985.026L12.017 0z' />
|
||||||
|
public static SOUNDCLOUD = <path d='M1.175 12.225c-.051 0-.094.046-.101.1l-.233 2.154.233 2.105c.007.058.05.098.101.098.05 0 .09-.04.099-.098l.255-2.105-.27-2.154c0-.057-.045-.1-.09-.1m-.899.828c-.06 0-.091.037-.104.094L0 14.479l.165 1.308c0 .055.045.094.09.094s.089-.045.104-.104l.21-1.319-.21-1.334c0-.061-.044-.09-.09-.09m1.83-1.229c-.061 0-.12.045-.12.104l-.21 2.563.225 2.458c0 .06.045.12.119.12.061 0 .105-.061.121-.12l.254-2.474-.254-2.548c-.016-.06-.061-.12-.121-.12m.945-.089c-.075 0-.135.06-.15.135l-.193 2.64.21 2.544c.016.077.075.138.149.138.075 0 .135-.061.15-.15l.24-2.532-.24-2.623a.134.134 0 00-.135-.135l-.031-.017zm1.155.36a.155.155 0 00-.159-.149c-.09 0-.158.06-.164.149l-.217 2.43.2 2.563c0 .09.075.157.159.157.074 0 .148-.068.148-.158l.227-2.563-.227-2.444.033.015zm.809-1.709c-.101 0-.18.09-.18.181l-.21 3.957.187 2.563c0 .09.08.164.18.164.094 0 .174-.09.18-.18l.209-2.563-.209-3.972c-.008-.104-.088-.18-.18-.18m.959-.914a.211.211 0 00-.203.194l-.18 4.872.165 2.548c0 .12.09.209.195.209.104 0 .194-.089.21-.209l.193-2.548-.192-4.856c-.016-.12-.105-.21-.21-.21m.989-.449c-.121 0-.211.089-.225.209l-.165 5.275.165 2.52c.014.119.104.225.225.225a.231.231 0 00.225-.225l.195-2.52-.196-5.275a.23.23 0 00-.225-.225m1.245.045a.237.237 0 00-.24-.24.247.247 0 00-.24.24l-.149 5.441.149 2.503c.016.135.121.24.256.24s.24-.105.24-.24l.164-2.503-.164-5.456-.016.015zm.749-.134a.262.262 0 00-.255.254l-.15 5.322.15 2.473c0 .15.12.255.255.255s.255-.12.255-.27l.15-2.474-.165-5.307a.27.27 0 00-.271-.27m1.005.166a.285.285 0 00-.284.285l-.103 5.143.135 2.474c0 .149.119.277.284.277.149 0 .271-.12.284-.285l.121-2.443-.135-5.112c-.012-.164-.135-.285-.285-.285m1.184-.945a.31.31 0 00-.165-.044.313.313 0 00-.165.044.3.3 0 00-.149.255v.061l-.104 6.048.115 2.449v.008c.008.06.03.135.074.18a.327.327 0 00.234.104c.08 0 .158-.044.209-.09a.314.314 0 00.091-.225l.015-.24.117-2.203-.135-6.086a.287.287 0 00-.135-.239l-.002-.022zm1.006-.547a.193.193 0 00-.15-.061.344.344 0 00-.209.061.314.314 0 00-.119.24v.029l-.137 6.609.076 1.215.061 1.185c0 .164.148.314.328.314.181 0 .33-.15.33-.329l.15-2.414-.15-6.637a.333.333 0 00-.165-.277m8.934 3.777a2.93 2.93 0 00-1.139.232 5.204 5.204 0 00-5.188-4.736c-.659 0-1.305.135-1.889.359-.225.09-.27.18-.285.359v9.368c.016.18.15.33.33.345h8.185C22.681 17.218 24 15.914 24 14.28s-1.319-2.952-2.938-2.952' />
|
||||||
|
public static PAYPAL = <path d='M7.016 19.198h-4.2a.562.562 0 01-.555-.65L5.093.584A.692.692 0 015.776 0h7.222c3.417 0 5.904 2.488 5.846 5.5-.006.25-.027.5-.066.747A6.794 6.794 0 0112.071 12H8.743a.69.69 0 00-.682.583l-.325 2.056-.013.083-.692 4.39-.015.087zM19.79 6.142c-.01.087-.01.175-.023.261a7.76 7.76 0 01-7.695 6.598H9.007l-.283 1.795-.013.083-.692 4.39-.134.843-.014.088H6.86l-.497 3.15a.562.562 0 00.555.65h3.612c.34 0 .63-.249.683-.585l.952-6.031a.692.692 0 01.683-.584h2.126a6.793 6.793 0 006.707-5.752c.306-1.95-.466-3.744-1.89-4.906z' />
|
||||||
|
public static TIKTOK = <path d='M12.525.02c1.31-.02 2.61-.01 3.91-.02.08 1.53.63 3.09 1.75 4.17 1.12 1.11 2.7 1.62 4.24 1.79v4.03c-1.44-.05-2.89-.35-4.2-.97-.57-.26-1.1-.59-1.62-.93-.01 2.92.01 5.84-.02 8.75-.08 1.4-.54 2.79-1.35 3.94-1.31 1.92-3.58 3.17-5.91 3.21-1.43.08-2.86-.31-4.08-1.03-2.02-1.19-3.44-3.37-3.65-5.71-.02-.5-.03-1-.01-1.49.18-1.9 1.12-3.72 2.58-4.96 1.66-1.44 3.98-2.13 6.15-1.72.02 1.48-.04 2.96-.04 4.44-.99-.32-2.15-.23-3.02.37-.63.41-1.11 1.04-1.36 1.75-.21.51-.15 1.07-.14 1.61.24 1.64 1.82 3.02 3.5 2.87 1.12-.01 2.19-.66 2.77-1.61.19-.33.4-.67.41-1.06.1-1.79.06-3.57.07-5.36.01-4.03-.01-8.05.02-12.07z' />
|
||||||
|
public static REDDIT = <path d='M12 0C5.373 0 0 5.373 0 12c0 3.314 1.343 6.314 3.515 8.485l-2.286 2.286A.72.72 0 001.738 24H12c6.627 0 12-5.373 12-12S18.627 0 12 0zm4.388 3.199a1.999 1.999 0 11-1.947 2.46v.002a2.368 2.368 0 00-2.032 2.341v.007c1.776.067 3.4.567 4.686 1.363a2.802 2.802 0 112.908 4.753c-.088 3.256-3.637 5.876-7.997 5.876-4.361 0-7.905-2.617-7.998-5.87a2.8 2.8 0 011.189-5.34c.645 0 1.239.218 1.712.585 1.275-.79 2.881-1.291 4.64-1.365v-.01a3.229 3.229 0 012.88-3.207 2 2 0 011.959-1.595zm-8.085 8.376c-.784 0-1.459.78-1.506 1.797-.047 1.016.64 1.429 1.426 1.429.786 0 1.371-.369 1.418-1.385.047-1.017-.553-1.841-1.338-1.841zm7.406 0c-.786 0-1.385.824-1.338 1.841.047 1.017.634 1.385 1.418 1.385.785 0 1.473-.413 1.426-1.429-.046-1.017-.721-1.797-1.506-1.797zm-3.703 4.013c-.974 0-1.907.048-2.77.135a.222.222 0 00-.183.305 3.199 3.199 0 002.953 1.964 3.2 3.2 0 002.953-1.964.222.222 0 00-.184-.305 27.75 27.75 0 00-2.769-.135z' />
|
||||||
|
public static FACEBOOK = <path d='M9.101 23.691v-7.98H6.627v-3.667h2.474v-1.58c0-4.085 1.848-5.978 5.858-5.978.401 0 .955.042 1.468.103a8.68 8.68 0 011.141.195v3.325a8.623 8.623 0 00-.653-.036 26.805 26.805 0 00-.733-.009c-.707 0-1.259.096-1.675.309a1.686 1.686 0 00-.679.622c-.258.42-.374.995-.374 1.752v1.297h3.919l-.386 2.103-.287 1.564h-3.246v8.245C19.396 23.238 24 18.179 24 12.044c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.628 3.874 10.35 9.101 11.647z' />
|
||||||
|
public static EXTERNAL = (
|
||||||
|
<switch>
|
||||||
|
<g>
|
||||||
|
<path d='M60 120C26.9 120 0 93.1 0 60S26.9 0 60 0s60 26.9 60 60-26.9 60-60 60zM60 5C29.7 5 5 29.7 5 60s24.7 55 55 55 55-24.7 55-55S90.3 5 60 5z' />
|
||||||
|
<path d='M60 120c-19.3 0-34.4-26.4-34.4-60S40.7 0 60 0s34.4 26.4 34.4 60-15.1 60-34.4 60zM60 5C43.8 5 30.5 29.7 30.5 60s13.2 55 29.5 55 29.5-24.7 29.5-55S76.2 5 60 5z' />
|
||||||
|
<path d='M12.2 25.6h95.6v5H12.2zm0 63.9h95.6v5H12.2zm-9.7-32h115v5H2.5z' />
|
||||||
|
<path d='M57.5 2.5h5v115h-5z' />
|
||||||
|
</g>
|
||||||
|
</switch>
|
||||||
|
)
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
import { clsx, type ClassValue } from 'clsx'
|
||||||
|
import { twMerge } from 'tailwind-merge'
|
||||||
|
import { createHash } from 'crypto'
|
||||||
|
|
||||||
|
import colors from '@/lib/utils/colors.json'
|
||||||
|
|
||||||
|
export const randomize = (param: string | number): number => {
|
||||||
|
const additive = typeof param === 'string'
|
||||||
|
? param.length
|
||||||
|
: param
|
||||||
|
|
||||||
|
return Math.ceil(Date.now() * Math.random()) + additive
|
||||||
|
}
|
||||||
|
export const timeformat = (ms: number): string => {
|
||||||
|
const min = Math.floor((ms/1000/60) << 0)
|
||||||
|
const sec = Math.floor((ms/1000) % 60)
|
||||||
|
|
||||||
|
return `${min}:${sec < 10 ? '0' : ''}${sec}`
|
||||||
|
}
|
||||||
|
export const sha256 = (str: string) => createHash('sha256').update(str).digest('hex');
|
||||||
|
export const merge = (...inputs: ClassValue[]) => twMerge(clsx(inputs))
|
||||||
|
export const truncate = (str: string, n: number, show_dots?: boolean) => str.length > n ? str.slice(0, n - 1) + (show_dots ? '...' : '') : str
|
||||||
|
export const colorize = (language: string): string => (colors as unknown as Record<string, { color: string}>)[language]?.color ?? '#bababa'
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
import { type NextRequest, NextResponse } from 'next/server'
|
||||||
|
|
||||||
|
const { NEXT_BASE_HOST } = process.env
|
||||||
|
|
||||||
|
export const config = {
|
||||||
|
matcher: [ '/((?!api/|_next/|_static/|_vercel|[\\w-]+\\.\\w+).*)' ]
|
||||||
|
}
|
||||||
|
|
||||||
|
export default async function middleware(req: NextRequest) {
|
||||||
|
const url = req.nextUrl
|
||||||
|
|
||||||
|
const subdomain = req.headers
|
||||||
|
.get('host')!
|
||||||
|
.replace(`.${NEXT_BASE_HOST}`, '')
|
||||||
|
|
||||||
|
if(subdomain && subdomain !== NEXT_BASE_HOST)
|
||||||
|
url.pathname = `/${subdomain}${url.pathname}`
|
||||||
|
|
||||||
|
return NextResponse.rewrite(url)
|
||||||
|
}
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
import type { Config } from 'tailwindcss'
|
||||||
|
|
||||||
|
const config: Config = {
|
||||||
|
content: [
|
||||||
|
'./src/components/**/*.{js,ts,jsx,tsx,mdx}',
|
||||||
|
'./src/app/**/*.{js,ts,jsx,tsx,mdx}',
|
||||||
|
],
|
||||||
|
theme: {
|
||||||
|
container: {
|
||||||
|
center: true,
|
||||||
|
padding: '2rem',
|
||||||
|
screens: {
|
||||||
|
'2xl': '1400px'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
extend: {
|
||||||
|
colors: {
|
||||||
|
border: 'hsl(var(--border))',
|
||||||
|
background: 'hsl(var(--background))',
|
||||||
|
foreground: 'hsl(var(--foreground))',
|
||||||
|
card: {
|
||||||
|
DEFAULT: 'hsl(var(--card))',
|
||||||
|
foreground: 'hsl(var(--card-foreground))'
|
||||||
|
},
|
||||||
|
muted: {
|
||||||
|
DEFAULT: 'hsl(var(--muted))',
|
||||||
|
foreground: 'hsl(var(--muted-foreground))'
|
||||||
|
},
|
||||||
|
badge: {
|
||||||
|
DEFAULT: 'hsl(var(--badge))',
|
||||||
|
foreground: 'hsl(var(--badge-foreground))'
|
||||||
|
},
|
||||||
|
destructive: {
|
||||||
|
DEFAULT: 'hsl(var(--destructive))',
|
||||||
|
foreground: 'hsl(var(--destructive-foreground))'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
plugins: [require('tailwindcss-animate')]
|
||||||
|
}
|
||||||
|
|
||||||
|
export default config
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
/* Base Options: */
|
||||||
|
"esModuleInterop": true,
|
||||||
|
"skipLibCheck": true,
|
||||||
|
"target": "es2022",
|
||||||
|
"allowJs": true,
|
||||||
|
"resolveJsonModule": true,
|
||||||
|
"moduleDetection": "force",
|
||||||
|
"isolatedModules": true,
|
||||||
|
|
||||||
|
/* Strictness */
|
||||||
|
"strict": true,
|
||||||
|
"noUncheckedIndexedAccess": true,
|
||||||
|
"checkJs": true,
|
||||||
|
|
||||||
|
/* Bundled projects */
|
||||||
|
"lib": ["dom", "dom.iterable", "ES2022"],
|
||||||
|
"noEmit": true,
|
||||||
|
"module": "ESNext",
|
||||||
|
"moduleResolution": "Bundler",
|
||||||
|
"jsx": "preserve",
|
||||||
|
"plugins": [{ "name": "next" }],
|
||||||
|
"incremental": true,
|
||||||
|
|
||||||
|
/* Path Aliases */
|
||||||
|
"baseUrl": "src",
|
||||||
|
"paths": {
|
||||||
|
"@/*": ["./*"]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"include": [
|
||||||
|
".eslintrc.js",
|
||||||
|
"next-env.d.ts",
|
||||||
|
"**/*.ts",
|
||||||
|
"**/*.tsx",
|
||||||
|
"**/*.cjs",
|
||||||
|
"**/*.js",
|
||||||
|
".next/types/**/*.ts",
|
||||||
|
"next.config.mjs",
|
||||||
|
"postcss.config.mjs",
|
||||||
|
"tailwind.config.ts",
|
||||||
|
],
|
||||||
|
"exclude": ["node_modules"]
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user