https://github.com/manosbatsis/user-management-monorepo
Fullstack user management playground with pnpM (and eventually Turborepo) monorepos, Prisma with NestJS and Next.js with Refine.
https://github.com/manosbatsis/user-management-monorepo
nestjs nextjs pnpm pnpm-workspaces prisma-orm refine-dev
Last synced: about 2 months ago
JSON representation
Fullstack user management playground with pnpM (and eventually Turborepo) monorepos, Prisma with NestJS and Next.js with Refine.
- Host: GitHub
- URL: https://github.com/manosbatsis/user-management-monorepo
- Owner: manosbatsis
- License: agpl-3.0
- Created: 2024-05-10T17:23:41.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2024-09-18T00:59:46.000Z (over 1 year ago)
- Last Synced: 2024-12-28T05:22:06.241Z (over 1 year ago)
- Topics: nestjs, nextjs, pnpm, pnpm-workspaces, prisma-orm, refine-dev
- Language: TypeScript
- Homepage:
- Size: 772 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
User Management Monorepo
[](https://github.com/manosbatsis/user-management-monorepo/actions/workflows/ci.yml)
A sample to play around with [pnpM](https://pnpm.io/) (and eventually [Turborepo](https://turbo.build/)) monorepos,
[Prisma](https://www.prisma.io/) with [NestJS](https://nestjs.com/) and [Next.js](https://nextjs.org/)
with [Refine](https://refine.dev/).
* [Prerequisites](#prerequisites)
* [Configuration](#configuration)
* [Installation](#installation-)
* [Server](#server)
* [Database](#database)
* [With Local Postgres](#with-local-postgres)
* [With Docker Compose](#with-docker-compose)
* [Database Schema](#database-schema)
* [Run Tests](#run-tests)
* [Run Apps](#run-apps)
* [Start the Server](#start-the-server)
* [Start the Client](#start-the-client)
* [Login](#login)
## Prerequisites
- Node v20.x
- npm v10.x
- pnpM v8.9.0
- Docker Compose
## Configuration
### Installation
Start by installing:
```bash
pnpm install
```
### Server
Copy the `src/assets/config-template.json` file as `src/assets/config.json`
```bash
cp packages/api/src/assets/config-template.json packages/api/src/assets/config.json
```
Feel free to edit settings in _config.json_ according to your environment requirements.
### Database
#### With Local Postgres
If you have a local postgres DB, copy the `packages/api/.env.template-local` file as `packages/api/.env`
```bash
cp packages/api/.env.template-local packages/api/.env
```
> [!IMPORTANT]
> Feel free to edit settings to match your environment requirements.
#### With Docker Compose
To use docker compose for a postgres DB, copy the `packages/api/.env.template-compose` file as `packages/api/.env`
```bash
cp packages/api/.env.template-compose packages/api/.env
```
then launch with
```bash
docker-compose up
```
### Database Schema
Push the database schema with
```bash
pnpm run db:push
```
then seed with sample data:
```bash
pnpm run db:seed
```
## Run Tests
To run **unit** tests in all workspaces:
```bash
pnpm run test
```
To run **e2e** tests in all workspaces:
```bash
pnpm run test:e2e
```
HTML test reports for your browser are published in _packages/*/output_.
> [!TIP]
> Test results are also published as the build summary in Github Actions and a comment in Pull Requests.
## Run Apps
### Start the Server
```bash
pnpm run server
```
### Start the Client
```bash
pnpm run client
```
### Login
Browse http://localhost:3001 and login with:
- username: admin@test.com
- password: Test123!