A project in DAT076 Web applications at Chalmers University of Technology The final report can be found here
Uppdragsportalen is a portal where Mottagningskommittén can mange Nolluppdrag in preperation for the reception weeks.
- Install dependencies
npm install
- Create a .env file and manually populate the variables
cp .env.example .env
Note This project is configured to use a database provided by CockroachDB. In order to use a database, either create a free database on their service or connect to a local postgresql instance like so:
In
schema.prisma
change the provider toprovider="postgresql"Note that a local sqlite database is not possible since sqlite does not support enums.
- Push the schema to the db
npx prisma db push
- Start the dev server
npm run dev
- Run tests
npm run test # run all tests
npm run test:e2e # run only end-to-end test
npm run test:unit # run only unit tests
Note After running all tests or e2e tests a node server is left running, This can cause future tests to fail. Make sure to kill all node instances after running the tests.
Below is a file tree containing important files and folders for the application.
├── docs # contains the final report
├── e2e # contains End-to-end tests
├── prisma # contains the prisma schema, a dev db file and a script for seeding
│ ├── db.sqlite
│ ├── schema.prisma
│ └── seed.ts
├── public # static assets
│ ├── img
│ ├── favicon.ico
│ └── humans.txt
├── src
│ ├── components # React components
│ │ ├── AssignmentData.tsx
│ │ ├── ErrorText.tsx
│ │ ├── homepageSkeleton.tsx
│ │ ├── LoginForm.tsx
│ │ ├── MainPage.tsx
│ │ ├── Navbar.tsx
│ │ ├── Page.tsx
│ │ ├── SideButton.tsx
│ │ ├── SideMenu.tsx
│ │ └── UppdragComment.tsx
│ ├── env # files for validating environment variables
│ │ ├── client.mjs
│ │ ├── schema.mjs
│ │ └── server.mjs
│ ├── pages # pages, or client side "routes"
│ │ ├── api
│ │ │ ├── auth
│ │ │ │ └── [...nextauth].ts # nextauth endpoint for client
│ │ │ └── trpc
│ │ │ └── [trpc].ts # trpc endpoint for client
│ │ ├── uppdrag
│ │ │ ├── edituppdrag
│ │ │ │ └── [id].tsx
│ │ │ ├── viewuppdrag
│ │ │ │ └── [id].tsx
│ │ │ └── newuppdrag.tsx
│ │ ├── accounts.tsx
│ │ ├── _app.tsx # app root
│ │ ├── archive.tsx
│ │ ├── chalmers.tsx
│ │ ├── home.tsx
│ │ ├── login.tsx
│ │ ├── register.tsx
│ │ ├── review.tsx
│ │ └── user.tsx
│ ├── server # server side code
│ │ ├── api
│ │ │ ├── routers # trpc routers
│ │ │ │ ├── uppdragrouter.ts
│ │ │ │ └── userrouter.ts
│ │ │ ├── root.ts
│ │ │ └── trpc.ts
│ │ ├── auth.ts
│ │ ├── db.ts
│ │ └── hash.ts
│ ├── styles
│ │ └── globals.css
│ ├── types
│ │ └── next-auth.d.ts
│ ├── utils
│ │ └── api.ts
│ └── middleware.ts # nextjs middleware, runs on each request from the client.
├── __tests__ # unit tests
│ ├── UppdragRouter.test.tsx
│ └── UserRouter.test.tsx
├── .env.example
├── .eslintrc.json
├── next.config.mjs
├── next-env.d.ts
├── package.json
├── package-lock.json
├── playwright.config.ts
├── postcss.config.cjs
├── prettier.config.cjs
├── readme.md
├── README.md
├── T3.md
├── tailwind.config.cjs
├── tsconfig.json
└── vitest.config.ts
This is a T3 Stack project bootstrapped with create-t3-app
.
We try to keep this project as simple as possible, so you can start with just the scaffolding we set up for you, and add additional things later when they become necessary.
If you are not familiar with the different technologies used in this project, please refer to the respective docs. If you still are in the wind, please join our Discord and ask for help.
To learn more about the T3 Stack, take a look at the following resources:
- Documentation
- Learn the T3 Stack — Check out these awesome tutorials
You can check out the create-t3-app GitHub repository — your feedback and contributions are welcome!
Follow our deployment guides for Vercel, Netlify and Docker for more information.