-
Notifications
You must be signed in to change notification settings - Fork 301
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
916f7d9
commit 925c06e
Showing
3 changed files
with
17 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -64,46 +64,38 @@ git clone [email protected]:stack-auth/stack.git | |
cd stack | ||
``` | ||
|
||
Pre-populated `.env` files for the setup below are available and used by default in `.env.development` in each package. Copy all the `.env.development` files to `.env.local` in the respective packages for local development. | ||
Pre-populated .env files for the setup below are available and used by default in `.env.development` in each of the packages. (Note: If you're creating a production build (eg. with `pnpm run build`), you must supply the environment variables manually.) | ||
|
||
In a terminal, start the dependencies (Postgres and Inbucket) as Docker containers: | ||
|
||
```sh | ||
docker compose -f dependencies.compose.yaml up | ||
``` | ||
|
||
Then open a new terminal: | ||
In a new terminal: | ||
|
||
```sh | ||
pnpm install | ||
|
||
# Build everything once | ||
pnpm run build | ||
# Run build to build everything once | ||
pnpm run build:dev | ||
|
||
# Initialize the database and seed it with some data | ||
pnpm prisma db push | ||
pnpm prisma db seed | ||
|
||
# Run code generation (repeat this after e.g., changing the Prisma schema). This is part of the build script but faster. | ||
pnpm run codegen | ||
# reset & start the dependencies (DB, Inbucket, etc.) as Docker containers, seeding the DB with the Prisma schema | ||
pnpm run start-deps | ||
# pnpm run restart-deps | ||
# pnpm run stop-deps | ||
|
||
# Start the dev server | ||
pnpm run dev | ||
# For systems with limited resources, you can run a minimal development setup with just the backend and dashboard | ||
# pnpm run dev:basic | ||
|
||
# In a different terminal, run tests in watch mode | ||
pnpm run test | ||
``` | ||
|
||
You can now open the dashboard at [http://localhost:8101](http://localhost:8101), the API on port 8102, a demo on port 8103, docs on port 8104, Inbucket (emails) on port 8105, and Prisma Studio on port 8106. | ||
|
||
Your IDE may show errors on all `@stackframe/XYZ` imports. To fix this, restart the TypeScript language server; for example, in VSCode, you can open the command palette (Ctrl+Shift+P) and run `Developer: Reload Window` or `TypeScript: Restart TS server`. | ||
You can now open the dev launchpad at [http://localhost:8100](http://localhost:8100). From there, you can navigate to the dashboard at [http://localhost:8101](http://localhost:8101), API on port 8102, demo on port 8103, docs on port 8104, Inbucket (e-mails) on port 8105, and Prisma Studio on port 8106. See the dev launchpad for a list of all running services. | ||
|
||
### Database migrations | ||
Your IDE may show an error on all `@stackframe/XYZ` imports. To fix this, simply restart the TypeScript language server; for example, in VSCode you can open the command palette (Ctrl+Shift+P) and run `Developer: Reload Window` or `TypeScript: Restart TS server`. | ||
|
||
If you make changes to the Prisma schema, you need to run the following command to create a migration: | ||
You can also open Prisma Studio to see the database interface and edit data directly: | ||
|
||
```sh | ||
pnpm run prisma migrate dev | ||
pnpm run prisma studio | ||
``` | ||
|
||
## Run individual services | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters