Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
zobweyt committed Sep 21, 2024
0 parents commit 522d608
Show file tree
Hide file tree
Showing 154 changed files with 11,311 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
VITE_APP_NAME=$npm_package_name
VITE_APP_VERSION=$npm_package_version

VITE_API_URL="http://127.0.0.1:8000/"

# Must be at least 32 characters long
VITE_SESSION_SECRET="replacewithyoursupersessionsecret"

# Make sure to enable this when have an SSL (HTTPS) certificate
VITE_SECURE_COOKIES=
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Set default behavior to automatically normalize line endings.
* text=auto
31 changes: 31 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# General
dist
.solid
.output
.vercel
.netlify
.vinxi

# Environment
.env
.env*.local

# dependencies
/node_modules

# IDEs and editors
/.vs
/.vscode
/.idea
.project
.classpath
*.launch
.settings/

# Temp
gitignore
app.config.timestamp*

# System Files
.DS_Store
Thumbs.db
6 changes: 6 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"tabWidth": 2,
"useTabs": false,
"printWidth": 120,
"plugins": ["prettier-plugin-tailwindcss"]
}
21 changes: 21 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2024 Quotepedia

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
77 changes: 77 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# Quotepedia front-end

## 📃 Prerequisites

To run the frontend at your local machine, install the following:

- [pnPm](https://pnpm.io/installation): Fast, disk space efficient package manager.

## 📦 Building from source

To start, open a command prompt and follow these instructions:

### Step 1 — Install dependencies

```sh
pnpm i
```

### Step 2 — Configure the environment

Create `.env` file in the root directory with the following contents:

```properties
VITE_APP_NAME=$npm_package_name
VITE_APP_VERSION=$npm_package_version

VITE_API_URL="http://127.0.0.1:8000/"

VITE_SESSION_SECRET="9aCbXMa1%pJcCMubS^HuprJ5YjS&#xY5"
VITE_SECURE_COOKIES=
```

These settings are suitable for the most who want to run the app **locally**. Here's a more detailed and advanced explanation of each configuration option:

| Option | Description | Type | Default | Required |
| --------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------- | ------- | -------- |
| `VITE_APP_NAME` | The web app name. | `string` | ||
| `VITE_APP_VERSION` | The web app version. | `string` | ||
| `VITE_API_URL` | URL of the API server that the web app will interact with. You may also want to [setup back-end](../backend/README) to get it first. | `string` | ||
| `VITE_SESSION_SECRET` | Private key used to encrypt sessions. **Must be at least 32 characters long**. | `string` | ||
| `VITE_SECURE_COOKIES` | Determines whether the cookies sent to browser should be marked as [secure](https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies#block_access_to_your_cookies). Make sure to enable this when have an SSL (HTTPS) certificate. | `boolean` | `false` ||

> [!NOTE]
> You can also browse all available configuration options [here](./src/global.d.ts).
### Step 3 — Run the app

To build and start the app, just execute the following command:

```sh
pnpm serve
```

The setup is done. Enjoy using this! 🎉

## 🛟 FAQ

### Error | Uncaught Client Exception

Make sure `VITE_SECURE_COOKIES` is not set to `true` or you have a valid SSL (HTTPS) certificate.

### Error: Empty password

`VITE_SESSION_SECRET` Configuration option is not set. Make sure to re-read the [step 2](#step-2--configure-the-environment) and clear browser cookies.

> [!NOTE]
> You may also need to **re-build** the web app using `pnpm serve` or `pnpm build` to include newly configured options in `.env`.
### Seroval issue

```
Error
Seroval caught an error during the parsing process.
TypeError
Response.clone: Body has already been consumed.
```
3 changes: 3 additions & 0 deletions app.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { defineConfig } from "@solidjs/start/config";

export default defineConfig();
49 changes: 49 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
"name": "quotepedia",
"type": "module",
"version": "0.0.0",
"scripts": {
"dev": "vinxi dev",
"build": "vinxi build",
"start": "vinxi start",
"serve": "vinxi build && vinxi start"
},
"dependencies": {
"@corvu/otp-field": "^0.1.2",
"@kobalte/core": "^0.13.6",
"@modular-forms/solid": "^0.23.0",
"@solid-primitives/event-listener": "^2.3.3",
"@solid-primitives/i18n": "^2.1.1",
"@solid-primitives/intersection-observer": "^2.1.6",
"@solid-primitives/storage": "^4.2.1",
"@solid-primitives/upload": "^0.0.117",
"@solidjs/meta": "^0.29.4",
"@solidjs/router": "^0.14.3",
"@solidjs/start": "^1.0.6",
"autoprefixer": "^10.4.20",
"clsx": "^2.1.1",
"lottie-web": "^5.12.2",
"openapi-fetch": "^0.12.0",
"postcss": "^8.4.45",
"solid-heroicons": "^3.2.4",
"solid-js": "^1.8.22",
"solid-sonner": "^0.2.8",
"solid-transition-group": "^0.2.3",
"tailwind-merge": "^2.5.2",
"tailwind-variants": "^0.2.1",
"tailwindcss": "^3.4.10",
"vinxi": "^0.4.2"
},
"devDependencies": {
"openapi-typescript": "^7.4.0",
"picocolors": "^1.1.0",
"postcss-mixins": "^10.0.1",
"prettier": "^3.3.3",
"prettier-plugin-tailwindcss": "^0.6.6",
"typescript": "^5.5.4"
},
"engines": {
"node": ">=18",
"packageManager": "[email protected]"
}
}
Loading

0 comments on commit 522d608

Please sign in to comment.