A social media platform built with FastAPI and React that allows users to create profiles, share posts, and interact with other users through likes/votes.
-
User Authentication
- Register with email and username
- Secure login/logout functionality
- JWT token-based authentication
-
User Profile
- Customizable profile information
- Profile picture upload
- Bio and personal details
- View other users' profiles
-
Posts
- Create text-based posts
- View posts from all users
- Vote/like posts
- Delete own posts (soon)
-
Social Features
- View popular posts
- See recent liked posts
- Real-time vote counts
Profile Page | Edit Profile Page |
---|---|
Login Page | Register Page |
---|---|
Wireframe |
---|
- FastAPI (Python web framework)
- MySQL (Database)
- SQLAlchemy (ORM)
- Alembic (Database migrations)
- JWT Authentication
- Python 3.10+
- React 18
- React Router v6
- Tailwind CSS
- shadcn/ui Components
- React Hook Form
- Zod Validation
- Python 3.10+
- Node.js 16+
- MySQL
- Clone the repository
git clone https://github.com/fartoot/social-media-app.git
cd social-media-app/backend
- Create and activate virtual environment
python -m venv venv
source venv/bin/activate # Linux/Mac
# or
venv\Scripts\activate # Windows
- Install dependencies
pip install -r requirements.txt
- Create .env file in backend directory
DATABASE_HOSTNAME=localhost
DATABASE_PORT=3306
DATABASE_PASSWORD=your_password
DATABASE_NAME=your_db_name
DATABASE_USERNAME=your_username
SECRET_KEY=your_secret_key
ALGORITHM=HS256
ACCESS_TOKEN_EXPIRE_MINUTES=60
- Run database migrations
alembic upgrade head
- Start the backend server
uvicorn app.main:app --reload
- Navigate to frontend directory
cd ../frontend
- Install dependencies
npm install
- Start the development server
npm run dev
POST /users/
- Register new userPOST /login/
- User loginGET /posts/
- Get all postsPOST /posts/
- Create new postPOST /votes/
- Vote/like a postGET /users/{id}
- Get user profilePUT /users/
- Update user profile