Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/daniel-le97/next-pocket
Discord Clone with Next.js built into a pocketbase instance all in one executable
https://github.com/daniel-le97/next-pocket
Last synced: 24 days ago
JSON representation
Discord Clone with Next.js built into a pocketbase instance all in one executable
- Host: GitHub
- URL: https://github.com/daniel-le97/next-pocket
- Owner: daniel-le97
- Created: 2023-02-10T21:56:57.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-12-15T05:16:55.000Z (about 1 year ago)
- Last Synced: 2024-12-09T14:57:53.997Z (about 1 month ago)
- Language: TypeScript
- Homepage:
- Size: 5.44 MB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Next-Pocket
This project is a Discord clone that uses next.js and pocketbase. It builds next.js into pocketbase to be deployed as a single executeable.## Notes
Originally this project started off as a simple chat app to test out pocketbase, as such adding voice and video channels were never on the scope.## Getting Started
Fork this project
### client (Next.js)
```node
cd clientnpm install
npm run dev // for dev mode
```
your next.js project is now available at http://localhost:3000
### Server (PocketBase)
```go
cd pocketbasego get -u // go ^1.19 is needed
task start
```
pocketbase and its client UI are now available at http://localhost:8080
# Developement
you will notice after starting the server and going to the pocketbase client ui
at http://localhost:8080/_/ you wont have any collections
```
// if you are in the client directory and the envs defined in scripts/pb_schema.js are set
// this will sync your local and remote schemasnpm run pb:schema
```
### Or copy the contents of pocketbase/pb_schema.json
now you'll need to go to your pocketbase client and navigate to settings => import collections and paste the pb_schema.json there### Getting your pocketbase types updated
this project uses npx pocketbase-typegen from (https://github.com/patmood/pocketbase-typegen)
```
// before running this please make sure the envs defined in
// client/scripts/gen.js are set or hardcode them there and add the file to .gitignorenpm run pb:gen
```
# Deployment
To deploy this project run```node
npm run build-serve
```
- this will build your next.js frontend into pocketbase to allow pocketbase to serve your app for easier deployment
- now you can point any deployment provider that supports docker to the dockerfile in the pocketbase directory!
- or check [@pocketbase](https://pocketbase.io/docs/going-to-production)#### Alternatively
For seperate apps run
```node
npm run build
```an example docker compose can be found at pocketbase/docker-compose.yml
## Authors
- [@Daniel Le](https://www.github.com/daniel-le97)
- [@Tung Le](https://www.github.com/TungLe0319)
- [@Tri Le](https://www.github.com/trile1122)