This is a fullstack project that uses Next.js
for the frontend and Nest.js
for the backend.
Below are the steps to set up and run the project locally.
mozok-fullstack/
├── frontend/ # Frontend (Next.js)
├── backend/ # Backend (Nest.js)
└── package.json
Make sure you have the following installed:
Node.js
(v14.x or later)Yarn
(v1.x or later)PostgreSQL
database
$ git clone https://github.com/konstantinpachemski/mozok-fullstack.git
$ cd mozok-fullstack
Setup all dependencies:
$ yarn setup
Or setup frontend (nextjs) and backend (nestjs) dependencies:
$ yarn setup:fe
$ yarn setup:be
Next, create .env
file in root of backend folder and edit the connection with the database, JWT_SECRET and JWT_REFRESH_TOKEN:
/backend/.env
DATABASE_URL="postgresql://postgres:admin123@localhost:5432/postgres?schema=public"
JWT_SECRET=
JWT_REFRESH=
Finally, create .env
file in root of frontend folder and provide the same JWT_SECRET:
/frontend/.env
NEXTAUTH_URL=http://localhost:3000/
NEXTAUTH_SECRET=
$ yarn start
Or you can run the frontend and backend individually:
$ cd next-fe && yarn dev
$ cd nest-be && yarn start:dev
- Frontend: Open your browser and navigate to
http://localhost:3000
- Backend: The backend server will run on
http://localhost:8000
(or the port specified in your Nest.js configuration)
Here are some additional scripts you might find useful:
$ yarn build
- Build the application for production
$ yarn lint
- Lint the codebase
$ yarn tables
- Run Prisma Studio and preview database tables
$ yarn lint
- Lint the codebase