This is a full-stack Twitter-like application. The backend is built using Node.js, Express, GraphQL, Prisma, and AWS S3, while the frontend is built using Next.js, React, Tailwind CSS, and GraphQL code generation.
- GraphQL API with Apollo Server
- Prisma ORM for database management
- Authentication with JWT
- File storage with AWS S3
- Redis integration for caching or pub/sub
- React-based user interface using Next.js
- Tailwind CSS for styling
- React Query for data fetching
- Google OAuth for authentication
- GraphQL Code Generator for types and queries
- Express: Minimal web framework for Node.js
- GraphQL: API query language
- Apollo Server: GraphQL server
- Prisma: ORM for interacting with databases
- AWS SDK: Integration with AWS services like S3
- ioredis: Redis client for caching and pub/sub
- JWT (jsonwebtoken): Authentication
- Dotenv: Environment variable management
- Next.js: React framework for server-side rendering
- React Query: State and server data management
- Tailwind CSS: Utility-first CSS framework
- Google OAuth: Social login via Google
- GraphQL Code Generator: Automatically generates TypeScript types and queries from GraphQL schema
- Node.js
- MongoDB
- AWS Account (for S3)
- Redis (for caching/pub-sub)
-
Clone the repository:
git clone https://github.com/SaiThanushreddy/SocialMediaPlatform.git cd backend
-
Install dependencies:
npm install
-
Set up environment variables by creating a
.env
file in the root directory with the following:DATABASE_URL=<Your Prisma DB Connection URL> JWT_SECRET=<Your JWT Secret> AWS_ACCESS_KEY_ID=<Your AWS Access Key> AWS_SECRET_ACCESS_KEY=<Your AWS Secret Key> AWS_S3_BUCKET=<Your S3 Bucket Name> REDIS_URL=<Your Redis Connection URL>
-
Build and start the backend server:
npm run dev
The backend API will be running on
http://localhost:4000
.
-
Navigate to the frontend repository:
cd frontend
-
Install dependencies:
npm install
-
Set up environment variables by creating a
.env
file in the root directory with the following:NEXT_PUBLIC_GRAPHQL_ENDPOINT=http://localhost:4000/graphql NEXT_PUBLIC_GOOGLE_CLIENT_ID=<Your Google OAuth Client ID>
-
Start the development server:
npm run dev
The frontend will be running on
http://localhost:3000
.
npm start
: Starts the backend server in production modenpm run dev
: Runs the backend server in development modenpm run build
: Compiles the TypeScript code into JavaScript
npm run dev
: Runs the frontend in development modenpm run build
: Builds the frontend for productionnpm run start
: Starts the frontend in production mode
- Open
http://localhost:3000
in your browser to access the frontend interface. - Use Google OAuth to log in, post tweets, and interact with the interface.
- The GraphQL API can be tested by navigating to
http://localhost:4000/graphql
.