The DRep Campaign platform was funded by Intersect MBO and originally developed by the Lido Nation team. The platform is a web3/web2 system that allows DReps to create a profile to facilitate their campaigns, communicate with prospective and current delegators, and showcase their onchain and off chain activities.
This document serves as a comprehensive guide for setting up the full stack of our application, which includes the backend, frontend, and database components.
- Docker installed - Download link.
Database: PostgreSQL
Frontend: Next.js
Container: Docker
The api backend is powered by nest.js, A progressive Node.js framework for building efficient, reliable and scalable server-side applications.
For data persistence, we utilize PostgreSQL, known for its robustness, scalability, and reliability. This choice ensures that our application's data layer is secure, efficient, and capable of handling growth.
The frontend is developed with Next.js, a React framework that allows for server-side rendering and static site generation. This choice enables us to create fast, SEO-friendly web pages that integrate seamlessly with our Nest.js backend.
The instructions that follow will guide you through setting up each component of our application stack, ensuring a cohesive development and deployment process.
Before you begin setting up the application, you'll need to clone the repository from GitHub to get a local copy of the code. Follow these steps to clone the repository and start setting up the application components:
-
Clone the Repository:
- Open a terminal on your computer.
- Navigate to the directory where you want to store the project.
- Run the following command to clone the repository:
git clone https://github.com/lidonation/www.1694.io.git
-
Navigate to the Project Directory:
- After cloning, change into the project's root directory:
This directory contains all the files you need to set up the application, including the Docker Compose files and the separate directories for the backend and frontend components.
cd www.1694.io
- After cloning, change into the project's root directory:
By cloning the repository, you ensure that you have the latest version of the code and all the necessary files to get started with the application setup.
The app, all of it's dependencies including dev server with hot module reloading all run in docker environments. The only dependency you need on your machine is the docker engine. Follow these steps:
- From the root, run
make backend-install
- Nothing to do as both postgres instances, one for the app and one for dbsync is already configure in the docker-compose file.
- From the root, run
make frontend-install
The Next.js server, nest.js backend, cardano node, and postgres databases are automatically started when you run make up.
This shortcut runs docker-compose up -d. To view the Next.js server during development you can follow the logs from the frontend container
or run make logs.
- With all services running, your application components should be accessible at the following URLs:
- Backend:
http://localhost:8000– mostly called by Next.js server-side code; not much to see, as it is just an API. - Frontend:
http://localhost:3000– the Next.js application. - Queue backend:
http://localhost:9999– the BullMQ worker service, including its Bull Board dashboard. - Adminer:
http://localhost:8080– a database UI, useful for inspecting the schema. - Database: not served over HTTP; Postgres is mapped to port
5432on your host machine, as specified indocker-compose.yaml.
- Backend:
-
Backend service: runs Nest.js on port
8000and connects to the PostgreSQL database. -
Queue backend service: runs the BullMQ sync workers on port
9999, backed by Redis. -
Database service: runs PostgreSQL, mapped to port
5432on the host machine. -
Redis service: backs the job queues, mapped to port
6379. -
Frontend service: serves the Next.js application on port
3000, calling the Nest.js backend for content and data. -
Governance indexer: indexes Cardano governance data into the shared database.
- CONTRIBUTING.md — how to submit a change
- GOVERNANCE.md — roles, decision making, releases
- MAINTAINERS.md — who maintains the project
- CODE_OF_CONDUCT.md — expected conduct
- SECURITY.md — how to report a vulnerability privately
- SUPPORT.md — where to ask for help
- CHANGELOG.md — release history
Licensed under the Apache License, Version 2.0. See LICENSE.