|
|
%!s(int64=4) %!d(string=hai) anos | |
|---|---|---|
| components | %!s(int64=4) %!d(string=hai) anos | |
| context | %!s(int64=4) %!d(string=hai) anos | |
| hooks | %!s(int64=4) %!d(string=hai) anos | |
| pages | %!s(int64=4) %!d(string=hai) anos | |
| public | %!s(int64=4) %!d(string=hai) anos | |
| styles | %!s(int64=4) %!d(string=hai) anos | |
| utils | %!s(int64=4) %!d(string=hai) anos | |
| .env.example | %!s(int64=4) %!d(string=hai) anos | |
| .eslintrc.json | %!s(int64=4) %!d(string=hai) anos | |
| .gitignore | %!s(int64=4) %!d(string=hai) anos | |
| .prettierignore | %!s(int64=4) %!d(string=hai) anos | |
| .prettierrc.json | %!s(int64=4) %!d(string=hai) anos | |
| README.md | %!s(int64=4) %!d(string=hai) anos | |
| app.d.ts | %!s(int64=4) %!d(string=hai) anos | |
| next-env.d.ts | %!s(int64=4) %!d(string=hai) anos | |
| next.config.js | %!s(int64=4) %!d(string=hai) anos | |
| package.json | %!s(int64=4) %!d(string=hai) anos | |
| postcss.config.js | %!s(int64=4) %!d(string=hai) anos | |
| tailwind.config.js | %!s(int64=4) %!d(string=hai) anos | |
| tsconfig.json | %!s(int64=4) %!d(string=hai) anos | |
| yarn.lock | %!s(int64=4) %!d(string=hai) anos |
This is my take on Prisma's Home Challenge.
This is a Next.js project made in Typescript and bootstrapped with create-next-app.
For an application like this, my candidates were
So based on this, my two top candidates were Gatsby & Next.js, I decided to go with Next.js because of personal preference :)
Aside from my reasons of choosing Next.js, I ended up creating a proxy for the API, since every request from a client application to https://prisma-fe-dev-assignent.vercel.app/api/ was blocked by CORS policy (this was a workaround to get the API working).
I added the option to choose between the original API or the proxy: adding the env variable NEXT_PUBLIC_API=https://prisma-fe-dev-assignent.vercel.app/api would make the client application to use the original backend instead of using proxy.
I also used TailwindCSS to speed up the development process.
First, create a .env.local file with the contents of .env.example
Then run the development server:
yarn dev
Open http://localhost:3000 with your browser to see the result.
You can also find a live version here
There are a couple of things that I would do differently if I could change the API:
/login endpoint returns user data instead of just a message/login)/user/{id} to return a user with an id: int instead of id: string to keep consistency with the other endpoints.I would improve the UX of the application: