This project features a TypeScript and Express backend API integrated with a Next.js 14 based client interface. It enables user-specific task management, incorporating user authentication and authorization for CRUD operations on tasks.
- User Authentication & Authorization:
- Authenticate and authorize users for accessing and managing tasks securely.
- CRUD Operations:
- Create, Read, Update, and Delete tasks associated with individual authenticated users.
- Clone this repository to your local machine:
git clone https://github.com/BugReportOnWeb/ts-express-task.git
cd ts-express-task
- Navigate to the
client/
directory:
cd client/
- Install client dependencies:
npm install
- Create a
.env.local
file in theclient/
directory and add the following variables:
NEXT_PUBLIC_PROD_URL=your_prod_url_if_any
NEXT_PUBLIC_DEV_URL=http://localhost:4000
- Navigate to the
server/
directory:
cd ../server/
- Install server dependencies:
npm install
- Create a
.env
file in theserver/
directory and add the following variables:
PORT=4000
JWT_SECRET=your_secret_key_here
MONGO_URI=your_mongodb_uri_here
- Start the server:
cd server/
npm run dev
- Start the client:
cd ../client/
npm run dev
-
Access the client interface at http://localhost:3000.
-
Ensure your MongoDB server is running and accessible with the provided URI in the
.env
file.
- User Authentication:
- POST
/api/users/register
: Register a new user. - POST
/api/users/login
: Log in and authenticate a user.
- POST
- Task Management:
- GET
/api/tasks
: Retrieve tasks for the authenticated user. - GET
/api/tasks/:id
: Retrieve details of a specific task for the authenticated user. - POST
/api/tasks
: Create a new task for the authenticated user. - PUT
/api/tasks/:id
: Update an existing task belonging to the authenticated user. - DELETE
/api/tasks/:id
: Delete a task specific to the authenticated user.
- GET
- TypeScript
- Express
- Node.js
- Next.js 14 (for the client interface)
- JSON Web Tokens (JWT) for authentication
Contributions to enhance the functionality or improve the codebase are welcome! Feel free to open issues or pull requests.
This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.