- Rename .env.sample to .env in packages/mz-server directory.
- Modify
datasource db
part in packages/mz-server/prisma/schema.client to use SQLite as below
datasource db {
provider = "sqlite"
url = "file:./dev.db"
}
If you want to use PostgreSQL instead of SQLite, run PostgreSQL server with this link, set
DATABASE_URL
in .env file, and modifydatasource db
part in schema.prisma as below.datasource db { provider = "postgresql" url = env("DATABASE_URL") }
- Delete packages/mz-server/prisma/migrations directory.
- Use
yarn install
command to install node_modules. - Use
npx prisma migrate dev
command to initialize database.
- If you want to initialize the database, delete the migrations file in prisma and run
npx prisma migrate dev
.
- Use
npx prisma db seed
command to seed data(ex. region, area) - Use
npx prisma generate
command to generate Prisma Client. - Use
yarn dev
command to run server. Server will run on port 8080. Go to http://localhost:8080/ to check if server is running .
API Documentation is available at http://localhost:8080/documentation.