https://github.com/bearstudio/basic-crud-exercise
https://github.com/bearstudio/basic-crud-exercise
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/bearstudio/basic-crud-exercise
- Owner: BearStudio
- Created: 2024-10-28T11:57:14.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-10-28T17:06:33.000Z (over 1 year ago)
- Last Synced: 2025-03-07T02:37:19.765Z (over 1 year ago)
- Language: TypeScript
- Size: 6.84 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Basic CRUD exercise
## Install project
Require NodeJS 20+
```
pnpm install
pnpm db:push
```
## Run the API
```
pnpm dev:api
```
API available at http://localhost:4000/api/v1
## API documentation
### Get all projects
```
GET /api/v1/projects
QUERY
{
page: Number?
pageSize: Number?
}
RESPONSE
{
data: {
id String
createdAt DateTime
updatedAt DateTime
name String
description String?
}[]
total: Number
page: Number
pageSize: Number
}
```
### Create a project
```
POST /api/v1/projects
BODY
{
name String
description String?
}
RESPONSE
{
data: {
id String
createdAt DateTime
updatedAt DateTime
name String
description String?
}
}
```
### Get a project by id
```
GET /api/v1/projects/:id
RESPONSE
{
data: {
id String
createdAt DateTime
updatedAt DateTime
name String
description String?
}
}
```
### Update a project by id
```
PUT /api/v1/projects/:id
BODY
{
"name": String,
"description": String?,
}
RESPONSE
{
data: {
id String
createdAt DateTime
updatedAt DateTime
name String
description String?
}
}
```
### Delete a project by id
```
DELETE /api/v1/projects/:id
RESPONSE
{
data: {
id String
createdAt DateTime
updatedAt DateTime
name String
description String?
}
}
```
## Exercise
Create a UI for the following tasks
- Display the list of all projects
- Create a project with name and description
- Update a project name and description
Bonus tasks
- Delete a project
- Display a project