https://github.com/gabsedits/funfact-generator
Simple Funfact Generator (API & Frontend)
https://github.com/gabsedits/funfact-generator
Last synced: 17 days ago
JSON representation
Simple Funfact Generator (API & Frontend)
- Host: GitHub
- URL: https://github.com/gabsedits/funfact-generator
- Owner: GabsEdits
- License: unlicense
- Created: 2025-01-01T10:50:13.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-01-01T12:19:15.000Z (over 1 year ago)
- Last Synced: 2025-01-01T13:18:52.939Z (over 1 year ago)
- Language: Svelte
- Size: 38.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
Funfact Generator
Generate random fun facts for any occasion, in multiple languages.
Made for Highseas.
## Links
- Frontend: [funfact.gxbs.dev](https://funfact.gxbs.dev)
- API: [funfact-api.deno.dev](https://funfact-api.deno.dev)
## API
For the API, I used [Deno](https://deno.com) and
[Hoco](https://jsr.io/@hoco/hoco).
### Examples
For a random fun fact:
```http
GET https://funfact-api.deno.dev/{language}/random/random
```
`{language}` is the language of the fun fact. Currently, the only supported
For a random history fun fact:
```http
GET https://funfact-api.deno.dev/{language}/random/history
```
`{language}` is the language of the fun fact. Currently, the only supported
languages are:
- `en`: English
- `ro`: Romanian
- `de`: German
For example, if you want to get a random fun fact in English, you would use:
```http
GET https://funfact-api.deno.dev/en/random/random
```
The categories are:
- `random`: Random fun fact from all categories
- `history`: Fun fact from history
- `science`: Fun fact from science
- `geography`: Fun fact from space
### Development
Make sure you have [Deno](https://deno.com) installed.
To start the server, run:
```bash
deno run -NR mod.ts
```
> ![NOTE] Make sure you are in the `api` directory.
## Frontend
### Development
The project is build using [Vite](https://vite.dev) and
[Svelte](https://svelte.dev).
Make sure you have [Deno](https://deno.com) installed.
### Installation
```bash
deno install
```
### Scripts
- `dev`: Start the development server (`deno task dev`)
- `build`: Build the project (`deno task build`)
- `preview`: Serve the build project (`deno task preview`)
## License
This project is licensed under the GNU Affero General Public License v3.0. See
the [LICENSE](LICENSE.txt) file for more information.