Carpooling web server which manages and organizes carpools between Tunisian cities.
To run this project, you will need to add the following environment variables to
your .env files. The value of some of these keys could be retrieved from the
file .example.env
PORT
HOST
DB_PORT
POSTGRES_PASSWORD
POSTGRES_DB
POSTGRES_USER
PG_DATA
REDIS_HOST
REDIS_PORT
JWT_ACCESS_TOKEN_SECRET
JWT_REFRESH_TOKEN_SECRET
KARPULLY_EMAIL_LOGIN
KARPULLY_EMAIL_PASSWORD
SEED_NUMBER
LOCATIONIQ_TOKEN
FRONT_END_BASE_URL
GUARDS
- Make sure you have docker installed on your host.
- Make the file run-stop.sh executable.
- To run the up on a specific mode run the following command
./run-stop.sh --type=start --mode=$MODE
where $MODE is in (test | prod | dev).
4. To stop or restart the application
you should just change the "--type=start", and fit it to your needs.
5. In
.env file, the HOST key should have 'postgres' as value.
6. To run the
application in a kubernetes environment run
./k8s/run-stop.sh --type=start
- Make sure you have docker installed on your host.
- Make the file run-stop.sh executable.
- To run the up on a specific mode run the following command
./run-stop.sh --type=start --mode=$MODE
where $MODE is in (test | prod | dev).
4. To stop or restart the application
you should just change the "--type=start", and fit it to your needs.
5. In
.env file, the HOST key should have 'postgres' as value.
6. To run the
application in a kubernetes environment run
./k8s/run-stop.sh --type=start
To run unit tests, run the following command
npm run test
To run e2e tests, run the following command
npm run test:e2e
To generate code coverage, run the following command
npm run test:cov
- Look up for the file .env.example to get an idea about environment variables.
- The phone Number of the user should have the following format: "+216 xxxxxxxx" where the 8 x's represent the phone number of the user.
- Each user should have a unique username and email in the database to avoid spam and fake accounts.
- The rate of the user should be between 0 and 5.
- The age of the user should be between 5 and 100.
- The user will sign up.
- An email will be sent to the user.
- The user must confirm his registration after a maximum of two days.
- All Users could see all carpools and/or specific carpool.
- Only The owner of the carpool could update or remove it.
- Only the admin could access and manage those resources.
- The admin could access all informations.
- The user could manage only its own informations.
The pagination feature is now implemented simply for carpools. Simple Example Query:
query {
paginatedCarpool(
where: {hasSmokePermission: true}
paginationInput: {page: 1, limit: 20}
) {
meta {
itemCount
currentPage
}
items {
hasSmokePermission
description
owner {
username
}
departureDate
}
}
}
- Only the owner of the carpool could accept or reject a submission.
- The user cannot make a submission to its own carpool.
- The owner of a carpool cannot accept(/reject) an already accepted(/rejected) submission.
- The owner of a carpool cannot accept submissions anymore when the available number of places of the carpool reaches 0.
The source code for the site is licensed under the MIT license, which you can find in the LICENSE.txt file.