diff --git a/backend/Dockerfile b/backend/Dockerfile new file mode 100644 index 0000000..6c58c42 --- /dev/null +++ b/backend/Dockerfile @@ -0,0 +1,13 @@ +FROM node:lts-hydrogen + +WORKDIR /dist + +COPY package*.json ./ + +RUN npm install + +COPY . /dist + +RUN npm run build + +ENTRYPOINT ["/bin/sh", "-c", "npm run start:prod"] \ No newline at end of file diff --git a/backend/README.md b/backend/README.md index 00a13b1..e144292 100644 --- a/backend/README.md +++ b/backend/README.md @@ -1,30 +1,19 @@ -
- -[circleci-image]: https://img.shields.io/circleci/build/github/nestjs/nest/master?token=abc123def456 -[circleci-url]: https://circleci.com/gh/nestjs/nest - -A progressive Node.js framework for building efficient and scalable server-side applications.
- - - -## Description - -[Nest](https://github.com/nestjs/nest) framework TypeScript starter repository. +# π GovTool Delegation Pillar Backend π + +The `@intersect.mbo/govtool-delegation-pillar-backend` is a NestJS application that serves as the backend for the GovTool Voting Pillar. It provides the API endpoints for the frontend to interact with the db-sync. + +## Table of content: + +- [Prerequisites](#prerequisites) +- [Installation](#installation) +- [Running the app](#running-the-app) +- [Test](#test) + +## Prerequisites + +- Node.js installed - [Download link](https://nodejs.org/en/download/). +- PostgreSQL installed (if running locally without Docker) - [Download link](https://www.postgresql.org/). +- Docker and Docker Compose installed (for Docker environment) - [Download link](https://docs.docker.com/get-started/) ## Installation @@ -34,6 +23,9 @@ $ npm install ## Running the app +To run the application locally, you need to have Node.js installed. +Copy `.env.example` to `.env` and fill in the required environment variables. + ```bash # development $ npm run start @@ -57,17 +49,3 @@ $ npm run test:e2e # test coverage $ npm run test:cov ``` - -## Support - -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). - -## Stay in touch - -- Author - [Kamil MyΕliwiec](https://kamilmysliwiec.com) -- Website - [https://nestjs.com](https://nestjs.com/) -- Twitter - [@nestframework](https://twitter.com/nestframework) - -## License - -Nest is [MIT licensed](LICENSE). diff --git a/backend/package.json b/backend/package.json index 1eab7e0..e3fc6d0 100644 --- a/backend/package.json +++ b/backend/package.json @@ -1,5 +1,5 @@ { - "name": "backend", + "name": "@intersect.mbo/govtool-voting-pillar-backend", "version": "0.0.1", "description": "", "author": "", diff --git a/frontend/README.md b/frontend/README.md new file mode 100644 index 0000000..d7565d8 --- /dev/null +++ b/frontend/README.md @@ -0,0 +1,193 @@ +# @intersect.mbo/govtool-delegation-pillar + +The `@intersect.mbo/govtool-delegation-pillar` is a React.js package that provides the essential logic and UI components for managing and conducting delegation within a Cardano governance. + +## Table of content: + +- [Installation](#installation) +- [Usage](#usage) +- [Project Structure](#project-structure) +- [Prerequisites](#prerequisites) +- [Running locally](#running-locally) + +## Installation + +To install this pacakge, use npm or yarn: + +### `npm install @intersect.mbo/govtool-delegation-pillar` + +or + +### `yarn add @intersect.mbo/govtool-delegation-pillar` + +## Usage + +After installation, you can import the component and use it in your project. + +#### This is an example of implementing a package in a [NextJs](https://nextjs.org/) application + +```tsx +'use client'; +import dynamic from 'next/dynamic'; +import { useAppContext } from '@/context'; + +const DelegationPillar = dynamic( + () => import('@intersect.mbo/govtool-delegation-pillar'), + { + ssr: false, + } +); + +export default function Page() { + const { + apiUrl, + walletApi, + validationApiUrl, + cExplorerBaseUrl, + epochParams, + connectWallet, + openFeedbackWindow, + addSuccessAlert, + addErrorAlert, + validateMetadata, + generateMetadata, + createJsonLD, + createHash, + ...context + // Or from any other context you need + } = useAppContext(); + + return ( +