Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pubkeyapp/pubkey-stack
A starter to generate apps using the PubKey stack. Nx, Nest, Prisma, GraphQL, React, Mantine, advanced code generators and more... Join our Discord for questions.
https://github.com/pubkeyapp/pubkey-stack
Last synced: about 1 month ago
JSON representation
A starter to generate apps using the PubKey stack. Nx, Nest, Prisma, GraphQL, React, Mantine, advanced code generators and more... Join our Discord for questions.
- Host: GitHub
- URL: https://github.com/pubkeyapp/pubkey-stack
- Owner: pubkeyapp
- License: mit
- Created: 2023-08-08T12:56:34.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-08-18T00:16:06.000Z (4 months ago)
- Last Synced: 2024-08-18T01:25:35.561Z (4 months ago)
- Language: TypeScript
- Homepage: https://discord.gg/XxuZQeDPNf
- Size: 1.9 MB
- Stars: 6
- Watchers: 0
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome - pubkeyapp/pubkey-stack - A starter to generate apps using the PubKey stack. Nx, Nest, Prisma, GraphQL, React, Mantine, advanced code generators and more... Join our Discord for questions. (TypeScript)
- solana-awesome - Link
README
# PubKey Stack
## Getting Started
### Prerequisites
- Node v18 or higher
- PNPM
- Docker### Installation
Clone the repo and install dependencies:
```shell
git clone [email protected]:pubkeyapp/pubkey-stack.git
cd pubkey-stack
pnpm
```### Automatic setup
You can run the automatic setup script to create the `.env` file, test the setup and push the database schema.
```shell
pnpm setup
```### Environment variables
Copy the `.env.example` file to `.env` and fill in the missing values.
```shell
cp .env.example .env
```### Starting the services
You will need to start the database before starting the backend.
```shell
pnpm dev:services
```### Pushing the database schema
If you start from scratch, you will need to push the database schema to the database.
```shell
pnpm prisma db push
```Also, after each change to the schema in `prisma/schema.prisma`, you will need to run the above command again.
### Starting the API
```shell
pnpm dev:api
```### Starting the web ui
```shell
pnpm dev:web
```### Starting the SDK generator
```shell
pnpm dev:sdk
```## Extending the application
You can use the following commands to generate new models, API features, web features and SDK types.
### Adding a new model
The following command will generate a new model in `prisma/schema.prisma`.
You will need to run `pnpm prisma db push` to push the schema to the database.
```shell
pnpm nx g prisma-model company
```Output:
```shell
> NX Generating @pubkey-stack/tools:prisma-modelUPDATE prisma/schema.prisma
```### Adding a new API feature
The following command will generate a new API feature in `libs/api/company/*`.
You will need to restart the API server to make sure it picks up the new libraries.
```shell
pnpm nx g api-feature company
```Output:
```shell
> NX Generating @pubkey-stack/tools:api-featureCREATE libs/api/company/data-access/...
CREATE libs/api/company/feature/...
UPDATE libs/api/core/feature/src/lib/api-core-feature.module.ts
CREATE libs/sdk/src/graphql/feature-company.graphql
CREATE apps/api-e2e/src/api/api-company-feature.spec.ts
```### Adding a new web feature
The following command will generate a new web feature in `libs/web/company/*`.
You will need to restart the web server to make sure it picks up the new libraries.
```shell
pnpm nx g web-feature company
```Output:
```shell
> NX Generating @pubkey-stack/tools:web-featureCREATE libs/web/company/data-access/...
CREATE libs/web/company/feature/...
CREATE libs/web/company/ui/...
UPDATE libs/web/shell/feature/src/lib/shell-admin-routes.tsx
UPDATE tsconfig.base.json
```