Skip to content

coptit/coptit-admin-panel

Repository files navigation

COPTIT Admin Panel

A Full Stack TypeScript Application for Sending Admin message to Coptit Discord Server and Sending Bulk / Transactional email for club members.

Authors

Stack

Frontend (client)

  • React + Vite
  • Tailwind Css
  • TypeScript (tsx)

Backend (server)

Demo

image

Docker image is here.

Local Setup

Clone the repository

git clone https://github.com/coptit/coptit-admin-panel.git

cd to repository

cd coptit-admin-panel

Download Dependencies

npm install

Server Require some Environment Variables, this can be provided with .env file

Copy the .env-template file into .env file

cd server
cp .env-template .env

Fill the .env file

Property Require Description
ADMIN_USER yes The user email of the Admin
ADMIN_PASS yes The Password of the admin
SMTP_USERNAME no SMTP username
SMTP_USER no SMTP user (email@domain.com)
SMTP_PASS no SMTP password
BOT_TOKEN no Discord Bot token
GUILD_ID no Discord Channel ID

Run Dev server

cd ../ # Come back to main repo
npm run dev

Build the project

npm run build

Start the Production Server

npm start

This will start both client and server

client will be served at http://localhost:4000

server

  • tRPC server will be serve at http://localhost:4001
  • Express server will be serve at http://localhost:4002

API Docs

Sending Transactional Emails

POST http://localhost:4002/api/sendmail

Request Body

{
  "to": "string",
  "subject": "string",
  "text": "string",
  "html": "string"
}

Response Body

{
  "messageid": "string"
}

License

MIT