Productive is a backend web API service for productivity needs, especially like todos. Built using NestJS framework TypeScript starter repository.
Similar with:
- Google Keep
- Microsoft Todo
- Todoist
- Checklist in Notion
- GitHub Issues
- Live:
- Images:
- Repo: https://github.com/revou-fsse/our-backend
- Status: https://our-status.mhaidarhanif.com
Name | Role |
---|---|
First Name | Lead and Backend Developer |
Second Name | Backend Developer and Database Admin |
Third Name | Backend Developer and Infra Engineer |
Base API URLs:
Swagger:
Endpoints:
HTTP | Endpoint | Description |
---|---|---|
GET |
/ |
Show welcome |
POST |
/auth/register |
Register new user |
POST |
/auth/login |
Login to user |
GET |
/todos |
Get all todos |
GET |
/todos/completed |
Get all completed todos |
GET |
/todos/:id |
Get one todo by id |
POST |
/todos |
Create new todo |
PUT |
/todos/:id |
Update one todo by id |
PATCH |
/todos/:id |
Update one todo by id |
DELETE |
/todos |
Delete all todos |
DELETE |
/todos/:id |
Delete one todo by id |
$ pnpm i
Make sure the database is ready before doing any dependency installation. Edit .env
file for the app if needed:
DATABASE_URL="postgres://the_user:the_password@the_hostname:5432/db"
JWT_SECRET="abdefghijklmnopqrstuvwxyzabcdefghi"
UNSPLASH_ACCESS_KEY="abdefghijklmnopqrstuvwxyzabcdefghi"
DATABASE_URL
, can be retreived from local database instance/containerJWT_SECRET
, recommended to generate withscripts/random.sh
UNSPLASH_ACCESS_KEY
, get it from Unsplash Developer app portal
Run Docker on your machine and run Docker Compose that specifically only run the database instance in the background:
$ docker compose -f docker-compose.dev.yaml up -d
Install local dependencies:
$ pnpm i
Install global dependencies:
$ pnpm i -g @nestjs/cli
$ pnpm i -g prettier
$ pnpm i -g eslint
Check available scripts/commands:
$ pnpm run
Push or migrate schema to the database or generate Prisma schema while in development:
$ pnpm prisma:push
$ pnpm prisma:migrate
$ pnpm prisma:generate
Then we can run the app
# development with watch mode
$ pnpm dev
# development
$ pnpm start
# production mode
$ pnpm start:prod
# unit tests
$ pnpm test
# e2e tests
$ pnpm test:e2e
# test coverage
$ pnpm test:cov