This is a documentation for the project task-manager-backend.
To set up the project, follow these steps:
-
Clone the repository:
git clone https://github.com/dev-manindepth/task-manager-backend
-
Navigate into the project directory:
cd task-manager-backend
-
Install dependencies:
npm install
-
Set up environment variables:
Create a
.env
file in the root of your project and add the following variables:DATABASE_URL=<your-postgres-database-url> NODE_ENV=development CLIENT_URL=http://localhost:3000
Note: I have use Supabase with setup postgres db , You can setup in local
The following environment variables are used in this project:
DATABASE_URL
: This variable should contain the URL for the database connection.NODE_ENV
: This variable is used to specify the environment (e.g., development, production, testing).CLIENT_URL
: This variable holds the URL of the client application.
The project includes the following npm scripts:
test
: Runs tests. Currently, it echoes an error if no test is specified.dev
: Starts the development server usingnodemon
for auto-reloading andbunyan
for logging.lint:check
: Checks the code for linting issues using ESLint.lint:fix
: Attempts to automatically fix linting issues using ESLint.prettier:check
: Checks the code for formatting issues using Prettier.prettier:fix
: Attempts to automatically fix formatting issues using Prettier.build
: Builds the project using TypeScript compiler (tsc
) and generates type aliases usingtsc-alias
.
The following are the API endpoints available in the project:
Replace {{baseURL}} with http://localhost:8000
and {{urlPath}} with api/v1
-
POST
{{baseURL}}/{{urlPath}}/task
- Content-Type:
application/json
- Accept:
application/json
- withCredentials:
true
- Body:
{ "title": "Task 1", "description": "My desc 1", "completed": true }
- Content-Type:
-
GET
{{baseURL}}/{{urlPath}}/task
- Content-Type:
application/json
- Accept:
application/json
- withCredentials:
true
- Content-Type:
-
PATCH
{{baseURL}}/{{urlPath}}/task/1
- Content-Type:
application/json
- Accept:
application/json
- withCredentials:
true
- Body:
{ "completed": false }
- Content-Type:
-
DELETE
{{baseURL}}/{{urlPath}}/task/1
- Content-Type:
application/json
- Accept:
application/json
- withCredentials:
true
- Content-Type: