This is the backend service for the Arena MRV website. It provides data about matches and concerts happening at the Arena MRV, and includes a WhatsApp notification system for upcoming events.
- Node.js
- TypeScript
- Express
- Apollo Server (GraphQL)
- TypeORM
- PostgreSQL
- Twilio (for WhatsApp notifications)
src/
: Source codeindex.ts
: Main entry pointwhatsappBot.ts
: WhatsApp notification logicscrape/
: Web scraping logic for matches and concertsmodel/
: Database modelsschema.ts
: GraphQL schemaresolvers.ts
: GraphQL resolvers
- Node.js (v14 or later)
- PostgreSQL
- Twilio account (for WhatsApp notifications)
-
Clone the repository:
git clone https://github.com/your-username/arena-mrv-backend.git cd arena-mrv-backend
-
Install dependencies:
npm install
-
Create a
.env
file in the root directory with the following content:TWILIO_ACCOUNT_SID=your_twilio_account_sid TWILIO_AUTH_TOKEN=your_twilio_auth_token DATABASE_URL=postgres://username:password@localhost:5432/arena-mrv-db
-
Set up the PostgreSQL database:
- Create a new database named
arena-mrv-db
- Update the
DATABASE_URL
in the.env
file with your PostgreSQL credentials
- Create a new database named
-
Start the development server:
npm run dev
-
The server will start running at
http://localhost:4000/graphql
npm start
: Builds and runs the production versionnpm run dev
: Runs the development server with hot-reloadingnpm test
: Runs the test suite (currently not