https://github.com/chilfish/chilpost
https://github.com/chilfish/chilpost
clone-website mysql nuxt posts vue
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/chilfish/chilpost
- Owner: Chilfish
- License: mit
- Created: 2023-08-01T03:14:10.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-12-30T15:03:22.000Z (about 2 years ago)
- Last Synced: 2025-03-21T21:23:06.386Z (11 months ago)
- Topics: clone-website, mysql, nuxt, posts, vue
- Language: TypeScript
- Homepage: https://chilpost.vercel.app
- Size: 1.24 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
### Chill Post App
An another https://x.com like app, it's very simple, but it's a good practice for me to learn the nuxt3 and mysql.
Build with Nuxt3 + nodejs/MySql2 + jose/jws
> I'm looking for the mysql hosting service, so the online preview is not fully available now.
Also, I am trying to use kotlin + spring boot + exposed to build the another backend version. Kotlin is so cool!😍 It's still in development, but you can preview it at [chilpost-sb](https://github.com/Chilfish/chilpost-sb/). Then set the `API_PROXY` to `http://localhost:8080` in the `.env` file.
### Features
- **Error handling**: I'am trying to handle the errors unitedly at [errorHandler.ts](./server/error/newError.ts). So that it's unnecessary to try-catch everywhere, nitro will catch it. But I am not sure if it is a good practice.
- **Authentication**: I am using **[jws]** for authentication. That's signatured jwt. The public key and private key are stored in the environment variable. The public key is used to verify the token, and the private key is used to sign the token. The token is stored in the cookie.
### Start
```bash
pnpm i
pnpm dev
```
then rename the `.env.example` to `.env` and fill the environment variables in it.
### Build
In production mode, you need to set the environment variables in Vercel, see `.env.example` for reference. (at `https://vercel.com/${your_name}/todo-ender/settings/environment-variables`).
Note that, you should generate the `PUBLIC_KEY` and `PRIVATE_KEY` by yourself (You can generate them at https://jwt.rocks/).
### Docker support
Now you can use docker to run the app🥳.
```bash
docker-compose up -d
```