gramstudio / electionsdata.io

Ballots like leaves fall / Rivers carry them downstream / Time hears nations' call

Home Page:https://electionsdata.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

πŸ—³οΈπŸŒ electionsdata.io

This is a full-stack React application built with Next.js, Prisma, and tRPC with WebSocket support.

Features

  • πŸ§™β€β™‚οΈ E2E type safety with tRPC
  • ⚑ Full-stack React with Next.js
  • ⚑ WebSockets / Subscription support
  • ⚑ Database with Prisma
  • πŸ” Authorization using next-auth
  • βš™οΈ VSCode extensions
  • 🎨 ESLint + Prettier
  • πŸ’š CI setup using GitHub Actions:
    • βœ… E2E testing with Playwright
    • βœ… Linting

Requirements

This project uses Node.js and PNPM.

It also requires a local PostgreSQL database for development, which Prisma will use to create, migrate and read from a schema.

Getting Started

Before you begin, cp .env .env.local in the project and adjust the connection string to match your local PostgreSQL setup, e.g. DATABASE_URL="postgresql://<YOUR_USER>:<YOUR_PASSWORD>@localhost:5432...", making sure these credentials allow you to create and modify databases.

Next, install the dependencies:

pnpm install

Then, start the development server:

pnpm dev

Open http://localhost:3000 with your browser to see the result.

Scripts

pnpm build #Runs prisma generate, prisma migrate, and next build
pnpm db-nuke #Resets the local database
pnpm dev #Starts the Next.js and WebSocket server
pnpm dx #Starts the PostgreSQL database, runs migrations, seeds the database, and starts the Next.js server
pnpm test-dev #Runs end-to-end tests on the development server
pnpm test-start #Runs end-to-end tests on next start - build required before
pnpm test:unit #Runs normal Vitest unit tests
pnpm test:e2e #Runs end-to-end tests

Deployment

(Optional) The project contains a render.yaml "Blueprint" which makes the project deployable on Render.

Contributing

Contributions are welcome! Please open an issue or submit a pull request.

License

This project is licensed under the terms of the GNU Affero General Public License.

Contact

About

Ballots like leaves fall / Rivers carry them downstream / Time hears nations' call

https://electionsdata.io/

License:GNU Affero General Public License v3.0


Languages

Language:TypeScript 96.0%Language:JavaScript 3.6%Language:CSS 0.4%