This is a university assignment project for the course of Web-Development (WWI2019A).
Home | Find Plans |
---|---|
My Orders | Edit Customers associated to own Profile |
Change credentials | Admin - Overiew Page |
This is the recommended way
- You need to have docker installed
- Create a
.env
file and fill in your desired database configuration:
POSTGRES_PASSWORD=postgres
POSTGRES_USER=postgres
POSTGRES_DB=sonnenstrahl
JWT_HASH=randomstr
Warning This file should not be commited to the repository!
- run
docker-compose up
. Docker will pull all images for you and automatically set everting up. This may take 10-15 minutes depending on your maschine's hardware configuration - so be patient and get yourself a coffee! - postgresql should now be running on port
5432
, the express server should be running atlocalhost:80
- See "Sample Data" for admin login credentials
- You need to have a local working postgresql installation running
- In
server
runnpm install
(cd server && npm install
) - Run migrations and seeders, see section below
- To start a local
- developent server, which restarts on filechange run
PORT=80 LOGGING=true JWT_HASH=abc DATABASE_URL=localhost DATABASE_NAME=sonnenstrahl DATABASE_USER=postgres DATABASE_PASSWORD=postgres npm run dev
- production server, run
PORT=80 LOGGING=true JWT_HASH=abc DATABASE_URL=localhost DATABASE_NAME=sonnenstrahl DATABASE_USER=postgres DATABASE_PASSWORD=postgres npm start
Remember to fill in your own database configuaration
- Open a new terminal window. In
frontend
runnpm install
(cd frontend && npm install
) - To start an Angular Dev Server run run
npm start
- The API should be running on port
80
; The Angular development server should be running on port4200
- See "Sample Data" for admin login credentials
Note: When angular is used in development mode, file downloads (like csv exports) won't work.
To run a database migration execute cd server && npm run db:migrate
. The Docker container will do this automatically on restart.
To undo a database migration execute cd server && npm run db:migrate:undo
.
Note: Remember to add your database configuration as ENV variables (DATABASE_NAME=sonnenstrahl DATABASE_PASSWORD=postgres DATABASE_USER=postgres DATABASE_URL=localhost npm run db:migrate
)
A random sample data set is provided by seeders.
To run all seeders execute cd server && npm run db:seed
. The Docker container will do this automatically on restart.
This is not recommended behaviour on production systems.
To undo all seeders run cd server && npm run db:seed:undo
. This may lead to a data loss.
Note: Remember to add your database configuration as ENV variables (DATABASE_NAME=sonnenstrahl DATABASE_PASSWORD=postgres DATABASE_USER=postgres DATABASE_URL=localhost npm run db:seed
)
After the seeders have been executed successfully, you should be able to login as administrator with the following data:
Email: sabrina.wassertal@sonnenstrahl-energie.com
Password: qwertz123