Skip to content

Commit

Permalink
Merge branch 'enricoros:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
icratech authored Feb 19, 2024
2 parents e8595ec + 6c51a36 commit 883f350
Show file tree
Hide file tree
Showing 22 changed files with 4,996 additions and 175 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

# next.js
/.next/
/dist/
/out/

# production
Expand Down
9 changes: 5 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ WORKDIR /app

# Dependency files
COPY package*.json ./
COPY prisma ./prisma
COPY src/server/prisma ./src/server/prisma

# Install dependencies, including dev (release builds should use npm ci)
ENV NODE_ENV development
Expand Down Expand Up @@ -38,9 +38,10 @@ RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nextjs

# Copy Built app
COPY --from=builder --chown=nextjs:nodejs /app/public public
COPY --from=builder --chown=nextjs:nodejs /app/.next .next
COPY --from=builder --chown=nextjs:nodejs /app/node_modules node_modules
COPY --from=builder --chown=nextjs:nodejs /app/public ./public
COPY --from=builder --chown=nextjs:nodejs /app/.next ./.next
COPY --from=builder --chown=nextjs:nodejs /app/node_modules ./node_modules
COPY --from=builder --chown=nextjs:nodejs /app/src/server/prisma ./src/server/prisma

# Minimal ENV for production
ENV NODE_ENV production
Expand Down
29 changes: 15 additions & 14 deletions docs/config-database.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,31 +9,33 @@ This guide outlines the database options and setup steps for enabling features l
- Available on Vercel, Neon, and other platforms.
- Less feature-rich but a suitable option depending on your needs.
- **Connection String:** Replace placeholders with your Postgres credentials.
- `postgres://USER:[email protected]/SOMEDB?pgbouncer=true&connect_timeout=15`
- `postgres://USER:[email protected]/SOMEDB?pgbouncer=true&connect_timeout=15`

**2. MongoDB Atlas (alternative):**

- **Highly Recommended:** More than a database, it's a data platform. MongoDB Atlas is a robust cloud-based platform that offers scalability, security, and a suite of developer tools. No need for a separate vector database, you can query your vector embeddings right within your operational database!
- **Additional Features:** MongoDB Atlas is packed with unique features designed to streamline the development process such as: Atlas App Services, Atlas search (with vector search), Atlas charts, Data Federation, and more.
- **Highly Recommended:** More than a database, it's a data platform. MongoDB Atlas is a robust cloud-based platform that offers scalability, security, and a suite of developer tools. No need for a separate vector database, you can query your vector embeddings right within your operational database!
- **Additional Features:** MongoDB Atlas is packed with unique features designed to streamline the development process such as: Atlas App Services, Atlas search (with vector search), Atlas charts, Data Federation, and more.
- **Connection String:** Replace placeholders with your Atlas credentials.
- `mongodb://USER:[email protected]/DATABASE-NAME?retryWrites=true&w=majority`
- `mongodb://USER:[email protected]/DATABASE-NAME?retryWrites=true&w=majority`

### Environment Variables:

#### Postgres:
| Variable | |
|--------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `POSTGRES_PRISMA_URL` | `postgres://USER:[email protected]/SOMEDB?pgbouncer=true&connect_timeout=15` |
| `POSTGRES_URL_NON_POOLING` (optional) | URL for the Postgres database without pooling (specific use cases) |

| Variable | |
|---------------------------------------|------------------------------------------------------------------------------------------------------|
| `POSTGRES_PRISMA_URL` | `postgres://USER:[email protected]/SOMEDB?pgbouncer=true&connect_timeout=15` |
| `POSTGRES_URL_NON_POOLING` (optional) | URL for the Postgres database without pooling (specific use cases) |

#### MongoDB:
| Variable | |
|--------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `MDB_URI` | `mongodb://USER:[email protected]/DATABASE-NAME?retryWrites=true&w=majority` |

| Variable | |
|-----------|------------------------------------------------------------------------------------------|
| `MDB_URI` | `mongodb://USER:[email protected]/DATABASE-NAME?retryWrites=true&w=majority` |

### MongoDB Atlas + Prisma
When using MongoDB Atlas, you'll need to make the below changes to the file `prisma.schema`

When using MongoDB Atlas, you'll need to make the below changes to the file [`src/server/prisma/schema.prisma`](../src/server/prisma/schema.prisma).

```
...
Expand All @@ -53,8 +55,7 @@ model LinkStorage {

### Initial Setup Steps:

1. **Run `npx prisma db:push`:** Create or update the database schema (run once after connecting).

1. **Run `npx prisma db push`:** Create or update the database schema (run once after connecting).

### Additional Resources:

Expand Down
41 changes: 41 additions & 0 deletions electron/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# next.js
/.next/
/dist/
/out/

# production
/build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.pnpm-debug.log*

# local env files
.env
.env.*

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts

# other
.idea/
Loading

1 comment on commit 883f350

@vercel
Copy link

@vercel vercel bot commented on 883f350 Feb 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.