This project is a full-stack Twitter clone application with a React frontend and Node.js backend.
Before getting started, ensure you have the following installed:
- Node.js (v14 or higher)
- npm (comes with Node.js)
- Git
- PostgreSQL
- React (v17 or higher)
git clone https://github.com/cmn22/twitter-clone.git
cd twitter-cloneFirst, make sure PostgreSQL is installed and running with the following configuration:
- Username: postgres
- Password: core%4052
- Database: twitter
Then, install and run the backend:
PS: .env.example have been added so you can create your own .env and fill the empty fields
# Navigate to the API directory
cd api
# Install dependencies
npm install
# Run database migrations
npx prisma migrate dev
# Seed the database with initial data
npx prisma db seed
# Start the backend server
npm startThe API server should now be running on http://localhost:5001 (or another port specified in your environment).
Open a new terminal window/tab and run:
# Navigate to the client directory from the project root
cd client
# Install dependencies
npm install
# Start the frontend development server
npm startYour default web browser should automatically open and navigate to http://localhost:3000, where you can interact with the application.
- The application will open automatically in your browser
- Sign up for a new account
- Test the various functionalities:
- Creating tweets
- Following other users
- Liking and retweeting
- Viewing profiles
- And more!
If you encounter any issues:
- Make sure PostgreSQL is properly installed and running
- Check that the database credentials are correct
- Ensure all dependencies are installed
- Verify that ports 3000 and 5002 are not being used by other applications
/api- Backend Node.js server with Prisma ORM/client- Frontend React application