This project is a CRUD Task Management application built with a React TypeScript frontend and a NestJs backend that interfaces with a PostgreSQL database.
The project is structured into two main directories: frontendTS
and backend
.
Make sure you have the following installed on your system:
- Node.js
- pnpm, npm, or yarn (choose one)
git clone https://github.com/your-username/TaskManagement
cd TaskManagement
Navigate to the frontendTS and backend directories and install the required dependencies
cd frontendTS
pnpm i
# or
npm i
# or
yarn add
cd backend
pnpm i
# or
npm i
# or
yarn add
Before running the backend, you need to configure the database connection.
In the backend
directory, create a .env
file with the following template:
DB_HOST=
DB_PORT=
DB_USERNAME=
DB_PASSWORD=
DB_NAME=
fill in the values according to your database configuration
Alternatively, you can directly edit the database configuration in /backend/src/app.module.ts
:
TypeOrmModule.forRoot({
type: 'postgres',
host: your-db-host,
port: 5432,
username: your-db-username,
password: your-db-password,
database: your-db-name,
autoLoadEntities: true,
synchronize: true,
})
After setting up the environment variables or configuring the database in app.module.ts
, you can start the backend and frontend servers.
cd backend
pnpm start:dev
# or
npm start:dev
# or
yarn start:dev
cd frontendTS
pnpm dev
# or
npm dev
# or
yarn dev
Once both servers are running, you can access the application in your browser.
- Frontend :
http://localhost:3001
- Backend Api:
http://localhost:3001/api
orhttp://localhost:3000
Also you can access Swagger Api docs by appending /docs
in either of backend url