Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,5 +75,4 @@ jobs:
image: ${{ env.GCP_REGION }}-docker.pkg.dev/${{ env.GCP_PROJECT_ID }}/cloud-run-source-deploy/${{ env.SERVICE_NAME }}:latest
allow_unauthenticated: true
env_vars: |
SUPABASE_URL=${{ secrets.SUPABASE_URL }}
SUPABASE_KEY=${{ secrets.SUPABASE_KEY }}
DATABASE_URL=${{ secrets.DATABASE_URL }}
3 changes: 3 additions & 0 deletions backend/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,6 @@ pids

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

/generated/prisma
*.sql
8 changes: 6 additions & 2 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
FROM node:20-alpine AS base
FROM node:22-alpine AS base

FROM base AS build
WORKDIR /app
COPY package.json package-lock.json ./
COPY . .
RUN npm install && npm run build
RUN npm install


RUN npx prisma generate
RUN npm run build

EXPOSE 3000
CMD [ "node", "dist/main" ]
113 changes: 50 additions & 63 deletions backend/README.md
Original file line number Diff line number Diff line change
@@ -1,98 +1,85 @@
<p align="center">
<a href="http://nestjs.com/" target="blank"><img src="https://nestjs.com/img/logo-small.svg" width="120" alt="Nest Logo" /></a>
<a href="https://akomo.xyz" target="blank"><img src="https://nestjs.com/img/logo-small.svg" width="120" alt="Akomo Logo" /></a>
</p>

[circleci-image]: https://img.shields.io/circleci/build/github/nestjs/nest/master?token=abc123def456
[circleci-url]: https://circleci.com/gh/nestjs/nest

<p align="center">A progressive <a href="http://nodejs.org" target="_blank">Node.js</a> framework for building efficient and scalable server-side applications.</p>
<p align="center">
<a href="https://www.npmjs.com/~nestjscore" target="_blank"><img src="https://img.shields.io/npm/v/@nestjs/core.svg" alt="NPM Version" /></a>
<a href="https://www.npmjs.com/~nestjscore" target="_blank"><img src="https://img.shields.io/npm/l/@nestjs/core.svg" alt="Package License" /></a>
<a href="https://www.npmjs.com/~nestjscore" target="_blank"><img src="https://img.shields.io/npm/dm/@nestjs/common.svg" alt="NPM Downloads" /></a>
<a href="https://circleci.com/gh/nestjs/nest" target="_blank"><img src="https://img.shields.io/circleci/build/github/nestjs/nest/master" alt="CircleCI" /></a>
<a href="https://discord.gg/G7Qnnhy" target="_blank"><img src="https://img.shields.io/badge/discord-online-brightgreen.svg" alt="Discord"/></a>
<a href="https://opencollective.com/nest#backer" target="_blank"><img src="https://opencollective.com/nest/backers/badge.svg" alt="Backers on Open Collective" /></a>
<a href="https://opencollective.com/nest#sponsor" target="_blank"><img src="https://opencollective.com/nest/sponsors/badge.svg" alt="Sponsors on Open Collective" /></a>
<a href="https://paypal.me/kamilmysliwiec" target="_blank"><img src="https://img.shields.io/badge/Donate-PayPal-ff3f59.svg" alt="Donate us"/></a>
<a href="https://opencollective.com/nest#sponsor" target="_blank"><img src="https://img.shields.io/badge/Support%20us-Open%20Collective-41B883.svg" alt="Support us"></a>
<a href="https://twitter.com/nestframework" target="_blank"><img src="https://img.shields.io/twitter/follow/nestframework.svg?style=social&label=Follow" alt="Follow us on Twitter"></a>
</p>
<!--[![Backers on Open Collective](https://opencollective.com/nest/backers/badge.svg)](https://opencollective.com/nest#backer)
[![Sponsors on Open Collective](https://opencollective.com/nest/sponsors/badge.svg)](https://opencollective.com/nest#sponsor)-->
<p align="center">A progressive Node.js framework backend for <b>Akomo</b>, tracking builds and exchange rates with precision.</p>

## Description

[Nest](https://github.com/nestjs/nest) framework TypeScript starter repository.
Akomo Backend is built with [NestJS](https://github.com/nestjs/nest), utilizing [Prisma ORM](https://www.prisma.io/) and [Neon Postgres](https://neon.tech/) for high-performance, serverless data management.

## Infrastructure: Supabase to Neon Migration

We have recently migrated our data layer from Supabase to **Neon Postgres** using **Prisma 7**.

### Key Changes
- **Database:** Neon (Serverless Postgres)
- **ORM:** Prisma 7 with Neon Adapter
- **Architecture:** Moved from direct Supabase client to a centralized `PrismaService` with global dependency injection.

## Project setup

```bash
$ npm install
$ pnpm install
```

## Compile and run the project

```bash
# development
$ npm run start
## Environment Variables

# watch mode
$ npm run start:dev
Create a `.env` file in the root directory:

# production mode
$ npm run start:prod
```env
DATABASE_URL=postgresql://user:password@host/db?sslmode=require
PORT=3000
```

## Run tests
> [!IMPORTANT]
> Ensure your `DATABASE_URL` is a valid Neon connection string. For Prisma migrations and `db push`, it is recommended to use the **Direct Connection** URL from the Neon console.

```bash
# unit tests
$ npm run test
## Database Management

# e2e tests
$ npm run test:e2e
We use Prisma for schema management and migrations.

# test coverage
$ npm run test:cov
```
```bash
# Sync database with schema (Recommended for Dev/Neon)
$ npx prisma db push

## Deployment
# Generate Prisma Client
$ npx prisma generate

When you're ready to deploy your NestJS application to production, there are some key steps you can take to ensure it runs as efficiently as possible. Check out the [deployment documentation](https://docs.nestjs.com/deployment) for more information.
# Open Prisma Studio to view data
$ npx prisma studio
```

If you are looking for a cloud-based platform to deploy your NestJS application, check out [Mau](https://mau.nestjs.com), our official platform for deploying NestJS applications on AWS. Mau makes deployment straightforward and fast, requiring just a few simple steps:
## Compile and run the project

```bash
$ npm install -g @nestjs/mau
$ mau deploy
```
# development
$ pnpm start

With Mau, you can deploy your application in just a few clicks, allowing you to focus on building features rather than managing infrastructure.
# watch mode (Includes automatic port cleanup on port 3000)
$ pnpm start:dev

## Resources
# production mode
$ pnpm start:prod
```

Check out a few resources that may come in handy when working with NestJS:
## Scripts & Sync

- Visit the [NestJS Documentation](https://docs.nestjs.com) to learn more about the framework.
- For questions and support, please visit our [Discord channel](https://discord.gg/G7Qnnhy).
- To dive deeper and get more hands-on experience, check out our official video [courses](https://courses.nestjs.com/).
- Deploy your application to AWS with the help of [NestJS Mau](https://mau.nestjs.com) in just a few clicks.
- Visualize your application graph and interact with the NestJS application in real-time using [NestJS Devtools](https://devtools.nestjs.com).
- Need help with your project (part-time to full-time)? Check out our official [enterprise support](https://enterprise.nestjs.com).
- To stay in the loop and get updates, follow us on [X](https://x.com/nestframework) and [LinkedIn](https://linkedin.com/company/nestjs).
- Looking for a job, or have a job to offer? Check out our official [Jobs board](https://jobs.nestjs.com).
The backend includes utility scripts for data synchronization:

## Support
```bash
# Sync exchange rates from Binance
$ pnpm sync:binance

Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please [read more here](https://docs.nestjs.com/support).
# Sync exchange rates from BCV
$ pnpm sync:bcv
```

## Stay in touch
## API Documentation

- Author - [Kamil Myśliwiec](https://twitter.com/kammysliwiec)
- Website - [https://nestjs.com](https://nestjs.com/)
- Twitter - [@nestframework](https://twitter.com/nestframework)
Swagger UI is available for API exploration:
- **Local:** `http://localhost:3000/api/docs`

## License

Nest is [MIT licensed](https://github.com/nestjs/nest/blob/master/LICENSE).
Akomo is [MIT licensed](LICENSE).
Loading
Loading