This project is a clone of the popular social media app TikTok. It aims to replicate the core functionalities of TikTok, including video sharing, liking, commenting, and user authentication.
- User Authentication (Sign Up, Login, Logout)
- Upload and Share Videos
- Like and Comment on Videos
- Follow and Unfollow Users
- Video Feed based on Followed Users
- Frontend: React, Redux, CSS
- Backend: NestJS, GraphQL
- Database: PostgreSQL
- Authentication: JWT (JSON Web Tokens)
- Storage: Local Storage for video storage
- Containerization: Docker, Docker Compose
-
User Authentication:
mutation { signUp(input: SignUpInput) { user { id, username, email } } }- Sign up a new usermutation { login(input: LoginInput) { accessToken } }- Log in an existing usermutation { logout }- Log out the current user
-
User Management:
query { user(id: ID!) { id, username, email, profile } }- Get user profile by IDmutation { updateUser(id: ID!, input: UpdateUserInput) { user { id, username, email, profile } } }- Update user profile by IDmutation { followUser(id: ID!) { user { id, username } } }- Follow a user by IDmutation { unfollowUser(id: ID!) { user { id, username } } }- Unfollow a user by ID
-
Video Management:
mutation { uploadVideo(input: UploadVideoInput) { video { id, url, description } } }- Upload a new videoquery { video(id: ID!) { id, url, description, likes, comments } }- Get video details by IDmutation { deleteVideo(id: ID!) { success } }- Delete a video by IDmutation { likeVideo(id: ID!) { video { id, likes } } }- Like a video by IDmutation { unlikeVideo(id: ID!) { video { id, likes } } }- Unlike a video by IDmutation { commentOnVideo(id: ID!, input: CommentInput) { comment { id, content } } }- Comment on a video by ID
To get a local copy up and running follow these simple steps.
- Docker
- Docker Compose
- Clone the repo
git clone https://github.com/your_username/tiktok_clone.git
- Navigate to the project directory
cd tiktok_clone - Create a folder named
databasein the root repositorymkdir database
- Set up environment variables
Create a
.envfile in the backend directory and add the following:DATABASE_URL=postgresql://user:password@database:5432/tiktok_db ACCESS_TOKEN_SECRET="secret" REFRESH_TOKEN_SECRET="secret" APP_URL="http://localhost:3000"
- Build and start the Docker containers
docker-compose up --build
- Open your browser and navigate to
http://localhost:3002for the frontend andhttp://localhost:3000/graphqlfor the GraphQL playground.
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Distributed under the MIT License. See LICENSE for more information.