A backend service for a Tinder-like application, allowing users to swipe through profiles, purchase premium packages, and enjoy premium features like unlimited swipes and verified labels.
This project provides a backend service for a dating application inspired by Tinder. Users can view, like, or pass on other users' profiles. The service also supports premium packages, which users can purchase to unlock features such as unlimited swipes and verified labels.
- User Authentication
- Profile Swiping
- Premium Package Purchase
- Unlimited Swipes for Premium Users
- Verified Label for Premium Users
- Node.js
- Express.js
- Sequelize (ORM)
- MariaDB/MySQL
- TypeScript
- Moment.js
- JWT for authentication
- Postman/Newman for API testing
tinder-copy-backend/
│
├── src/
│ ├── configs/
│ │ ├── messages.json
│ │ ├── sequelize.ts
│ ├── controllers/
│ │ ├── authController.ts
│ │ ├── swipeController.ts
│ │ ├── premiumController.ts
│ ├── models/
│ │ ├── user.ts
│ │ ├── premiumPackage.ts
│ │ ├── premiumFeature.ts
│ │ ├── userSwipe.ts
│ │ ├── userPremiumPackage.ts
│ ├── routes/
│ │ ├── authRoutes.ts
│ │ ├── swipeRoutes.ts
│ │ ├── premiumRoutes.ts
│ ├── tools/
│ │ └── response.ts
│ ├── middlewares/
│ │ └── authMiddleware.ts
│ └── app.ts
│
├── logs/
|
├── tests/
│ └── postman/
│ └── collection.json
│
├── env/
│ └── .env.example
|
├── package.json
├── tsconfig.json
└── README.md
- Node.js
- MariaDB/MySQL
- Git
- Clone the repository:
git clone https://github.com/nizarrk/tinder-copy-api.git
- Navigate to the project directory:
cd tinder-copy-api
- Install dependencies:
npm install
- Set up the environment variables:
Create a .env.dev file in the ./env directory of the project based on ./env/.env.example file and add the following variables:
MYSQL_TINDER_NAME=tinder_copy
MYSQL_TINDER_HOST=your_database_host
MYSQL_TINDER_USER=your_database_user
MYSQL_TINDER_PASS=your_database_password
MYSQL_TINDER_PORT=your_database_port
Replace your_database_host, your_database_user and your_database_password with the appropriate values for your database configuration and make sure your database name is "tinder_copy"
- Run the database migrations and seeders:
npx sequelize-cli db:migrate
npx sequelize-cli db:seed:all
- Start the service:
npm run dev
npm run build
npm start
The server will start and listen for incoming requests on http://localhost:4091 by default.
To run the tests, you need to have newman installed globally. If you don't have it installed, you can install it using npm:
npm install -g newman
npm run test
POST /api/auth/register - Register a new user
POST /api/auth/login - Login and obtain a token
POST /api/premium/purchase - Purchase a premium package
GET /api/users/swipe - Get list of users to swipe on
POST /api/users/swipe - Swipe on a user