This project is the backend for a clone of StrawPoll.com, designed to work in tandem with the frontend application. It is built using NestJS and leverages MikroORM for database interactions.
- REST API endpoints to manage polls and votes.
- Integration with PostgreSQL using MikroORM.
- Docker support for easy setup and deployment.
- Docker (recommended for installation).
- Node.js (if not using Docker).
- A PostgreSQL database (if not using Docker).
- Clone the repository:
git clone https://github.com/avanrish/strawpoll-api
- Navigate to the project directory:
cd strawpoll-api - Rename
.env.exampleto.envand adjust the environment variables as needed. - Start the services using Docker Compose:
docker-compose up -d
- Ensure you have a running instance of PostgreSQL.
- Rename
.env.exampleto.envand setPOSTGRES_HOSTto your database host (e.g.,localhost). - Install dependencies:
You can also use
pnpm install
npmoryarn. - Build the application:
pnpm build
- Start the application:
pnpm start
Once the backend is up and running, you can start using the API endpoints. The OpenAPI (Swagger) documentation is available at http://localhost:4000/docs/api, providing a detailed description of available endpoints and their usage.
This backend is designed to work with a corresponding frontend application. Please set up the frontend from this repository to fully utilize the functionality of the StrawPoll clone.