This is a clone of the Linktree API built with TypeScript, Express, Prisma, and Supabase. The API allows users to create an account, log in with JWT-based access and refresh tokens, and manage links that they wish to publish.
- User Authentication: #, login with access and refresh tokens.
- Link Management: Create, update, delete, and fetch links.
- Fetch individual links by ID.
- Fetch all links associated with a specific username.
- Backend Framework: Express
- Database ORM: Prisma
- Database: Supabase (PostgreSQL)
- Language: TypeScript
Ensure you have the following installed:
- Node.js (v18.x.x or higher)
- pnpm (v8.x.x or higher)
- Supabase project with database set up
-
Clone the repository:
git clone https://github.com/zulfikarrosadi/navigator-backend.git cd navigator-backend
-
Install dependencies:
pnpm install
-
Set up environment variables:
Copy .env.example to .env and fill all variables
-
Run database migrations:
pnpm prisma migrate dev
-
Start the development server:
pnpm run dev
The server will be running on localhost with port you define in .env file.
Import postman collection to view all endpoint TODO: craete endpoint for API documentation
We welcome contributions to the Navigator! Please follow these guidelines to help us maintain the quality and consistency of the project.
- dev branch: All development happens here. You cannot push directly to
dev
. - feature branches: Every feature or bug fix must be done in a separate branch, named descriptively, e.g.,
feat/user-authentication
orfix/link-fetch-error
. - Pull requests: Before merging into
dev
, create a pull request. The integration status checks must pass before the PR can be merged.
We use Conventional Commits for commit messages. Examples:
feat: add user registration endpoint
fix: correct issue with link deletion
chore: update dependencies
docs: add API documentation for link creation
- This project uses ESLint and Prettier for linting and formatting. Please ensure that your code passes the linter and is formatted properly before committing.
- Husky and lint-staged are used to enforce linting and formatting on commit.
Run the following command to manually lint and format the code:
pnpm run lint
pnpm run format
- Create a new branch from
dev
for your feature or bug fix. - Make your changes in the branch.
- Ensure all linting, formatting, and tests pass before committing.
- Push the branch to the repository.
- Open a pull request into
dev
. - Your pull request will be reviewed and must pass all integration checks before being merged.
Feel free to customize any part of this draft based on additional specifics!