This is an application aimed at allowing users create tickets/stories on a tracker board then allow admin users assigned to each ticket manage the tickets by either rejecting or approving them as necessary.
To run this project on your local machine you need to have the following installed.
- Open a terminal/command prompt on your computer and cd into your preferred path/location.
- Clone repo: to do this, run the following command on your terminal/command prompt.
git clone https://github.com/justega247/ticket_board.git
- Add the required environment variables: Locate a file with the filename
.sample.env
in the root directory and copy its content into a new file you will create in the root directory of the cloned repo and give it a filename of.env
. In the.env
file specify the environmental variables.
HOST='database host'
USERNAME='database username'
PASSWORD='database password'
DATABASE='database type'
ADMINPASSWORD='password for admin'
SECRET='token secret'
EXPIRES='token expiration time'
Steps to run this project:
- Run
npm i
command to install the dependencies - Setup database settings inside
ormconfig.json
file, replace the appropriate details with yours for the development database - Run
npm start
ornpm run start:dev
command - Run
npm test
to run the tests
Request type | Endpoint | Actions |
---|---|---|
POST | /auth/signup | Register a new user |
POST | /auth/login | Login a registered user |
POST | /ticket | Create a new ticket |
PUT | /ticket/:id/assign | Assign a ticket to an admin |
GET | /ticket/admin | Retrieve all tickets assigned to an admin |
PUT | /ticket/:id/manage?action= | Admin can manage a ticket |
- You'll need two database, one for test and one for development
- On starting the app the first time two admin users will be seeded into the database you have specified in the
ormconfig.json
file - If you run into issues with dropping the test database automatically after the tests are done, you can run
npm run post:test
to drop it manually.
- NodeJS
- TypeScript
- Postgres
- Express
- Okeremeta Tega