Environment | Status |
---|---|
Production | |
Develop |
This project is a web application built with SvelteKit for car rental services.
The application allows users to browse available cars for rent through a seamless user-friendly web interface.
Please note that this project is for educational purposes and is part of a university assignment. It's not intended for commercial use.
Name | Student ID | Role |
---|---|---|
Nathan Grenier | 40250986 | Devops |
Brian Tkatch | 40191139 | Devops |
Annabel Zecchel | 40245507 | Frontend |
Jeremy Crete | 40246576 | Frontend |
David Carciente | 40247907 | Backend |
Nirav Patel | 40248940 | Backend |
Roles are not strictly upheld. The nature of the project's framework (SvelteKit) makes it so every member touches on multiple aspects of the project during development.
This projects approach has been outlined in the SvelteState’s Project Approach and Technology Document.
This document can be accessed in 2 places:
SvelteState’s Project Approach and Technology Document
Make sure to use your Concordia email to access the document.
The decision to use certain technologies was described in the Project Approach section.
The full list of technologies used with explanations for their purpose in the project can be found on this wiki page.
A detailed record of the meetings conducted by the team can be viewed through the following wiki page.
Svelte for VS Code
and Svelte Intellisense
VSCode ExtensionsPrisma
VSCode ExtensionTailwind CSS InteliSense
VSCode ExtensionPrettier
VSCode Extension "editor.formatOnSave": true,
"[svelte]": {
"editor.defaultFormatter": "svelte.svelte-vscode"
},
"[prisma]": {
"editor.defaultFormatter": "Prisma.prisma"
},
Live Share
A docker container is used in development to create a dev database. You'll need to install docker on your computer to be able to use the necessary commands.
Secrets and other configuration values are managed through environment
variables. When developing locally, they can be configured by creating a .env
file in the project's root.
Note: Default values should be optimized for local development, such that a developer can clone and run the project successfully without having to override any configuration values.
The following variables can be configured:
VAR | DESC | DEFAULT |
---|---|---|
DB_HOST | The dev database host | localhost |
DB_USER | The dev database username | devuser |
DB_PASSWORD | The dev database password | supersecret |
DB_NAME | The dev database name | devdb |
DB_PORT | The dev database port | 5432 |
DATABASE_URL | The database URL (used by Prisma) | postgresql://${DB_USER}:${DB_PASSWORD}@${DB_HOST}:${DB_PORT}/${DB_NAME}?schema=public |
DIRECT_DATABASE_URL | Used in development environment to keep Prisma happy | postgresql://${DB_USER}:${DB_PASSWORD}@${DB_HOST}:${DB_PORT}/${DB_NAME}?schema=public |
FAKE_AUTH_PASSWORD | The password that is required on the fake login page | changeme |
USE_FAKE_AUTH | Set to true to bypass authentication |
true |
EXEC_ENV | Current execution environment | development |
SESSION_SIGNING_KEY | 32 random bytes in hex format, used to sign sessions | 480c67189f5ddb38a2b9993724e0327da90467de5628cd3897e579af71d6e7d8 |
SMTP_HOST | Hostname of the SMTP server | smtp.ethereal.email is a good test service |
SMTP_PORT | Port used to connect to the SMTP server | 587 |
SMTP_USER | Username to authenticate to the SMTP server | my@account.email |
SMTP_PASS | Password to authenticate to the SMTP server | password |
Use
nvm
to install the proper version of node for the project (can be found in
package.json
in the engines
object):
nvm install 18
Install the node dependencies:
npm install
Use docker compose to start the development database:
docker compose up
# or run the docker container in detached mode (runs in the background)
docker compose up -d
Start a development server:
npm run dev
# or start the server and open the app in a new browser tab
npm run dev -- --open
In order to initialize the pre-commit hook used in the project, use the following command:
npx husky install
To prototype a change to the Prisma schema and sync the modification with your development database, use the following command:
npx prisma db push
When the Prisma schema is in a stable condition (in the desired state), create a migration file with:
prisma migrate dev
This migration file can then be used to update the databases in other environments (preview, production).
For more detail, visit the Prisma Docs on the topic.
To seed you local database during development, use this command:
npx prisma db seed
Note: Preview deployments will automatically be seeded during the workflow.
If you want to see a visual representation of the database, use the Prisma Studio tool by running:
npx prisma studio
This project uses Vercel's blob storage to host images (most notably of cars).
You can read the docs on how to use the API calls here.
Note: There's a limit on the server upload (4.5MB). Make sure to handle this properly. See the docs for more details.
Make sure to set the new environment variables added to the table.
Unit tests are run using the Vitest testing framework.
Launch unit tests by running:
npm test
Before you created a merge request, make sure that your code is properly
formatted and linted using the following npm commands (located in package.json
under scripts):
npm run typecheck
npm run lint
npm run format
To create a production version of your app:
npm run build
You can preview the production build with npm run preview
.
A preview environment is created whenever a pull request is created and the preliminary tests have passed. This can be used to review any changed made in a production like environment.
Once the pull request is merged, a GitHub action will automatically deploy the application to production.