A full-stack application for managing sports events and tournaments, built with React, TypeScript, and Node.js.
The Game Centre Management System provides a simple interface for viewing and managing sports events. It features a React frontend for displaying events and a Node.js backend API for data management.
- Vite - Build tool for fast development
- React - UI library
- TypeScript - Type-safe JavaScript
- Sass - CSS preprocessor for styling
- Node.js - JavaScript runtime
- Express - Web framework
- TypeScript - Type safety for server code
- CORS - Cross-origin resource sharing
- View list of sports events
- Sort events alphabetically or by date
- Add new events
- Refresh event list
- Status badges for event states (active, inactive, pending)
- Node.js (v16 or higher)
- npm or yarn package manager
- Clone the repository:
git clone <repository-url>
cd playhq-coding-challenge
- Install backend dependencies:
cd backend
npm install
- Install frontend dependencies:
cd ../frontend
npm install
You'll need two terminal windows to run both the backend and frontend servers.
cd backend
npm run dev
The backend will start on http://localhost:3001
cd frontend
npm run dev
The frontend will start on http://localhost:5173
Open your browser and navigate to http://localhost:5173
to view the application.
cd backend
npm test
cd frontend
npm test
playhq-coding-challenge/
├── backend/
│ ├── src/
│ │ ├── index.ts # Express server setup
│ │ ├── data.ts # Mock data
│ │ └── data.test.ts # Data tests
│ ├── package.json
│ └── tsconfig.json
│
├── frontend/
│ ├── src/
│ │ ├── components/ # React components
│ │ │ ├── ItemList.tsx
│ │ │ └── Controls.tsx
│ │ ├── App.tsx # Main application component
│ │ ├── main.tsx # Application entry point
│ │ └── styles.scss # Global styles
│ ├── package.json
│ └── vite.config.ts
│
└── README.md
Retrieve all events.
Query Parameters:
sort
(optional): Sort order ('alpha' for alphabetical, 'date' for date sorting)
Add a new event.
Request Body:
{
"name": "Event Name",
"date": "2024-03-15",
"status": "active",
"description": "Event description"
}
Health check endpoint.
cd backend
npm run build
npm start
cd frontend
npm run build
The built files will be in the frontend/dist
directory.
npm run dev
- Start development server with hot reloadnpm run build
- Build TypeScript to JavaScriptnpm start
- Start production servernpm test
- Run tests
npm run dev
- Start development servernpm run build
- Build for productionnpm run preview
- Preview production buildnpm test
- Run testsnpm run lint
- Run ESLint
- The backend server must be running for the frontend to fetch data
- Mock data is pre-populated in the backend
- The application uses local state management
- CORS is configured to allow frontend-backend communication
Feel free to submit issues and enhancement requests!
This project is part of a technical assessment.