This project is a backend API for a dating simulator application. It provides functionality for user authentication, profile management, swipe actions, premium package purchases, and more.
.
├── prisma/
│ ├── dbml/
│ ├── migrations/
│ └── seed.py
├── src/
│ ├── __shared__/
│ ├── auth/
│ │ ├── dtos/
│ │ ├── errors/
│ │ ├── routers/
│ │ │ └── *.test.ts
│ │ └── services/
│ │ └── *.test.ts
│ ├── premium-package/
│ │ ├── dtos/
│ │ ├── errors/
│ │ ├── routers/
│ │ │ └── *.test.ts
│ │ └── services/
│ │ └── *.test.ts
│ ├── swipe/
│ │ ├── dtos/
│ │ ├── errors/
│ │ ├── routers/
│ │ │ └── *.test.ts
│ │ └── services/
│ │ └── *.test.ts
│ ├── app.ts
│ ├── context.ts
│ ├── schedulers.ts
│ └── server.ts
├── .czrc
├── .env
├── biome.json
├── commitlint.config.js
├── Dockerfile
├── docker-compose.pg.yaml
├── docker-compose.yaml
├── jest.config.js
├── lefthook.yaml
├── package.json
├── package-lock.json
├── README.md
└── tsconfig.json
- POST /auth/signup: Create a new user account
- POST /auth/login: User login
- GET /auth/me: Get current user details (requires authentication)
- GET /swipes/profile: Get a swipeable profile (requires authentication)
- PUT /swipes: Update swipe action (requires authentication)
- GET /swipes/stats: Get swipe statistics (requires authentication)
- GET /premium-packages: Get list of available premium packages
- POST /premium-packages/purchase: Purchase a premium package (requires authentication)
- Node.js
- npm
- PostgreSQL (can be run using Docker)
Before running the application, make sure to set up your .env file with the appropriate configuration.
-
Install dependencies:
npm install
-
If you need a PostgreSQL database, you can use the provided Docker Compose file:
docker-compose -f docker-compose.pg.yaml up -d
-
Run database migrations:
npx prisma migrate dev
-
Generate Prisma client:
npx prisma generate
-
(Optional) Seed the database:
npx prisma db seed
-
Start the application:
npm run dev
To run the tests for the application:
npm run testThis project uses Biome for code checking, linting, and formatting. Here are the available commands:
To check your code without making changes:
npm run checkTo check and automatically fix issues:
npm run check:writeTo lint your code without making changes:
npm run lintTo lint and automatically fix issues:
npm run lint:writeTo format your code without making changes:
npm run formatTo format and automatically apply changes:
npm run format:writeIt's recommended to run these commands before committing your changes to ensure code quality and consistency.
-
Ensure Docker and Docker Compose are installed on your system.
-
Make sure your
.envfile is properly configured. -
Run the following command:
docker-compose up -dThis will start both the application and the PostgreSQL database.
You can access and test the API endpoints using Postman at <Dating Simulator API>.
- The project includes a scheduler (
schedulers.ts) to reset thedailySwipesCountfor all users. context.tscontains the Prisma client and its mock for testing purposes.- Make sure to check and update the
.envfile before deploying or running the application.
For any further questions or issues, please refer to the project documentation or contact the development team.