A social media API built with NestJS, GraphQL, and Redis for caching.
- User authentication and authorization
- Post creation and management
- Comments and likes system
- Friends system with status tracking
- Redis caching for improved performance
- GraphQL API for flexible queries
- Framework: NestJS
- Database: PostgreSQL
- Cache: Redis
- API: GraphQL
- Real time: graphql-ws, graphql-subscriptions
- Authentication: Passport-JWT
-
Clone the repository:
git clone https://github.com/yourusername/social-media-api.git cd social-media-api
-
Set up environment variables: Create a
.env
file in the root directory and add the following variables:DATABASE_URL=postgresql://ayman:social@localhost:5432/mydatabase REDIS_URL=redis://localhost:6380 JWT_SECRET=your_jwt_secret_key
-
Start the Docker containers:
docker-compose up -d
-
The API will be available at:
http://localhost:your-port/graphql