Skip to content

Commit

Permalink
Update readme files to more appropriately reflect the situation
Browse files Browse the repository at this point in the history
  • Loading branch information
Josip Igrec committed Feb 9, 2023
1 parent ca32972 commit 6761d34
Show file tree
Hide file tree
Showing 2 changed files with 120 additions and 7 deletions.
63 changes: 57 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,80 @@
# Nuxt 3 Minimal Starter
# FER Job Fair website

We recommend to look at the [documentation](https://v3.nuxtjs.org).
This is the repository for the [FER Job Fair](https://jobfair.fer.unizg.hr) website.

The current folder contains the frontend code. The backend code is located in the [backend](./backend) folder.

## Setup

Make sure to install the dependencies
Make sure to install the dependencies first:

```bash
yarn install
```

The .tool-versions file contains the versions of the tools used in this project.
If you use [asdf](https://asdf-vm.com/#/), you can run `asdf install` to install the correct versions.

Next, create a `.env` file.
The template for the files is `.env.example`.

Make sure to follow the setup steps for the [backend](./backend/README.md) next.

Next, generate the GraphQL schema on the backend:

```bash
yarn graphql:schema:dump
```

And then generate the GraphQL types for the frontend:

```bash
yarn graphql:schema:gen
```

## Development

Start the development server on http://localhost:3000
Start the development server on http://localhost:3000 (by default, set the `PORT` environment variable to change the port)

```bash
yarn dev
```

### Caddy configuration

Caddy is used as a reverse proxy for the frontend and backend. The configuration file is the [Caddyfile](./Caddyfile).
To run Caddy, run the following command:

```bash
sudo caddy run
```

It assumes that the frontend is running on port 3000 and the backend is running on port 3001.
It will start a reverse proxy on port 80.

## Production

Build the application for production:
Build the frontend for production:

```bash
yarn build
```

Checkout the [deployment documentation](https://v3.nuxtjs.org/docs/deployment).
Start the frontend in production mode:

```bash
yarn start
```

### Docker

To run the whole application in a Docker container, run the following command:

```bash
docker compose up --build --detach --remove-orphans --pull always --wait
```

It will start all required services (frontend, backend, database, proxy, minio).
No ports are exposed to the host machine.
To access the application, you to create a `docker-compose.override.yml` file
and add the appropriate configuration/overrides to it.
64 changes: 63 additions & 1 deletion backend/README.md
Original file line number Diff line number Diff line change
@@ -1 +1,63 @@
# backend
# Backend

This is the backend for the [frontend](..).

## Setup

Make sure to install the dependencies first:

```bash
yarn install
```

The `.tool-versions` file contains the versions of the tools used in this project.
If you use [asdf](https://asdf-vm.com/#/), you can run `asdf install` to install the correct versions.

Next, create a `.env` file.
The template for the files is `.env.example`.

Generate the Prisma client:

```bash
yarn db:client:gen
```

If you want to use the database migrations, you need to run the following command:

```bash
yarn db:migration:deploy
```

## Development

Start the development server on http://localhost:3001 (by default, set the `PORT` environment variable to change the port):

```bash
yarn dev
```

To generate a new migration, run the following command:

```bash
yarn db:migration:new
```

To format the prisma schema, run the following command:

```bash
yarn db:schema:format
```

## Production

Build the application for production:

```bash
yarn build
```

Start the application in production mode:

```bash
yarn start
```

0 comments on commit 6761d34

Please sign in to comment.