https://github.com/imrlopezag/ts-api-template
This is an API template made with express and typescript, to speed up your development, it contains repositories and generic services for the typical CRUD actions, based on a Sequelize model, we use it for data persistence
https://github.com/imrlopezag/ts-api-template
api-template express jwt jwt-authentication mongodb mongoose nodejs ts-api-template typescript typescript-api
Last synced: 10 months ago
JSON representation
This is an API template made with express and typescript, to speed up your development, it contains repositories and generic services for the typical CRUD actions, based on a Sequelize model, we use it for data persistence
- Host: GitHub
- URL: https://github.com/imrlopezag/ts-api-template
- Owner: ImRLopezAG
- License: mit
- Created: 2023-04-08T02:58:21.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-11-27T13:19:25.000Z (about 2 years ago)
- Last Synced: 2025-03-26T09:22:06.066Z (11 months ago)
- Topics: api-template, express, jwt, jwt-authentication, mongodb, mongoose, nodejs, ts-api-template, typescript, typescript-api
- Language: TypeScript
- Homepage:
- Size: 188 KB
- Stars: 5
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
Awesome Lists containing this project
README
# Ts-Template-Api
This is an API template made with express and typescript, to speed up your development, it contains repositories and generic services for the typical CRUD actions, based on a Sequelize model, we use it for data persistence
```
ORM: Sequelize
Language: Typescript
Framework: Express
Database: mySql
Deploy: Vercel,
Auth: JWT
Documentation: Swagger
```
## Badges
[](https://choosealicense.com/licenses/mit/)

### 🛠️ Tools
[](https://nodejs.org/es/)
[](https://expressjs.com/es/)
[](https://www.typescriptlang.org/)
[](https://sequelize.org/)
[](https://www.mysql.com/)
[](https://vercel.com/)
[](https://jwt.io/)
[](https://swagger.io/)
[](https://prettier.io/)
[](https://eslint.org/)

## Installation
```bash
git clone https://github.com/ImRLopezAG/Ts-Api-Template.git
cd my-project
npm install my-project
cd my-project
yarn install my-project
cd my-project
pnpm install my-project
you need to configure .env file like the .env.dev also you can add your configuration
```
## API Reference
### Authenticate with JWT
```
Post /api/Auth/Login
```
| Body | Type | Description |
| :-------- | :------- | :------------------------- |
| `username` | `string` | **Required**. username |
| `password` | `string` | **Required**. password |
#### Get all items
```
GET /api/Entity/List
```
#### Get item
```
GET /api/Entity/Get/${id}
```
| Parameter | Type | Description |
| :-------- | :------- | :-------------------------------- |
| `id` | `string` | **Required**. Id of item to fetch |
#### Post item
```
Post /api/Entity/Create
```
| Body | Type | Description |
| :-------- | :------- | :-------------------------------- |
| `Entity Properties` | `Entity` | **Required**. properties of item to fetch |
#### Update item
```
Put /api/Entity/Update
```
| Parameter | Type | Description |
| :-------- | :------- | :-------------------------------- |
| `id` | `string` | **Required**. Id of item to update |
| Body | Type | Description |
| :-------- | :------- | :-------------------------------- |
| `Entity Properties` | `Entity` | **Required**. properties of item to put |
#### Delete item
```
Delete /api/Entity/Delete
```
| Parameter | Type | Description |
| :-------- | :------- | :-------------------------------- |
| `id` | `string` | **Required**. Id of item to delete |
## Users
### Get Users
```
GET /api/User/List
```
### Get User
```
GET /api/User/Get/${id}
```
| Parameter | Type | Description |
| :-------- | :------- | :-------------------------------- |
| `id` | `string` | **Required**. Id of item to fetch |
### Get User by email
```
GET /api/User/email/${email}
```
| Parameter | Type | Description |
| :-------- | :------- | :-------------------------------- |
| `email` | `string` | **Required**. Id of item to fetch |
### Get User by username
```
GET /api/User/username/${username}
```
| Parameter | Type | Description |
| :-------- | :------- | :-------------------------------- |
| `username` | `string` | **Required**. Id of item to fetch |
### Add User
```
Post /api/User/Create
```
| Body | Type | Description |
| :-------- | :------- | :-------------------------------- |
| `email` | `string` | **Required**. |
| `username` | `string` | **Required**. |
| `password` | `string` | **Required**. |
### Update User
```
Put /api/User/Update/${id}
```
| Parameter | Type | Description |
| :-------- | :------- | :-------------------------------- |
| `id` | `string` | **Required**.|
| Body | Type | Description |
| :-------- | :------- | :-------------------------------- |
| `email` | `string` | **Required**. |
| `username` | `string` | **Required**. |
| `password` | `string` | **Required**. |
### Delete User
```
Delete /api/User/Delete/${id}
```
| Parameter | Type | Description |
| :-------- | :------- | :-------------------------------- |
| `id` | `string` | **Required**.|
## Authors
- [@ImRLopez](https://www.github.com/imrlopezag)
## 🔗 Links
[](https://imrlopez.dev)
[](https://www.linkedin.com/in/angel-gabriel-lopez/)
[](https://twitter.com/imr_lopez)