- Added .env.example file for environment variable documentation - Refactored docker-compose.yml to use environment variables for API URLs - Updated TypeScript configuration to use NodeNext module resolution
97 lines
1.9 KiB
Markdown
97 lines
1.9 KiB
Markdown
# Unreal Chat
|
|
|
|
A real-time chat application built with SolidJS, GraphQL, and Prisma.
|
|
|
|
## Project Structure
|
|
|
|
This is a monorepo containing the following packages:
|
|
|
|
- `apps/api`: GraphQL API server built with Apollo Server, GraphQL, and Prisma
|
|
- `apps/web`: Web client built with SolidJS and URQL GraphQL client
|
|
|
|
## Features
|
|
|
|
- Real-time chat with GraphQL subscriptions
|
|
- User authentication
|
|
- Chat room management
|
|
- Message sending and receiving
|
|
- Public and private chat rooms
|
|
|
|
## Getting Started
|
|
|
|
### Prerequisites
|
|
|
|
- Node.js (v18 or later)
|
|
- npm (v10 or later)
|
|
- MariaDB or MySQL
|
|
|
|
### Installation
|
|
|
|
1. Clone the repository:
|
|
|
|
```bash
|
|
git clone https://github.com/yourusername/unreal-chat.git
|
|
cd unreal-chat
|
|
```
|
|
|
|
2. Install dependencies:
|
|
|
|
```bash
|
|
npm install
|
|
```
|
|
|
|
3. Set up environment variables:
|
|
|
|
Copy the `.env.example` file to `.env`, then update the values as needed.
|
|
|
|
4. Initialize the database:
|
|
|
|
```bash
|
|
npm run prisma:init
|
|
```
|
|
|
|
5. Start the development servers:
|
|
|
|
```bash
|
|
# Start both API and web servers
|
|
npm run dev
|
|
|
|
# Or start them individually
|
|
npm run api:dev
|
|
npm run web:dev
|
|
```
|
|
|
|
The API will be available at http://localhost:4000/graphql and the web app at http://localhost:5173.
|
|
|
|
## Available Scripts
|
|
|
|
- `npm run dev` - Start all development servers
|
|
- `npm run api:dev` - Start the API development server
|
|
- `npm run web:dev` - Start the web development server
|
|
- `npm run build` - Build all packages
|
|
- `npm run api:build` - Build the API
|
|
- `npm run web:build` - Build the web app
|
|
- `npm run prisma:generate` - Generate Prisma client
|
|
- `npm run prisma:migrate` - Run Prisma migrations
|
|
- `npm run prisma:studio` - Open Prisma Studio
|
|
|
|
## Technologies
|
|
|
|
### Backend (API)
|
|
|
|
- Apollo Server
|
|
- GraphQL
|
|
- Prisma ORM
|
|
- MariaDB
|
|
- JSON Web Tokens (JWT)
|
|
|
|
### Frontend (Web)
|
|
|
|
- SolidJS
|
|
- URQL GraphQL Client
|
|
- GraphQL Subscriptions
|
|
- CSS
|
|
|
|
## License
|
|
|
|
This project is licensed under the MIT License - see the LICENSE file for details.
|