You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: SETUP.md
+79-4Lines changed: 79 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,7 @@ Before we start, you will need:
16
16
1.**An Instagram Business or Creator Account**: Personal accounts do not support the API. You can switch for free in Instagram's settings under **Settings** → **Account type**.
17
17
2.**A Facebook Account**: Meta's developer platform requires a Facebook account.
18
18
3.**A Resend Account**: Go to [Resend.com](https://resend.com) to create a free account. This is required to send login emails (magic links).
19
-
4.**Docker Desktop** (For local setup only): Download and install it from [Docker's website](https://www.docker.com/products/docker-desktop/).
19
+
4.**PostgreSQL & Redis** (one of): Docker Desktop, a local install, or a free cloud account (Neon/Supabase + Upstash). Docker is **optional** — see Step 2.
20
20
5.**Node.js** (v18 or higher) installed on your machine.
21
21
22
22
---
@@ -60,13 +60,70 @@ openssl rand -hex 16
60
60
Open the `.env` file in your text editor and fill in the values generated in Step 1.
61
61
62
62
3.**Start PostgreSQL & Redis (Datastores)**:
63
-
Make sure Docker Desktop is running, then run:
63
+
64
+
Docker is not required. Pick **one** option per datastore — either run Postgres/Redis **locally**, or use a **free cloud** service.
65
+
66
+
### Option A — Local install (no Docker)
67
+
68
+
Install PostgreSQL and Redis directly on your machine:
-**Windows**: Installers from [postgresql.org](https://www.postgresql.org/download/) and [redis.io](https://redis.io/docs/latest/operate/oss_and_stack/install/install-redis/).
73
+
74
+
Then start them:
64
75
65
76
```bash
66
-
docker-compose up -d
77
+
# Postgres (macOS via brew)
78
+
brew services start postgresql@16
79
+
# Postgres (Debian/Ubuntu)
80
+
sudo systemctl start postgresql
81
+
82
+
# Redis (either platform)
83
+
redis-server --daemonize yes
84
+
```
85
+
86
+
Create the database and a user matching `.env.example`:
87
+
88
+
```bash
89
+
createdb openinstadm
90
+
psql -c "ALTER USER postgres PASSWORD 'postgres';"
67
91
```
68
92
69
-
This downloads and starts PostgreSQL (database) and Redis (queue manager) in the background.
> On Debian/Ubuntu the default Postgres user is `postgres`, but `pg_isready`/`psql` need `sudo -u postgres`. If the password fails, run `sudo -u postgres psql -c "ALTER USER postgres PASSWORD 'postgres';"`.
101
+
102
+
### Option B — Free cloud Postgres + Redis (no local setup, no Docker)
103
+
104
+
The free tiers below are plenty for local development:
105
+
106
+
| Service | What it gives you | Free tier |
107
+
| ------- | ----------------- | --------- |
108
+
|[Neon](https://neon.tech)| Serverless Postgres | 0.5 GB storage, branch-based DB |
> **Tip**: Prefer the pooler/connection-URL, not the direct one, on Supabase/Neon — Prisma handles pooled connections much better. Make sure the `sslmode=require` (or `?ssl=true` for Supabase) param is present, or Prisma will refuse to connect.
125
+
126
+
Docker alternative (if you ever want it): `docker-compose.yml` in the project root provides the exact same Postgres (port `5432`) and Redis (port `6379`) for consistent local dev. See the "To reset everything" snippet below.
70
127
71
128
4.**Initialize the Database**:
72
129
Run the following commands to create the tables in your database:
@@ -75,6 +132,24 @@ openssl rand -hex 16
75
132
npm run db:migrate
76
133
```
77
134
135
+
-`db:generate` generates the Prisma client from `prisma/schema.prisma`.
136
+
-`db:migrate` applies the migration files in `prisma/migrations/` to the database (the `openinstadm` database created by the container).
0 commit comments