An open API service indexing awesome lists of open source software.

https://github.com/stabldev/moonlitgrace.space

Step into Moonlitgrace—where a web developer and open-source contributor shares projects, insights, and creativity.
https://github.com/stabldev/moonlitgrace.space

drizzle-orm nextjs postgresql sentry-io shadcn-ui tailwindcss

Last synced: about 1 year ago
JSON representation

Step into Moonlitgrace—where a web developer and open-source contributor shares projects, insights, and creativity.

Awesome Lists containing this project

README

          

# moonlitgrace.space

Step into Moonlitgrace, where a passionate web developer and open-source contributor shares insights, projects, and creativity—all under the alias Moonlitgrace.

### Table of Contents

- [Development](#development)
- [Basic Steps](#basic-steps)
- [Configure environment variables](#configure-environment-variables)
- [Run app on local](#run-app-on-local)
- [Run app on container](#run-app-on-container)

## Development

### Basic Steps

- `git clone https://github.com/moonlitgrace/moonlitgrace.space moonlitgrace.space`
- `cd moonlitgrace.space`
- `npm i`

### Configure environment variables

From repo you will get 3 `.env` files such as:

- `.env.example`
- `.env.development`
- `.env.local.example`

Check [Environment Variable Load Order](https://nextjs.org/docs/pages/building-your-application/configuring/environment-variables#environment-variable-load-order) for more information regarding this structure.

For `SECRET_KEY` you can use anything since it is for development. (You can use this `openssl rand -base64 32` to create for production.)

As for `ADMIN_USERNAME` and `ADMIN_PASSWORD` add something to authenticate only you.

`DATABASE_URL`: uncomment value according to your selected workflow (see next heading).

## Run app on local

Before running `app`, we need a postgres `db` running.\
You can either run `db` on your system or use docker/podman.

eg postgresql connection string format: `postgresql://[db_user[:db_password]@][db_host][:db_port]/[db_name]`

If you've docker/podman installed, you can run `db` on a container with command:

```bash
# docker compose -f docker-compose.db.yml up
podman compose -f docker-compose.db.yml up
```

Now `db` is up!\
Next run database migrations with commands:

```bash
# can use any package manager
npm run db:generate
npm run db:migrate
```

If you want some mock data for development: run: `npm run db:seed`

To get `next.js` app running, run this command:

```bash
npm run dev
```

And that's for now! check [localhost:3000](https://localhost:3000) to see app running!

## Run app on container

(un)fortunately this app is containerized, so you can easily run it with docker/podman/any(idk).\
Just run this command:

```bash
# docker compose -f docker-compose.dev.yml up --build
podman compose -f docker-compose.dev.yml up --build
```

This will run app on [localhost:3000](https://localhost:3000), hurray?

> Next.js on container is not fun imho.\
> recommended: local setup