This challenge showing Xapix-Umit
Challenge fullstack app in TypeScript with Next.js using React (frontend), Express and Prisma Client (backend). It uses a SQLite database file with some initial dummy data which you can find at ./backend/prisma/dev.db
.
Challenge takes Approx 5 hours to complete.
Backend:
- MVC architecture could have been used.
- Business logic could have been moved to a separate file.
Frontend:
- Business logic could have been moved to backend side.
- Redux or Context could have been used.
- Tailwind CSS could have been used.
- Clean Code could have been used.
- Error handling could have been used.
- Unit tests could have been used.
- Code coverage could have been used.
- Code linting could have been improved.
- Code style could have been improved.
- Code documentation could have been improved.
- Functions could have been used dynamically.
- Cypress could have been used.
- Bundle and loading could have been improved.
- Table Data working logic could be improved based on API.
- Git Commit & Task Management
Navigate to the example:
cd rest-nextjs-express
Install dependencies for your backend
. Open a terminal window and install the backend
's dependencies
cd backend
npm install
Open a separate terminal window and navigate to your frontend
directory and install its dependencies
cd frontend
npm install
On the terminal window used to install the backend npm dependencies, run the following command to create your SQLite database file. This also creates the Order
and Financial
and FinancialGroup
tables that are defined in prisma/schema.prisma
:
npx prisma migrate dev --name init
When npx prisma migrate dev
is executed against a newly created database, seeding is also triggered. The seed file in prisma/seed.ts
will be executed and your database will be populated with the sample data.
On the same terminal used in step 2, run the following command to start the server:
npm run dev
The server is now running at http://localhost:3001/
.
On the terminal window used to install frontend npm dependencies, run the following command to start the app:
npm run dev
The app is now running, navigate to http://localhost:3000/
in your browser to explore its UI.
You can also access the REST API of the API server directly. It is running localhost:3001
(so you can e.g. reach the API with localhost:3000/orders
).
/api/orders
: Fetch all orders/api/financials
: Fetch all financials/api/financialGroups
: Fetch all financialGroups