-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(project-setup): set up project
-create empty express project -set up test env -set up swagger documentation -set up CI/CD -set up global error handler -write comprehensive README -set up docker [Finishes #1]
- Loading branch information
Showing
20 changed files
with
8,642 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
/node_modules | ||
/coverage | ||
Dockerfile | ||
.dockerignore | ||
docker-compose.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"parser": "@typescript-eslint/parser", | ||
"plugins": ["@typescript-eslint"], | ||
"extends": ["plugin:@typescript-eslint/recommended"], | ||
"env": { | ||
"node": true, | ||
"es6": true | ||
}, | ||
"rules": { | ||
"no-console": "warn", | ||
"quotes": ["error", "single"] | ||
}, | ||
"ignorePatterns": ["dist/**/*", "__tests__/*"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: CI for taskMaster Project | ||
|
||
on: | ||
push: | ||
branches: ['develop'] | ||
pull_request: | ||
branches: ['develop'] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
node-version: [20.x] | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
cache: 'npm' | ||
- run: npm ci | ||
- run: npm run build | ||
- run: npm run test:ci | ||
- run: npm run lint | ||
- name: Upload coverage reports to Codecov | ||
uses: codecov/[email protected] | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
slug: jkarenzi/task-master-be | ||
directory: coverage/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.env | ||
node_modules/ | ||
dist/ | ||
coverage/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"singleQuote": true, | ||
"trailingComma": "es5" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
FROM node:latest | ||
|
||
WORKDIR /usr/src/app | ||
|
||
COPY package*.json ./ | ||
RUN npm ci | ||
|
||
COPY . . | ||
|
||
EXPOSE 3000 | ||
CMD ["npm", "run", "dev"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,52 @@ | ||
# task-master-be | ||
# TaskMaster API | ||
|
||
## Overview | ||
|
||
Welcome to TaskMaster API! This project provides the backend API for the TaskMastere application. It is a robust task manager that allows users to create, update, style and delete their tasks | ||
|
||
## Documentation | ||
|
||
Find the API documentation at https://localhost:3000/api-docs | ||
|
||
## Installation | ||
|
||
To get started with the TaskMaster API, follow these simple steps: | ||
|
||
1. **Clone the Repository**: | ||
|
||
```bash | ||
git clone https://github.com/jkarenzi/task-master-be.git | ||
``` | ||
|
||
2. **Install Dependencies**: | ||
|
||
```bash | ||
npm install | ||
``` | ||
|
||
3. **Run the Development Server**: | ||
```bash | ||
npm run dev | ||
``` | ||
|
||
## Testing | ||
|
||
- Run tests | ||
|
||
```bash | ||
npm run test | ||
``` | ||
|
||
- Run tests with coverage | ||
|
||
```bash | ||
npm run test:ci | ||
``` | ||
|
||
## Usage | ||
|
||
Once the development server is running, you can interact with the API using HTTP requests. | ||
|
||
## Authors | ||
|
||
- [Manzi Karenzi](https://github.com/jkarenzi) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { test } from '../src/controllers/testController'; | ||
|
||
const res: any = {}; | ||
|
||
(res.json = jest.fn((x: Object) => x)), | ||
(res.status = jest.fn((x: number) => res)); | ||
|
||
const req: any = { | ||
body: { | ||
name: 'test', | ||
}, | ||
}; | ||
|
||
describe('Test', () => { | ||
it('should return 200 successful upon testing route', async () => { | ||
await test(req, res); | ||
|
||
expect(res.status).toHaveBeenCalledWith(200); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
version: '3' | ||
services: | ||
app: | ||
build: . | ||
ports: | ||
- '8000:3000' | ||
volumes: | ||
- .:/usr/src/app | ||
- /usr/src/app/node_modules | ||
env_file: | ||
- .env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
/** @type {import('ts-jest').JestConfigWithTsJest} */ | ||
module.exports = { | ||
preset: 'ts-jest', | ||
testEnvironment: 'node', | ||
}; |
Oops, something went wrong.