Skip to content

Commit

Permalink
chore: Add migrations service to docker-compose.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Jott4 committed Sep 4, 2024
1 parent 3486efc commit ba3bdc9
Show file tree
Hide file tree
Showing 11 changed files with 5,953 additions and 10,618 deletions.
6 changes: 6 additions & 0 deletions .client.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
APP_DOMAIN=localhost:3000
NODE_ENV=development
GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=
NEXTAUTH_SECRET=
NEXT_PUBLIC_SERVICE_ACCOUNT_EMAIL=
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
.DS_store
.DS_store
.client.env
.server.env
17 changes: 17 additions & 0 deletions .server.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
DATABASE_URL=postgresql://postgres:mysecretpassword@localhost:5432/postgres
SECRET_AWS_ACCESS_KEY=
SECRET_AWS_SECRET_KEY=
JWT_SECRET=
NODE_ENV=development
GOOGLE_CREDENTIALS=
API_KEY=
RESEND_API_KEY=
ENCRYPTION_KEY=
IV=
ANTHROPIC_API_KEY=
EMAIL_DOMAIN=
APP_DOMAIN=localhost:3000
DATASOURCE_S3_BUCKET_NAME=
WORKSPACE_IMAGES_BUCKET_NAME=
AWS_SSM_SECRET_PREFIX=
DEMO_ASSISTANT_ID=
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,22 @@ Follow the steps below to set up the project locally.
docker compose up
```

3. **Deploy migrations with prisma**

```bash
cd server
npx prisma migrate deploy
```

## 🛠️ Technologies Used

For frontend:
For client:

- **Next.js**: A React framework for building modern, high-performance web applications.
- **React**: A JavaScript library for building user interfaces.
- **CSS Modules/TailwindCSS**: For styling the interface.

For backend:
For server:

- **NestJS**: A progressive Node.js framework for building efficient, reliable, and scalable server-side applications.
- **OpenAI GPT**: Integration with OpenAI's GPT API for AI-powered assistance.
Expand Down
4 changes: 2 additions & 2 deletions client/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "typper-bi-frontend",
"name": "typper-bi-client",
"version": "0.0.1",
"private": true,
"scripts": {
Expand Down Expand Up @@ -88,4 +88,4 @@
"tailwindcss": "^3",
"typescript": "^5"
}
}
}
5 changes: 0 additions & 5 deletions client/src/app/api/auth/[...nextauth]/authOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,6 @@ const authOptions: AuthOptions = {
signOut: '/',
verifyRequest: '/',
},
callbacks: {
signIn: (args) => {
return true
},
},
cookies: {
...(!isDev && {
sessionToken: {
Expand Down
68 changes: 28 additions & 40 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,50 +1,38 @@
version: "3.8"
services:
frontend:
image: ghcr.io/typper-io/typper-bi-frontend:latest
ports:
- "3000:3000"
environment:
NEXTAUTH_SECRET: ${NEXTAUTH_SECRET}
GOOGLE_CLIENT_ID: ${GOOGLE_CLIENT_ID}
GOOGLE_CLIENT_SECRET: ${GOOGLE_CLIENT_SECRET}
NODE_ENV: ${NODE_ENV}
NEXT_PUBLIC_SERVICE_ACCOUNT_EMAIL: ${NEXT_PUBLIC_SERVICE_ACCOUNT_EMAIL}

backend:
image: ghcr.io/typper-io/typper-bi-backend:latest
ports:
- "3001:3001"
environment:
DATABASE_URL: ${DATABASE_URL}
SECRET_AWS_ACCESS_KEY: ${SECRET_AWS_ACCESS_KEY}
SECRET_AWS_SECRET_KEY: ${SECRET_AWS_SECRET_KEY}
JWT_SECRET: ${JWT_SECRET}
NODE_ENV: ${NODE_ENV}
GOOGLE_CREDENTIALS: ${GOOGLE_CREDENTIALS}
API_KEY: ${API_KEY}
RESEND_API_KEY: ${RESEND_API_KEY}
ENCRYPTION_KEY: ${ENCRYPTION_KEY}
IV: ${IV}
ANTHROPIC_API_KEY: ${ANTHROPIC_API_KEY}
EMAIL_DOMAIN: ${EMAIL_DOMAIN}
APP_DOMAIN: ${APP_DOMAIN}
DATASOURCE_S3_BUCKET_NAME: ${DATASOURCE_S3_BUCKET_NAME}
WORKSPACE_IMAGES_BUCKET_NAME: ${WORKSPACE_IMAGES_BUCKET_NAME}
AWS_SSM_SECRET_PREFIX: ${AWS_SSM_SECRET_PREFIX}
DEMO_ASSISTANT_ID: ${DEMO_ASSISTANT_ID}
db:
image: postgres:latest
ports:
- "5432:5432"
environment:
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: ${POSTGRES_DB}
POSTGRES_USER: postgres
POSTGRES_PASSWORD: mysecretpassword
POSTGRES_DB: postgres
PGDATA: /var/lib/postgresql/data/pgdata
volumes:
- postgres-storage:/var/lib/postgresql/data
- postgres_data:/var/lib/postgresql/data
networks:
- backend

client:
image: ghcr.io/typper-io/typper-bi-client:main
ports:
- "3000:3000"
env_file:
- .client.env

server:
image: ghcr.io/typper-io/typper-bi-server:main
ports:
- "3001:3001"
env_file:
- .server.env
depends_on:
- db
networks:
- backend

volumes:
postgres-storage:
external: true
postgres_data:

networks:
backend:
4 changes: 2 additions & 2 deletions server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"@nestjs/core": "^9.0.0",
"@nestjs/mapped-types": "*",
"@nestjs/platform-express": "^9.0.0",
"@prisma/client": "5.7.1",
"@prisma/client": "5.19.1",
"@react-email/components": "^0.0.14",
"@react-email/tailwind": "^0.0.14",
"aws-sdk": "^2.1520.0",
Expand All @@ -49,7 +49,6 @@
"next-auth": "^4.24.5",
"openai": "^4.46.1",
"pg": "^8.11.3",
"prisma": "^5.7.1",
"react": "^18.2.0",
"redis": "^4.6.12",
"reflect-metadata": "^0.1.13",
Expand Down Expand Up @@ -80,6 +79,7 @@
"eslint-plugin-prettier": "^4.0.0",
"jest": "29.3.1",
"prettier": "^2.3.2",
"prisma": "^5.19.1",
"source-map-support": "^0.5.20",
"supertest": "^6.1.3",
"ts-jest": "29.0.3",
Expand Down
Loading

0 comments on commit ba3bdc9

Please sign in to comment.