Backend for TheSync - A modern API built with NestJS and TypeScript.
- Node.js (v20.19.2 exactly)
- pnpm (v10 or later)
- PostgreSQL (v13 or later)
- Visual Studio Code (recommended IDE)
-
Clone the repository:
git clone https://github.com/FiveLogic/the-sync-backend.git cd the-sync-backend
-
Install dependencies:
pnpm install --frozen-lockfile
-
Setup environment variables:
Create a
.env
file in the root directory and configure your environment variables following the Environment Setup Guide. -
Generate Prisma client and run migrations:
pnpm prisma:generate pnpm prisma:dev
-
Seed initial data:
Seeding Data Guide - Complete guide for seeding initial data into the database
pnpm seed
-
Start the development server:
pnpm start:dev
-
The API will be available at http://localhost:4000/swagger.
For detailed instructions on setting up environment variables and database configuration, please refer to our Environment Setup Guide.
For the best development experience, please install the following VS Code extensions:
You can install them by running:
code --install-extension EditorConfig.EditorConfig
code --install-extension esbenp.prettier-vscode
code --install-extension dbaeumer.vscode-eslint
pnpm start:dev
- Start the development server with hot-reloadpnpm build
- Build the application for productionpnpm start
- Start the server in development modepnpm start:prod
- Start the production serverpnpm prisma:generate
- Generate Prisma clientpnpm prisma:dev
- Run database migrations in developmentpnpm prisma:studio
- Open Prisma Studio for database inspectionpnpm seed
- Seed initial data into the databasepnpm lint
- Run ESLint to check code quality
- Framework: NestJS
- Runtime: Node.js
- Language: TypeScript
- Database: PostgreSQL
- ORM: Prisma
- API Documentation: Swagger
We use conventional commit messages to ensure consistency and maintain a clean git history. This project enforces commit conventions using commitlint.
Each commit message should follow this format:
<type>: <description>
[optional body]
[optional footer(s)]
Type | Description |
---|---|
add |
Adding a new file, feature or dependency |
update |
Updating existing functionality |
fix |
Bug fixes |
docs |
Documentation changes |
feat |
New features |
refactor |
Code refactoring without changing functionality |
delete |
Removing code or files |
feat: add user authentication controller
fix: resolve database connection issue
docs: update API documentation
refactor: improve error handling in auth service
We maintain code quality with:
- ESLint: For code linting
- Prettier: For code formatting
- TypeScript: For type safety
- Environment Setup Guide - Complete guide for setting up environment variables and database configuration
- Seeding Data Guide - Complete guide for seeding initial data into the database
For detailed information about changes in each version, please see our CHANGELOG.md.