102 lines
2.5 KiB
Markdown
102 lines
2.5 KiB
Markdown
# BlogPop
|
|
|
|
[](https://git.pontusmail.org/abocn/blogpop)
|
|
|
|
A simple blogging platform built with Next.js, shadcn/ui and Tailwind CSS.
|
|
|
|
## Bun/Node Setup
|
|
|
|
1. **Clone repository**
|
|
|
|
```bash
|
|
git clone https://git.pontusmail.org/abocn/blogpop.git
|
|
cd blogpop
|
|
```
|
|
|
|
2. **Install dependencies and copy files**
|
|
|
|
**Frontend:**
|
|
|
|
```bash
|
|
npm install # npm
|
|
bun install # or bun
|
|
```
|
|
|
|
**Backend:**
|
|
|
|
```bash
|
|
cd server/
|
|
bun install
|
|
```
|
|
|
|
**Copy example .env:**
|
|
|
|
```bash
|
|
cd .. # if you are currently in the server/ directory
|
|
cp .env.example .env
|
|
nano .env # edit if you desire
|
|
```
|
|
|
|
3. **Setup backend**
|
|
|
|
Next, you must perform the initial setup of the database, which can be done with our easy setup tool. To start, ensure you `cd` into the `server/` folder.
|
|
|
|
Then, simply execute the below command and follow the prompts:
|
|
|
|
```bash
|
|
bun setup.js
|
|
```
|
|
|
|
4. **Start server**
|
|
|
|
Starting a dev server with Node or Bun requires two terminals. One will output the log files for the backend, and the other will output the log files for the frontend.
|
|
|
|
**Start a dev server:**
|
|
|
|
```bash
|
|
bun dev # Terminal 1
|
|
cd server/ # Terminal 2
|
|
bun index.js # Terminal 2
|
|
```
|
|
|
|
*OR*
|
|
|
|
```bash
|
|
npm run dev # Terminal 1
|
|
cd server/ # Terminal 2
|
|
node index.js # Terminal 2
|
|
```
|
|
|
|
Whichever option you selected, your frontend will be served on port `3000` by default, though you can change that in your `.env` file. The API will be accessible on `3001`.
|
|
|
|
**Start production server:**
|
|
|
|
Starting a production server with Node or Bun will also require two terminals. One will output the log files for the backend, and the other will output the log files for the frontend.
|
|
|
|
```bash
|
|
bun run build # Terminal 1
|
|
bun start # Terminal 1
|
|
cd server/ # Terminal 2
|
|
node index.js # Terminal 2
|
|
```
|
|
|
|
*OR*
|
|
|
|
```bash
|
|
bun run build # Terminal 1
|
|
bun start # Terminal 1
|
|
cd server/ # Terminal 2
|
|
node index.js # Terminal 2
|
|
```
|
|
|
|
Whichever option you selected, your frontend will be served on port `3000` by default, though you can change that in your `.env` file. The API will be accessible on `3001`.
|
|
|
|
## To-Do
|
|
|
|
- [ ] Implement a logout animation on `/admin/logout`
|
|
- [ ] Add a post list w/ management options on `/admin/posts`
|
|
- [ ] Add a user list w/ management options in `/admin/users`
|
|
- [ ] Better error handling in `server/index.js`
|
|
- [ ] Setup strings file for `server/setup.js`
|
|
- [ ] @lucmsilva - Implement `pt-BR` Translation
|