Skip to content

TheCommandCat/mtes

Repository files navigation

πŸ—³οΈ MTES - Moatza TLV Election System

Modern Real Time Election Management System built with Next.js, Express, and WebSocket technology! πŸš€

TypeScript Next.js Express.js Socket.IO MongoDB Nx Docker

✨ Features

  • πŸ”„ Real-time Updates: Live voting progress with WebSocket integration
  • 🎯 Drag & Drop Interface: Intuitive member assignment to voting stands
  • πŸ” Role-Based Access: Secure access control for different user types
  • πŸ“Š Live Results: Instant visualization of voting outcomes
  • πŸŽ›οΈ Admin Dashboard: Comprehensive election management tools
  • πŸ“± Responsive Design: Works seamlessly on all devices

πŸ› οΈ Tech Stack

  • Frontend: Next.js + Material-UI
  • Backend: Express.js + Socket.IO
  • Database: MongoDB
  • Build Tool: Nx
  • Language: TypeScript

πŸš€ Quick Start

Prerequisite:
You need Docker installed.
Start a MongoDB database instance (in the background) with:

docker run --name mtes-mongo -p 27017:27017 -d mongo:7.0.5
  1. Clone & Install
git clone https://github.com/TheCommandCat/mtes.git
cd mtes
npm install
  1. Configure Environment Variables

    Create a .env file in the apps/backend/ directory and set a JWT_SECRET:

    cp .env.example apps/backend/.env
    # Then, edit apps/backend/.env and set JWT_SECRET
  2. Run Development Server

npm run dev

🐳 Deploying with Docker Compose

Deploy the application swiftly using Docker Compose. πŸš€ Ensure Docker is running.

Important

Before launching, configure the root .env file. The JWT_SECRET, Mongo credentials, and public WebSocket URL are required. ✨

Create the root environment file:

cp .env.example .env

When running multiple MTES instances on the same machine, give each instance unique container names and host ports in .env:

MTES_MONGO_CONTAINER_NAME=mtes-mongo-instance-2
MTES_BACKEND_CONTAINER_NAME=mtes-backend-instance-2
MTES_FRONTEND_CONTAINER_NAME=mtes-frontend-instance-2
BACKEND_HOST_PORT=3334
FRONTEND_HOST_PORT=4201
NEXT_PUBLIC_WS_URL=http://localhost:3334

Run this from the project root:

docker-compose up -d

This builds and starts frontend and backend services in detached mode.

Access:

  • Frontend: http://localhost:4200 πŸ–₯️
  • Backend API: http://localhost:3333 βš™οΈ

To stop:

docker-compose down

Happy deploying! πŸŽ‰

πŸ—οΈ Project Structure

mtes/
β”œβ”€β”€ apps/
β”‚   β”œβ”€β”€ frontend/    # Next.js application
β”‚   └── backend/     # Express server
β”œβ”€β”€ libs/
β”‚   β”œβ”€β”€ database/    # MongoDB models
β”‚   β”œβ”€β”€ types/       # Shared types
β”‚   └── utils/       # Common utilities

🀝 Contributing

  1. Fork the repo
  2. Create feature branch (git checkout -b feature/amazing-feature)
  3. Commit changes (git commit -m 'Add amazing feature')
  4. Push to branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ™ Acknowledgments

This project is licensed under the GPL-3.0 License. It utilizes a similar tech stack and codebase inspired by FIRSTIsrael/lems; πŸ™ thank you for making this possible! πŸš€

Made with ❀️ by @TheCommandCat

About

Moatza Tlv Election System πŸ—³οΈ - Real-time platform for managing Tel Aviv Youth Council voting sessions with live tracking & results 🎯 ✨

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages