Author: Matias Urbano
- Typescript
- React
- Nextjs
- Prisma ORM (seeding & migrations)
- Docker
This small, 2-page app helps us track our pending tasks across projects.
The app has two pages, the task board and the project board. Both pages use asynchronous calls to fetch data from the backend.
The backend has 3 API endpoints:
- /api/tasks
- /api/projects
- /api/done
Make sure the environment variables are in place copying them from the sample and then within .env
file a define POSTGRES_USER and POSTGRES_PASSWORD of choice.
cp .env.sample .env
Postgres up and running. This will use port 5432 in your machine, so make sure it's free.
You can spin up your own Postgres instance and update the connection DATABASE_URL
environemnt variable
The above database setting will be used to spin up a Postgres instance using docker.
docker-compose down && docker-compose up
To recreate the database and apply all the db migrations and initial seeding.
npx prisma migrate reset -f
The seeding mechanism will be creating Projects and tasks base on the BULK_SEED_SIZE defined in the environemnt variables files, this will be useful later for to test it against a heavy load. The content for the Projects and Tasks are going to be randomly generated.
npm install
npm run dev
This installs all dependencies and starts serving the app in http://localhost:3000
We use PostgreSQL as our data store, so before the app is accessible we also need to spin it up:
The tasks board page in http://localhost:3000/ has a filtering feature based on task title.
The frontend is sending the query parameter correctly to the /api/tasks endpoint
The Projects endpoint have a cursor-based pagination, Also indexes has been added to improve performance.
- Moved password to environment variables
- removing passwords from repo
- implementing .env
- Implemented Prisma ORM
- Define Schema
- Create initial migration script
- Seeding mechanism
- Updated all api endpoints to use the ORM
- Refactoring and improving the handlers
- Added createdAt, updatedAt audit purposes
- Added Cursor-based Pagination
- note: offset pagination does not scale
- Added bulk seed with a BULK_SEED_SIZE enviroment variable to set the size of the dataset
- Adding Generic Paginated Response
- Added Debounce Search in ClientSide
- Added 500 / 404 Default Pages
- Improved pagination and add UI to Fetch next
- Performance Improvements